From dee4ba59792238f9fd69ba7f5bf4f2711da52030 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 29 Oct 2013 10:46:23 -0400 Subject: [PATCH] * src/eval.c (run_hook_with_args): Use FUNCTIONP. * test/indent/css-mode.css (.x2): Test alignement inside braces. * test/indent/prolog.prolog: Test alignment of ->; with operator at bol. --- src/ChangeLog | 22 +++++++++++++--------- src/buffer.c | 6 +++--- src/eval.c | 2 +- test/ChangeLog | 14 ++++++++++---- test/indent/css-mode.css | 2 ++ test/indent/prolog.prolog | 14 +++++++++++++- test/indent/shell.sh | 2 +- 7 files changed, 43 insertions(+), 19 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 55ff9390ce..7177453546 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2013-10-29 Stefan Monnier + + * eval.c (run_hook_with_args): Use FUNCTIONP. + 2013-10-29 Dmitry Antipov * xterm.h (struct x_output): For 'black_relief' and 'white_relief' @@ -227,8 +231,8 @@ (get_adapters_info): New wrapper function. (globals_of_w32): Initialize g_b_init_get_adapters_info. - * process.h (network_interface_list, network_interface_info): New - prototypes. + * process.h (network_interface_list, network_interface_info): + New prototypes. * process.c (conv_sockaddr_to_lisp): Now externally-visible. (Fnetwork_interface_list, Fnetwork_interface_info): Define for @@ -559,8 +563,8 @@ (xw_popup_dialog): New function, with X-specific bits of popup dialogs. - * xdisp.c (deep_copy_glyph_row, display_tty_menu_item): New - functions. + * xdisp.c (deep_copy_glyph_row, display_tty_menu_item): + New functions. * window.c (Fset_window_configuration): Use run-time tests of the frame type instead of compile-time conditionals, when menu-bar @@ -625,11 +629,11 @@ of, or in addition to, compile-time conditionals. (menu_item_width, Fmenu_bar_menu_at_x_y): New functions. (Fx_popup_menu): Detect when the function is called from keyboard - on a TTY. Don't barf when invoked on a text-mode frame. Check - frame type at run time, instead of compile-time conditionals for - invoking terminal-specific menu-show functions. Call - tty_menu_show on text-mode frames. - (Fx_popup_dialog): Moved here from xmenu.c. Test frame types at + on a TTY. Don't barf when invoked on a text-mode frame. + Check frame type at run time, instead of compile-time conditionals for + invoking terminal-specific menu-show functions. + Call tty_menu_show on text-mode frames. + (Fx_popup_dialog): Move here from xmenu.c. Test frame types at run time to determine which alternative to invoke; support dialogs on TTYs. diff --git a/src/buffer.c b/src/buffer.c index ef04ca7018..e44908a543 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2074,7 +2074,7 @@ the current buffer's major mode. */) count = SPECPDL_INDEX (); /* To select a nonfundamental mode, - select the buffer temporarily and then call the mode function. */ + select the buffer temporarily and then call the mode function. */ record_unwind_protect (save_excursion_restore, save_excursion_save ()); @@ -2114,7 +2114,7 @@ set_buffer_internal_1 (register struct buffer *b) old_buf = current_buffer; current_buffer = b; - last_known_column_point = -1; /* invalidate indentation cache */ + last_known_column_point = -1; /* Invalidate indentation cache. */ if (old_buf) { @@ -2138,7 +2138,7 @@ set_buffer_internal_1 (register struct buffer *b) fetch_buffer_markers (b); /* Look down buffer's list of local Lisp variables - to find and update any that forward into C variables. */ + to find and update any that forward into C variables. */ do { diff --git a/src/eval.c b/src/eval.c index 1e0a63a0ec..a25dc1b5aa 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2479,7 +2479,7 @@ run_hook_with_args (ptrdiff_t nargs, Lisp_Object *args, if (EQ (val, Qunbound) || NILP (val)) return ret; - else if (!CONSP (val) || EQ (XCAR (val), Qlambda)) + else if (!CONSP (val) || FUNCTIONP (val)) { args[0] = val; return funcall (nargs, args); diff --git a/test/ChangeLog b/test/ChangeLog index 9db787cc3a..eadff76e7b 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,9 +1,15 @@ +2013-10-29 Stefan Monnier + + * indent/prolog.prolog: Test alignment of ->; with operator at bol. + + * indent/css-mode.css (.x2): Test alignement inside braces. + 2013-10-26 Dmitry Gutov * indent/ruby.rb: New failing example. - * automated/ruby-mode-tests.el (ruby-toggle-block-to-brace): Fix - the test, in respect to adding the space after the curly. + * automated/ruby-mode-tests.el (ruby-toggle-block-to-brace): + Fix the test, in respect to adding the space after the curly. 2013-10-24 Michael Albinus @@ -45,8 +51,8 @@ 2013-10-21 Dmitry Gutov - * indent/ruby.rb: New examples for indentation of blocks. Example - of hash inside parens that inflooped before the present commit. + * indent/ruby.rb: New examples for indentation of blocks. + Example of hash inside parens that inflooped before the present commit. 2013-10-17 Barry O'Reilly diff --git a/test/indent/css-mode.css b/test/indent/css-mode.css index 9a2a15f6ba..4dbab06975 100644 --- a/test/indent/css-mode.css +++ b/test/indent/css-mode.css @@ -4,6 +4,8 @@ .x2 { + foo: bar; + bar: baz; } div.x3 diff --git a/test/indent/prolog.prolog b/test/indent/prolog.prolog index 8af21877b5..5b5d272c57 100644 --- a/test/indent/prolog.prolog +++ b/test/indent/prolog.prolog @@ -48,7 +48,19 @@ subst(X, V, FV, lambda(Y, Ti, Bi), lambda(Y1, To, Bo)) :- subst(Y, Y1, [], Bi, Bi1); Y1 = Y, Bi1 = Bi), %% Perform substitution on the body. - subst(X, V, FV, Bi1, Bo)). + subst(X, V, FV, Bi1, Bo)), + ( X = Y + %% If X is equal to Y, X is shadowed, so no subst can take place. + -> Y1 = Y, Bo = Bi + ; (member((Y, _), FV) + %% If Y appears in FV, it can appear in V, so we need to + %% rename it to avoid name capture. + -> new_atom(Y, Y1), + subst(Y, Y1, [], Bi, Bi1) + ; Y1 = Y, Bi1 = Bi), + %% Perform substitution on the body. + subst(X, V, FV, Bi1, Bo) + ). subst(X, V, FV, pi(Y, Ti, Bi), pi(Y1, To, Bo)) :- subst(X, V, FV, lambda(Y, Ti, Bi), lambda(Y1, To, Bo)). subst(X, V, FV, forall(Y, Ti, Bi), forall(Y1, To, Bo)) :- diff --git a/test/indent/shell.sh b/test/indent/shell.sh index e402398b99..fdf736e06b 100755 --- a/test/indent/shell.sh +++ b/test/indent/shell.sh @@ -35,7 +35,7 @@ echo $[1<<8] # bug#11263 declare -a VERSION for i in $(ls "$PREFIX/sbin") ; do echo -e $N')' $i - VERSION[${#VERSION[*]}]=$i #bug#11946. + VERSION[${#VERSION[*]}]=$i # bug#11946. N=$(($N + 1)) done -- 2.20.1