From c4f6ca24744ab39f34e9ff19741b76a049769ef5 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 24 Jun 2005 09:04:15 +0000 Subject: (Frename_file)[!DOS_NT]: Don't call chown on MSDOS/Windows. --- src/ChangeLog | 5 +++++ src/fileio.c | 2 ++ 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 2ffb3c4959c..63de84edd63 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-24 Juanma Barranquero + + * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on + MSDOS/Windows. + 2005-06-23 Richard M. Stallman * xdisp.c (get_next_display_element): Finish reversing the tests of diff --git a/src/fileio.c b/src/fileio.c index 6bdc030bc6c..2fb12959786 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2789,9 +2789,11 @@ This is what happens in interactive use with M-x. */) NILP (ok_if_already_exists) ? Qnil : Qt, Qt, Qnil); +#ifndef DOS_NT /* Preserve owner and group, if possible (if we are root). */ if (stat (SDATA (encoded_file), &data) >= 0) chown (SDATA (encoded_file), data.st_uid, data.st_gid); +#endif Fdelete_file (file); } -- cgit v1.2.1 From 0afd087155141996df48afd01af66c7aa1669c8e Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 24 Jun 2005 09:32:11 +0000 Subject: (syms_of_xdisp) : Doc fix. (syms_of_xdisp) : Doc fix. --- src/xdisp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 1bb2b4292c0..5bb157cae73 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21660,7 +21660,7 @@ note_mouse_highlight (f, x, y) /* If we were displaying active text in another window, clear that. Also clear if we move out of text area in same window. */ if (! EQ (window, dpyinfo->mouse_face_window) - || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE + || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE && !NILP (dpyinfo->mouse_face_window))) clear_mouse_face (dpyinfo); @@ -22885,17 +22885,17 @@ The face used for trailing whitespace is `trailing-whitespace'. */); DEFVAR_LISP ("nobreak-char-display", &Vnobreak_char_display, doc: /* *Control highlighting of nobreak space and soft hyphen. -t means highlight the character itself (for nobreak space, -use face `nobreak-space'. -nil means no highlighting. -other values mean display the escape glyph followed by an ordinary +A value of t means highlight the character itself (for nobreak space, +use face `nobreak-space'). +A value of nil means no highlighting. +Other values mean display the escape glyph followed by an ordinary space or ordinary hyphen. */); Vnobreak_char_display = Qt; DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer, doc: /* *The pointer shape to show in void text areas. -Nil means to show the text pointer. Other options are `arrow', `text', -`hand', `vdrag', `hdrag', `modeline', and `hourglass'. */); +A value of nil means to show the text pointer. Other options are `arrow', +`text', `hand', `vdrag', `hdrag', `modeline', and `hourglass'. */); Vvoid_text_area_pointer = Qarrow; DEFVAR_LISP ("inhibit-redisplay", &Vinhibit_redisplay, -- cgit v1.2.1 From 3338c0adb59486c30de60c991b898ad118579e9c Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 24 Jun 2005 09:33:10 +0000 Subject: *** empty log message *** --- src/ChangeLog | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 63de84edd63..6820cdfe06a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2005-06-24 Juanma Barranquero + * xdisp.c (syms_of_xdisp) : Doc fix. + (syms_of_xdisp) : Doc fix. + * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on MSDOS/Windows. -- cgit v1.2.1 From 0e20b3a37b9da179f9a7a49e162acd410ea3413f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 24 Jun 2005 10:39:20 +0000 Subject: (chown): New; define to sys_chown. --- src/s/ms-w32.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index 998c1f7cf05..10e3bfe3a5a 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -311,6 +311,7 @@ Boston, MA 02111-1307, USA. */ #define chdir sys_chdir #undef chmod #define chmod sys_chmod +#define chown sys_chown #undef close #define close sys_close #undef creat -- cgit v1.2.1 From 2d5ab4bf851c71c0589b018a8bfc30cdc0a903e7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 24 Jun 2005 10:39:56 +0000 Subject: (sys_chown): New function. --- src/w32.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/w32.c b/src/w32.c index 1bb4a91ff03..1585b3eaf1e 100644 --- a/src/w32.c +++ b/src/w32.c @@ -1897,6 +1897,14 @@ sys_chmod (const char * path, int mode) return _chmod (map_w32_filename (path, NULL), mode); } +int +sys_chown (const char *path, uid_t owner, gid_t group) +{ + if (sys_chmod (path, _S_IREAD) == -1) /* check if file exists */ + return -1; + return 0; +} + int sys_creat (const char * path, int mode) { -- cgit v1.2.1 From 90296dd36cbbdf2173007ed3153902e39503cffe Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 24 Jun 2005 10:41:19 +0000 Subject: (Frename_file): Undo last change: no need to ifdef away chown on DOS_NT platforms. --- src/ChangeLog | 9 +++++++++ src/fileio.c | 2 -- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 6820cdfe06a..6bec8c3b044 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2005-06-24 Eli Zaretskii + + * fileio.c (Frename_file): Undo last change: no need to ifdef away + chown on DOS_NT platforms. + + * w32.c (sys_chown): New function. + + * s/ms-w32.h (chown): New; define to sys_chown. + 2005-06-24 Juanma Barranquero * xdisp.c (syms_of_xdisp) : Doc fix. diff --git a/src/fileio.c b/src/fileio.c index 2fb12959786..6bdc030bc6c 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2789,11 +2789,9 @@ This is what happens in interactive use with M-x. */) NILP (ok_if_already_exists) ? Qnil : Qt, Qt, Qnil); -#ifndef DOS_NT /* Preserve owner and group, if possible (if we are root). */ if (stat (SDATA (encoded_file), &data) >= 0) chown (SDATA (encoded_file), data.st_uid, data.st_gid); -#endif Fdelete_file (file); } -- cgit v1.2.1 From 7690cbb0f9d9f7bb56edd67c06a89f116dd4f80d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Jun 2005 04:31:49 +0000 Subject: (read1): 0.0e+NaN should make a "positive" NaN. --- src/lread.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/lread.c b/src/lread.c index 9317933013e..ccc94c32dd1 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2595,6 +2595,23 @@ read1 (readcharfun, pch, first_in_list) break; case 'N': value = zero / zero; + + /* If that made a "negative" NaN, negate it. */ + + { + int i; + union { double d; char c[sizeof (double)]; } u_data, u_minus_zero; + + u_data.d = value; + u_minus_zero.d = - 0.0; + for (i = 0; i < sizeof (double); i++) + if (u_data.c[i] & u_minus_zero.c[i]) + { + value = - value; + break; + } + } + /* Now VALUE is a positive NaN. */ break; default: value = atof (read_buffer + negative); -- cgit v1.2.1 From 09352e8f259561df2d7c34a7feba028ba32a0149 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Jun 2005 04:48:24 +0000 Subject: *** empty log message *** --- src/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 6bec8c3b044..44f00321d36 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-06-25 Richard M. Stallman + + * lread.c (read1): 0.0e+NaN should make a "positive" NaN. + 2005-06-24 Eli Zaretskii * fileio.c (Frename_file): Undo last change: no need to ifdef away -- cgit v1.2.1 From 9f5903bb77b7f1f1e7a6598b3c496961e0ee02ea Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Jun 2005 14:37:47 +0000 Subject: (call_debugger): Take full care of extending stack limits to make space for the debugger, and restore the change afterward. Bind debug-on-error to nil. (restore_stack_limits): New subroutine. (Fsignal): Extend specpdl bound along with eval depth bound, for calling edebug. Don't do either one, for calling debugger. (find_handler_clause): Don't bind debug-on-error here. Don't unbind anything either. Temporarily advance max_specpdl_size for calling internal_with_output_to_temp_buffer. (grow_specpdl): Don't alter max_specpdl_size before signaling an error. (syms_of_eval) : Doc fix. --- src/eval.c | 71 ++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/eval.c b/src/eval.c index 8ad289fd51f..c33021da7b7 100644 --- a/src/eval.c +++ b/src/eval.c @@ -227,6 +227,18 @@ init_eval () when_entered_debugger = -1; } +/* unwind-protect function used by call_debugger. */ + +static Lisp_Object +restore_stack_limits (data) + Lisp_Object data; +{ + max_specpdl_size = XINT (XCAR (data)); + max_lisp_eval_depth = XINT (XCDR (data)); +} + +/* Call the Lisp debugger, giving it argument ARG. */ + Lisp_Object call_debugger (arg) Lisp_Object arg; @@ -234,12 +246,22 @@ call_debugger (arg) int debug_while_redisplaying; int count = SPECPDL_INDEX (); Lisp_Object val; + int old_max = max_specpdl_size; - if (lisp_eval_depth + 20 > max_lisp_eval_depth) - max_lisp_eval_depth = lisp_eval_depth + 20; + /* Temporarily bump up the stack limits, + so the debugger won't run out of stack. */ - if (specpdl_size + 40 > max_specpdl_size) - max_specpdl_size = specpdl_size + 40; + max_specpdl_size += 1; + record_unwind_protect (restore_stack_limits, + Fcons (make_number (old_max), + make_number (max_lisp_eval_depth))); + max_specpdl_size = old_max; + + if (lisp_eval_depth + 40 > max_lisp_eval_depth) + max_lisp_eval_depth = lisp_eval_depth + 40; + + if (SPECPDL_INDEX () + 100 > max_specpdl_size) + max_specpdl_size = SPECPDL_INDEX () + 100; #ifdef HAVE_X_WINDOWS if (display_hourglass_p) @@ -256,6 +278,7 @@ call_debugger (arg) specbind (intern ("debugger-may-continue"), debug_while_redisplaying ? Qnil : Qt); specbind (Qinhibit_redisplay, Qnil); + specbind (Qdebug_on_error, Qnil); #if 0 /* Binding this prevents execution of Lisp code during redisplay, which necessarily leads to display problems. */ @@ -1533,7 +1556,16 @@ See also the function `condition-case'. */) /* This hook is used by edebug. */ if (! NILP (Vsignal_hook_function) && ! NILP (error_symbol)) - call2 (Vsignal_hook_function, error_symbol, data); + { + /* Edebug takes care of restoring these variables when it exits. */ + if (lisp_eval_depth + 20 > max_lisp_eval_depth) + max_lisp_eval_depth = lisp_eval_depth + 20; + + if (SPECPDL_INDEX () + 40 > max_specpdl_size) + max_specpdl_size = SPECPDL_INDEX () + 40; + + call2 (Vsignal_hook_function, error_symbol, data); + } conditions = Fget (real_error_symbol, Qerror_conditions); @@ -1555,12 +1587,6 @@ See also the function `condition-case'. */) { register Lisp_Object clause; - if (lisp_eval_depth + 20 > max_lisp_eval_depth) - max_lisp_eval_depth = lisp_eval_depth + 20; - - if (specpdl_size + 40 > max_specpdl_size) - max_specpdl_size = specpdl_size + 40; - clause = find_handler_clause (handlerlist->handler, conditions, error_symbol, data, &debugger_value); @@ -1673,7 +1699,11 @@ skip_debugger (conditions, data) = SIG is nil, and DATA is (SYMBOL . REST-OF-DATA). This is for memory-full errors only. - Store value returned from debugger into *DEBUGGER_VALUE_PTR. */ + Store value returned from debugger into *DEBUGGER_VALUE_PTR. + + We need to increase max_specpdl_size temporarily around + anything we do that can push on the specpdl, so as not to get + a second error here in case we're handling specpdl overflow. */ static Lisp_Object find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) @@ -1691,7 +1721,6 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) || !NILP (Vdebug_on_signal)) /* This says call debugger even if there is a handler. */ { - int count = SPECPDL_INDEX (); int debugger_called = 0; Lisp_Object sig_symbol, combined_data; /* This is set to 1 if we are handling a memory-full error, @@ -1713,6 +1742,7 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) if (wants_debugger (Vstack_trace_on_error, conditions)) { + max_specpdl_size++; #ifdef PROTOTYPES internal_with_output_to_temp_buffer ("*Backtrace*", (Lisp_Object (*) (Lisp_Object)) Fbacktrace, @@ -1721,6 +1751,7 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) internal_with_output_to_temp_buffer ("*Backtrace*", Fbacktrace, Qnil); #endif + max_specpdl_size--; } if (! no_debugger && (EQ (sig_symbol, Qquit) @@ -1729,7 +1760,6 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) && ! skip_debugger (conditions, combined_data) && when_entered_debugger < num_nonmacro_input_events) { - specbind (Qdebug_on_error, Qnil); *debugger_value_ptr = call_debugger (Fcons (Qerror, Fcons (combined_data, Qnil))); @@ -1739,7 +1769,7 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) if (EQ (handlers, Qerror)) { if (debugger_called) - return unbind_to (count, Qlambda); + return Qlambda; return Qt; } } @@ -3019,13 +3049,8 @@ grow_specpdl () if (max_specpdl_size < 400) max_specpdl_size = 400; if (specpdl_size >= max_specpdl_size) - { - if (!NILP (Vdebug_on_error)) - /* Leave room for some specpdl in the debugger. */ - max_specpdl_size = specpdl_size + 100; - Fsignal (Qerror, - Fcons (build_string ("Variable binding depth exceeds max-specpdl-size"), Qnil)); - } + Fsignal (Qerror, + Fcons (build_string ("Variable binding depth exceeds max-specpdl-size"), Qnil)); } specpdl_size *= 2; if (specpdl_size > max_specpdl_size) @@ -3333,7 +3358,7 @@ syms_of_eval () { DEFVAR_INT ("max-specpdl-size", &max_specpdl_size, doc: /* *Limit on number of Lisp variable bindings & unwind-protects. -If Lisp code tries to make more than this many at once, +If Lisp code tries to increase the total number past this amount, an error is signaled. You can safely use a value considerably larger than the default value, if that proves inconveniently small. However, if you increase it too far, -- cgit v1.2.1 From df13531dc21070537929cbba1183d6232e91c5de Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Jun 2005 14:38:05 +0000 Subject: *** empty log message *** --- src/ChangeLog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 44f00321d36..17917b159e3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,19 @@ 2005-06-25 Richard M. Stallman + * eval.c (call_debugger): Take full care of extending stack limits + to make space for the debugger, and restore the change afterward. + Bind debug-on-error to nil. + (restore_stack_limits): New subroutine. + (Fsignal): Extend specpdl bound along with eval depth bound, + for calling edebug. Don't do either one, for calling debugger. + (find_handler_clause): Don't bind debug-on-error here. + Don't unbind anything either. + Temporarily advance max_specpdl_size for calling + internal_with_output_to_temp_buffer. + (grow_specpdl): Don't alter max_specpdl_size before signaling + an error. + (syms_of_eval) : Doc fix. + * lread.c (read1): 0.0e+NaN should make a "positive" NaN. 2005-06-24 Eli Zaretskii -- cgit v1.2.1 From 92489bddbb19494bb39bf9f9a65e43254246d389 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Jun 2005 22:33:51 +0000 Subject: (try_window): Declare new arg. --- src/dispextern.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/dispextern.h b/src/dispextern.h index 2c70de31436..e77a272ef4b 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -2593,7 +2593,7 @@ int line_bottom_y P_ ((struct it *)); int display_prop_intangible_p P_ ((Lisp_Object)); void resize_echo_area_exactly P_ ((void)); int resize_mini_window P_ ((struct window *, int)); -int try_window P_ ((Lisp_Object, struct text_pos)); +int try_window P_ ((Lisp_Object, struct text_pos, int)); void window_box P_ ((struct window *, int, int *, int *, int *, int *)); int window_box_height P_ ((struct window *)); int window_text_bottom_y P_ ((struct window *)); -- cgit v1.2.1 From 493c1d49e5bb81a0af9fa91cb5098b80ed531547 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Jun 2005 22:35:42 +0000 Subject: (try_window): New arg CHECK_MARGINS. Calls changed. (redisplay_window): Handle try_window reporting point in scroll margin. --- src/xdisp.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 5bb157cae73..51ce35fedd7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7592,7 +7592,7 @@ display_echo_area_1 (a1, a2, a3, a4) clear_glyph_matrix (w->desired_matrix); XSETWINDOW (window, w); SET_TEXT_POS (start, BEG, BEG_BYTE); - try_window (window, start); + try_window (window, start, 0); return window_height_changed_p; } @@ -11570,7 +11570,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, /* Display the window. Give up if new fonts are loaded, or if point doesn't appear. */ - if (!try_window (window, startp)) + if (!try_window (window, startp, 0)) rc = SCROLLING_NEED_LARGER_MATRICES; else if (w->cursor.vpos < 0) { @@ -12173,6 +12173,7 @@ redisplay_window (window, just_this_one_p) { /* We set this later on if we have to adjust point. */ int new_vpos = -1; + int val; w->force_start = Qnil; w->vscroll = 0; @@ -12206,12 +12207,16 @@ redisplay_window (window, just_this_one_p) /* Redisplay, then check if cursor has been set during the redisplay. Give up if new fonts were loaded. */ - if (!try_window (window, startp)) + val = try_window (window, startp, 1); + if (!val) { w->force_start = Qt; clear_glyph_matrix (w->desired_matrix); goto need_larger_matrices; } + /* Point was outside the scroll margins. */ + if (val < 0) + new_vpos = window_box_height (w) / 2; if (w->cursor.vpos < 0 && !w->frozen_window_start_p) { @@ -12254,7 +12259,7 @@ redisplay_window (window, just_this_one_p) && !NILP (current_buffer->mark_active)) { clear_glyph_matrix (w->desired_matrix); - if (!try_window (window, startp)) + if (!try_window (window, startp, 0)) goto need_larger_matrices; } } @@ -12344,7 +12349,11 @@ redisplay_window (window, just_this_one_p) = try_window_reusing_current_matrix (w))) { IF_DEBUG (debug_method_add (w, "1")); - try_window (window, startp); + if (try_window (window, startp, 1) < 0) + /* -1 means we need to scroll. + 0 means we need new matrices, but fonts_changed_p + is set in that case, so we will detect it below. */ + goto try_to_scroll; } if (fonts_changed_p) @@ -12474,7 +12483,7 @@ redisplay_window (window, just_this_one_p) || MINI_WINDOW_P (w) || !(used_current_matrix_p = try_window_reusing_current_matrix (w))) - try_window (window, startp); + try_window (window, startp, 0); /* If new fonts have been loaded (due to fontsets), give up. We have to start a new redisplay since we need to re-adjust glyph @@ -12494,13 +12503,13 @@ redisplay_window (window, just_this_one_p) { clear_glyph_matrix (w->desired_matrix); move_it_by_lines (&it, 1, 0); - try_window (window, it.current.pos); + try_window (window, it.current.pos, 0); } else if (PT < IT_CHARPOS (it)) { clear_glyph_matrix (w->desired_matrix); move_it_by_lines (&it, -1, 0); - try_window (window, it.current.pos); + try_window (window, it.current.pos, 0); } else { @@ -12683,14 +12692,18 @@ redisplay_window (window, just_this_one_p) /* Build the complete desired matrix of WINDOW with a window start - buffer position POS. Value is non-zero if successful. It is zero - if fonts were loaded during redisplay which makes re-adjusting - glyph matrices necessary. */ + buffer position POS. + + Value is 1 if successful. It is zero if fonts were loaded during + redisplay which makes re-adjusting glyph matrices necessary, and -1 + if point would appear in the scroll margins. + (We check that only if CHECK_MARGINS is nonzero. */ int -try_window (window, pos) +try_window (window, pos, check_margins) Lisp_Object window; struct text_pos pos; + int check_margins; { struct window *w = XWINDOW (window); struct it it; @@ -12715,6 +12728,30 @@ try_window (window, pos) return 0; } + /* Don't let the cursor end in the scroll margins. */ + if (check_margins) + { + int this_scroll_margin, cursor_height; + + this_scroll_margin = max (0, scroll_margin); + this_scroll_margin = min (this_scroll_margin, WINDOW_TOTAL_LINES (w) / 4); + this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); + cursor_height = MATRIX_ROW (w->desired_matrix, w->cursor.vpos)->height; + + if ((w->cursor.y < this_scroll_margin + && CHARPOS (pos) > BEGV) + /* Old redisplay didn't take scroll margin into account at the bottom, + but then global-hl-line-mode doesn't scroll. KFS 2004-06-14 */ + || (w->cursor.y + (make_cursor_line_fully_visible_p + ? cursor_height + this_scroll_margin + : 1)) > it.last_visible_y) + { + w->cursor.vpos = -1; + clear_glyph_matrix (w->desired_matrix); + return -1; + } + } + /* If bottom moved off end of frame, change mode line percentage. */ if (XFASTINT (w->window_end_pos) <= 0 && Z != IT_CHARPOS (it)) -- cgit v1.2.1 From 29e952546a2a2d16c5e397d5924a2a2086b370ec Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Jun 2005 22:37:06 +0000 Subject: (Fx_show_tip): Pass new arg to try_window. --- src/macfns.c | 2 +- src/w32fns.c | 2 +- src/xfns.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/macfns.c b/src/macfns.c index da1afa13bd8..d0e97e15f69 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -4088,7 +4088,7 @@ Text larger than the specified size is clipped. */) clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); SET_TEXT_POS (pos, BEGV, BEGV_BYTE); - try_window (FRAME_ROOT_WINDOW (f), pos); + try_window (FRAME_ROOT_WINDOW (f), pos, 0); /* Compute width and height of the tooltip. */ width = height = 0; diff --git a/src/w32fns.c b/src/w32fns.c index e9af1b8ce2f..36131f2d1d8 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7586,7 +7586,7 @@ Text larger than the specified size is clipped. */) clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); SET_TEXT_POS (pos, BEGV, BEGV_BYTE); - try_window (FRAME_ROOT_WINDOW (f), pos); + try_window (FRAME_ROOT_WINDOW (f), pos, 0); /* Compute width and height of the tooltip. */ width = height = 0; diff --git a/src/xfns.c b/src/xfns.c index 4e0e18137c3..17a93ac887e 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5086,7 +5086,7 @@ Text larger than the specified size is clipped. */) clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); SET_TEXT_POS (pos, BEGV, BEGV_BYTE); - try_window (FRAME_ROOT_WINDOW (f), pos); + try_window (FRAME_ROOT_WINDOW (f), pos, 0); /* Compute width and height of the tooltip. */ width = height = 0; -- cgit v1.2.1 From 586702ceeb85856b076b7eec369791c1bb66e765 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Jun 2005 22:37:49 +0000 Subject: (Fcopy_file): New arg PRESERVE_UID_GID. Use fchmod to copy the file modes. (Frename_file): Don't copy UID and GID here; instead, specify t for PRESERVE_UID_GID when calling Fcopy_file. --- src/fileio.c | 57 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/fileio.c b/src/fileio.c index 6bdc030bc6c..c4a267f4ea1 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2406,7 +2406,7 @@ barf_or_query_if_file_exists (absname, querystring, interactive, statptr, quick) return; } -DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 5, +DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 6, "fCopy file: \nGCopy %s to file: \np\nP", doc: /* Copy FILE to NEWNAME. Both args must be strings. If NEWNAME names a directory, copy FILE there. @@ -2426,9 +2426,13 @@ for an existing file with the same name. If MUSTBENEW is `excl', that means to get an error if the file already exists; never overwrite. If MUSTBENEW is neither nil nor `excl', that means ask for confirmation before overwriting, but do go ahead and overwrite the file -if the user confirms. */) - (file, newname, ok_if_already_exists, keep_time, mustbenew) +if the user confirms. + +If PRESERVE-UID-GID is non-nil, we try to transfer the +uid and gid of FILE to NEWNAME. */) + (file, newname, ok_if_already_exists, keep_time, mustbenew, preserve_uid_gid) Lisp_Object file, newname, ok_if_already_exists, keep_time, mustbenew; + Lisp_Object preserve_uid_gid; { int ifd, ofd, n; char buf[16 * 1024]; @@ -2570,6 +2574,26 @@ if the user confirms. */) report_file_error ("I/O error", Fcons (newname, Qnil)); immediate_quit = 0; + /* Preserve the owner and group, if requested. */ + if (input_file_statable_p && ! NILP (preserve_uid_gid)) + fchown (ofd, st.st_uid, st.st_gid); + + if (input_file_statable_p) + { +#ifndef MSDOS + fchmod (ofd, st.st_mode & 07777); +#else /* MSDOS */ +#if defined (__DJGPP__) && __DJGPP__ > 1 + /* In DJGPP v2.0 and later, fstat usually returns true file mode bits, + and if it can't, it tells so. Otherwise, under MSDOS we usually + get only the READ bit, which will make the copied file read-only, + so it's better not to chmod at all. */ + if ((_djstat_flags & _STFAIL_WRITEBIT) == 0) + chmod (SDATA (encoded_newname), st.st_mode & 07777); +#endif /* DJGPP version 2 or newer */ +#endif /* MSDOS */ + } + /* Closing the output clobbers the file times on some systems. */ if (emacs_close (ofd) < 0) report_file_error ("I/O error", Fcons (newname, Qnil)); @@ -2587,18 +2611,6 @@ if the user confirms. */) Fcons (build_string ("Cannot set file date"), Fcons (newname, Qnil))); } -#ifndef MSDOS - chmod (SDATA (encoded_newname), st.st_mode & 07777); -#else /* MSDOS */ -#if defined (__DJGPP__) && __DJGPP__ > 1 - /* In DJGPP v2.0 and later, fstat usually returns true file mode bits, - and if it can't, it tells so. Otherwise, under MSDOS we usually - get only the READ bit, which will make the copied file read-only, - so it's better not to chmod at all. */ - if ((_djstat_flags & _STFAIL_WRITEBIT) == 0) - chmod (SDATA (encoded_newname), st.st_mode & 07777); -#endif /* DJGPP version 2 or newer */ -#endif /* MSDOS */ } emacs_close (ifd); @@ -2775,7 +2787,6 @@ This is what happens in interactive use with M-x. */) { if (errno == EXDEV) { - struct stat data; #ifdef S_IFLNK symlink_target = Ffile_symlink_p (file); if (! NILP (symlink_target)) @@ -2783,15 +2794,11 @@ This is what happens in interactive use with M-x. */) NILP (ok_if_already_exists) ? Qnil : Qt); else #endif - Fcopy_file (file, newname, - /* We have already prompted if it was an integer, - so don't have copy-file prompt again. */ - NILP (ok_if_already_exists) ? Qnil : Qt, - Qt, Qnil); - - /* Preserve owner and group, if possible (if we are root). */ - if (stat (SDATA (encoded_file), &data) >= 0) - chown (SDATA (encoded_file), data.st_uid, data.st_gid); + Fcopy_file (file, newname, + /* We have already prompted if it was an integer, + so don't have copy-file prompt again. */ + NILP (ok_if_already_exists) ? Qnil : Qt, + Qt, Qnil, Qt); Fdelete_file (file); } -- cgit v1.2.1 From a68d870b75358ac449156ebcdc32583580b8eae2 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Jun 2005 22:38:44 +0000 Subject: *** empty log message *** --- src/ChangeLog | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 17917b159e3..046d1a321fe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,21 @@ 2005-06-25 Richard M. Stallman + * macfns.c (Fx_show_tip): Pass new arg to try_window. + + * w32fns.c (Fx_show_tip): Pass new arg to try_window. + + * xfns.c (Fx_show_tip): Pass new arg to try_window. + + * xdisp.c (try_window): New arg CHECK_MARGINS. Calls changed. + (redisplay_window): Handle try_window reporting point in scroll margin. + + * dispextern.h (try_window): Declare new arg. + + * fileio.c (Fcopy_file): New arg PRESERVE_UID_GID. + Use fchmod to copy the file modes. + (Frename_file): Don't copy UID and GID here; + instead, specify t for PRESERVE_UID_GID when calling Fcopy_file. + * eval.c (call_debugger): Take full care of extending stack limits to make space for the debugger, and restore the change afterward. Bind debug-on-error to nil. -- cgit v1.2.1 From 69410484f228767bdce802b93ef5b4dc73940023 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 27 Jun 2005 06:00:54 +0000 Subject: (Fdefvar): Don't try to set constant symbols. --- src/ChangeLog | 4 ++++ src/eval.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 046d1a321fe..dcc8d0f2bd5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-06-27 Juanma Barranquero + + * eval.c (Fdefvar): Don't try to set constant symbols. + 2005-06-25 Richard M. Stallman * macfns.c (Fx_show_tip): Pass new arg to try_window. diff --git a/src/eval.c b/src/eval.c index c33021da7b7..589bf593f15 100644 --- a/src/eval.c +++ b/src/eval.c @@ -806,6 +806,10 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) register Lisp_Object sym, tem, tail; sym = Fcar (args); + if (SYMBOL_CONSTANT_P (sym)) + error ("Cannot defvar a constant symbol: %s", + SDATA (SYMBOL_NAME (sym))); + tail = Fcdr (args); if (!NILP (Fcdr (Fcdr (tail)))) error ("Too many arguments"); -- cgit v1.2.1 From 92de1e01ca47a6555d21053150eb72bf62c11f22 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 27 Jun 2005 07:58:23 +0000 Subject: [USE_CARBON_EVENTS] (mac_convert_event_ref): Fix last change. --- src/ChangeLog | 5 +++++ src/macterm.c | 2 ++ 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index dcc8d0f2bd5..be7c4f54855 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-27 YAMAMOTO Mitsuharu + + * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Fix last + change. + 2005-06-27 Juanma Barranquero * eval.c (Fdefvar): Don't try to set constant symbols. diff --git a/src/macterm.c b/src/macterm.c index 26e7b117fc5..9bcb14aebdb 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -7640,6 +7640,7 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) default: break; } + break; case kEventClassKeyboard: switch (GetEventKind (eventRef)) @@ -7662,6 +7663,7 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) default: break; } + break; default: break; -- cgit v1.2.1 From 3a1f1d792b24eb525ff880d446ccdb730c3f9a19 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 28 Jun 2005 02:27:46 +0000 Subject: (Fdefvar): Improve error message. --- src/ChangeLog | 4 ++++ src/eval.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index be7c4f54855..ee669ce31ae 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-06-27 Richard M. Stallman + + * eval.c (Fdefvar): Improve error message. + 2005-06-27 YAMAMOTO Mitsuharu * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Fix last diff --git a/src/eval.c b/src/eval.c index 589bf593f15..26ed0ef53c4 100644 --- a/src/eval.c +++ b/src/eval.c @@ -807,7 +807,7 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) sym = Fcar (args); if (SYMBOL_CONSTANT_P (sym)) - error ("Cannot defvar a constant symbol: %s", + error ("Constant symbol `%s' specified in defvar", SDATA (SYMBOL_NAME (sym))); tail = Fcdr (args); -- cgit v1.2.1 From 606cdb8902753c80cc588fb4b0f7016d67e809d1 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 29 Jun 2005 02:08:32 +0000 Subject: (user_variable_p_eh): New function. (Fuser_variable_p): Use it. Clarify docstring. Return t for aliases of user options, nil for alias loops. --- src/eval.c | 68 +++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/eval.c b/src/eval.c index 26ed0ef53c4..17e9f7f4360 100644 --- a/src/eval.c +++ b/src/eval.c @@ -889,12 +889,24 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) return sym; } +/* Error handler used in Fuser_variable_p. */ +static Lisp_Object +user_variable_p_eh (ignore) + Lisp_Object ignore; +{ + return Qnil; +} + DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0, - doc: /* Returns t if VARIABLE is intended to be set and modified by users. + doc: /* Return t if VARIABLE is intended to be set and modified by users. \(The alternative is a variable used internally in a Lisp program.) -Determined by whether the first character of the documentation -for the variable is `*' or if the variable is customizable (has a non-nil -value of `standard-value' or of `custom-autoload' on its property list). */) +A variable is a user variable if +\(1) the first character of its documentation is `*', or +\(2) it is customizable (its property list contains a non-nil value + of `standard-value' or `custom-autoload'), or +\(3) it is an alias for another user variable. +Return nil if VARIABLE is an alias and there is a loop in the +chain of symbols. */) (variable) Lisp_Object variable; { @@ -903,23 +915,37 @@ value of `standard-value' or of `custom-autoload' on its property list). */) if (!SYMBOLP (variable)) return Qnil; - documentation = Fget (variable, Qvariable_documentation); - if (INTEGERP (documentation) && XINT (documentation) < 0) - return Qt; - if (STRINGP (documentation) - && ((unsigned char) SREF (documentation, 0) == '*')) - return Qt; - /* If it is (STRING . INTEGER), a negative integer means a user variable. */ - if (CONSP (documentation) - && STRINGP (XCAR (documentation)) - && INTEGERP (XCDR (documentation)) - && XINT (XCDR (documentation)) < 0) - return Qt; - /* Customizable? See `custom-variable-p'. */ - if ((!NILP (Fget (variable, intern ("standard-value")))) - || (!NILP (Fget (variable, intern ("custom-autoload"))))) - return Qt; - return Qnil; + /* If indirect and there's an alias loop, don't check anything else. */ + if (XSYMBOL (variable)->indirect_variable + && NILP (internal_condition_case_1 (indirect_variable, variable, + Qt, user_variable_p_eh))) + return Qnil; + + while (1) + { + documentation = Fget (variable, Qvariable_documentation); + if (INTEGERP (documentation) && XINT (documentation) < 0) + return Qt; + if (STRINGP (documentation) + && ((unsigned char) SREF (documentation, 0) == '*')) + return Qt; + /* If it is (STRING . INTEGER), a negative integer means a user variable. */ + if (CONSP (documentation) + && STRINGP (XCAR (documentation)) + && INTEGERP (XCDR (documentation)) + && XINT (XCDR (documentation)) < 0) + return Qt; + /* Customizable? See `custom-variable-p'. */ + if ((!NILP (Fget (variable, intern ("standard-value")))) + || (!NILP (Fget (variable, intern ("custom-autoload"))))) + return Qt; + + if (!XSYMBOL (variable)->indirect_variable) + return Qnil; + + /* An indirect variable? Let's follow the chain. */ + variable = XSYMBOL (variable)->value; + } } DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0, -- cgit v1.2.1 From b26860ad0eef0bf83b7375256b7cc2984c99859b Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 29 Jun 2005 02:16:08 +0000 Subject: *** empty log message *** --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index ee669ce31ae..31792c1c340 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-06-29 Juanma Barranquero + + * eval.c (user_variable_p_eh): New function. + (Fuser_variable_p): Use it. Clarify docstring. + Return t for aliases of user options, nil for alias loops. + 2005-06-27 Richard M. Stallman * eval.c (Fdefvar): Improve error message. -- cgit v1.2.1 From 9a1505e92e4a0048e6cb722ccf56169b70f9c041 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 29 Jun 2005 08:20:44 +0000 Subject: *** empty log message *** --- src/ChangeLog | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 31792c1c340..29e30cf96c3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -65,17 +65,16 @@ * xdisp.c (syms_of_xdisp) : Doc fix. (syms_of_xdisp) : Doc fix. - * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on - MSDOS/Windows. + * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on MSDOS/Windows. 2005-06-23 Richard M. Stallman * xdisp.c (get_next_display_element): Finish reversing the tests of Vnobreak_char_display. - * xdisp.c (Vnobreak_char_display): Renamed from Vshow_nonbreak_escape. + * xdisp.c (Vnobreak_char_display): Rename from Vshow_nonbreak_escape. All uses changed. - (Qnobreak_space): Renamed from Qno_break_space. All uses changed. + (Qnobreak_space): Rename from Qno_break_space. All uses changed. (syms_of_xdisp): Define nobreak-char-display and nobreak-space. * fileio.c (Frename_file): Preserve owner and group, if possible, @@ -371,8 +370,7 @@ 2005-06-06 Eli Zaretskii - * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): - Remove macros. + * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): Remove macros. * unexw32.c (RVA_TO_PTR): Move here from w32heap.h. -- cgit v1.2.1 From bdf4ec93fdb64406d1ec76811bef2420e785db26 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 29 Jun 2005 23:29:01 +0000 Subject: (window_scroll_pixel_based, window_scroll_line_based): Handle `scroll-preserve-screen-position' non-nil, non-t specially. (syms_of_window): : Doc fix. --- src/window.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/window.c b/src/window.c index aec6c16eb9c..5aa036ec810 100644 --- a/src/window.c +++ b/src/window.c @@ -4783,7 +4783,9 @@ window_scroll_pixel_based (window, n, whole, noerror) /* We moved the window start towards ZV, so PT may be now in the scroll margin at the top. */ move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); - if (IT_CHARPOS (it) == PT && it.current_y >= this_scroll_margin) + if (IT_CHARPOS (it) == PT && it.current_y >= this_scroll_margin + && (NILP (Vscroll_preserve_screen_position) + || EQ (Vscroll_preserve_screen_position, Qt))) /* We found PT at a legitimate height. Leave it alone. */ ; else if (preserve_y >= 0) @@ -4836,7 +4838,9 @@ window_scroll_pixel_based (window, n, whole, noerror) partial_p = it.current_y > it.last_visible_y; } - if (charpos == PT && !partial_p) + if (charpos == PT && !partial_p + && (NILP (Vscroll_preserve_screen_position) + || EQ (Vscroll_preserve_screen_position, Qt))) /* We found PT before we found the display margin, so PT is ok. */ ; else if (preserve_y >= 0) @@ -4951,7 +4955,8 @@ window_scroll_line_based (window, n, whole, noerror) the window-scroll-functions. */ w->force_start = Qt; - if (whole && !NILP (Vscroll_preserve_screen_position)) + if (!NILP (Vscroll_preserve_screen_position) + && (whole || !EQ (Vscroll_preserve_screen_position, Qt))) { SET_PT_BOTH (pos, pos_byte); Fvertical_motion (make_number (original_vpos), window); @@ -6914,9 +6919,13 @@ If there is only one window, it is split regardless of this value. */); DEFVAR_LISP ("scroll-preserve-screen-position", &Vscroll_preserve_screen_position, - doc: /* *Non-nil means scroll commands move point to keep its screen line unchanged. -This is only when it is impossible to keep point fixed and still -scroll as specified. */); + doc: /* *Controls if scroll commands move point to keep its screen line unchanged. +A value of nil means point does not keep its screen position except +at the scroll margin or window boundary respectively. +A value of t means point keeps its screen position if the scroll +command moved it vertically out of the window, e.g. when scrolling +by full screens. +Any other value means point always keeps its screen position. */); Vscroll_preserve_screen_position = Qnil; DEFVAR_LISP ("window-configuration-change-hook", -- cgit v1.2.1