commit bc9cc21d34ae71dc38bd20f224c4b3ac073bcb50 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sat Mar 26 19:24:25 2016 -0700 func-arity minor improvements * src/bytecode.c (get_byte_code_arity): Omit unnecessary runtime test for integer argument, unless debugging. Use EMACS_INT for Emacs integers. * src/eval.c (Ffunc_arity): Omit unused locals. Avoid side effects in ‘if’ expr. (lambda_arity): Use bool for boolean, and EMACS_INT for Emacs ints. diff --git a/src/bytecode.c b/src/bytecode.c index 4ff15d2..fb9f617 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1991,18 +1991,14 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, Lisp_Object get_byte_code_arity (Lisp_Object args_template) { - if (INTEGERP (args_template)) - { - ptrdiff_t at = XINT (args_template); - bool rest = (at & 128) != 0; - int mandatory = at & 127; - ptrdiff_t nonrest = at >> 8; - - return Fcons (make_number (mandatory), - rest ? Qmany : make_number (nonrest)); - } - else - error ("Unknown args template!"); + eassert (NATNUMP (args_template)); + EMACS_INT at = XINT (args_template); + bool rest = (at & 128) != 0; + int mandatory = at & 127; + EMACS_INT nonrest = at >> 8; + + return Fcons (make_number (mandatory), + rest ? Qmany : make_number (nonrest)); } void diff --git a/src/eval.c b/src/eval.c index 64a6655..e90b077 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2946,7 +2946,6 @@ function with `&rest' args, or `unevalled' for a special form. */) Lisp_Object original; Lisp_Object funcar; Lisp_Object result; - short minargs, maxargs; original = function; @@ -2954,9 +2953,12 @@ function with `&rest' args, or `unevalled' for a special form. */) /* Optimize for no indirection. */ function = original; - if (SYMBOLP (function) && !NILP (function) - && (function = XSYMBOL (function)->function, SYMBOLP (function))) - function = indirect_function (function); + if (SYMBOLP (function) && !NILP (function)) + { + function = XSYMBOL (function)->function; + if (SYMBOLP (function)) + function = indirect_function (function); + } if (SUBRP (function)) result = Fsubr_arity (function); @@ -2989,9 +2991,7 @@ function with `&rest' args, or `unevalled' for a special form. */) static Lisp_Object lambda_arity (Lisp_Object fun) { - Lisp_Object val, syms_left, next; - ptrdiff_t minargs, maxargs; - bool optional; + Lisp_Object syms_left; if (CONSP (fun)) { @@ -3018,17 +3018,18 @@ lambda_arity (Lisp_Object fun) else emacs_abort (); - minargs = maxargs = optional = 0; + EMACS_INT minargs = 0, maxargs = 0; + bool optional = false; for (; CONSP (syms_left); syms_left = XCDR (syms_left)) { - next = XCAR (syms_left); + Lisp_Object next = XCAR (syms_left); if (!SYMBOLP (next)) xsignal1 (Qinvalid_function, fun); if (EQ (next, Qand_rest)) return Fcons (make_number (minargs), Qmany); else if (EQ (next, Qand_optional)) - optional = 1; + optional = true; else { if (!optional) @@ -3043,7 +3044,6 @@ lambda_arity (Lisp_Object fun) return Fcons (make_number (minargs), make_number (maxargs)); } - DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode, 1, 1, 0, doc: /* If byte-compiled OBJECT is lazy-loaded, fetch it now. */) commit efb1883244f551cfb43fa9d85e3df8cc334fb232 Author: John Wiegley Date: Sat Mar 26 17:22:03 2016 -0700 Restore the fix to bug#18527 from commit d6868025 diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index b413ee5..46e6d89 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -648,7 +648,6 @@ EVENT is the message received from the closed connection process." (or erc-server-reconnecting (and erc-server-auto-reconnect (not erc-server-banned) - (not erc-server-error-occurred) ;; make sure we don't infinitely try to reconnect, unless the ;; user wants that (or (eq erc-server-reconnect-attempts t) commit cad9d76e12a32c5ca752ce0cfd521a6faa29067b Author: Martin Rudalics Date: Sat Mar 26 14:43:25 2016 +0100 Safely run window size change functions * src/window.c (run_window_size_change_functions): Use safe_call1 when running a size change function. (grow_mini_window, shrink_mini_window): Report error when minibuffer window cannot be resized. diff --git a/src/window.c b/src/window.c index 77a43b7..8c76c1f 100644 --- a/src/window.c +++ b/src/window.c @@ -3319,7 +3319,7 @@ run_window_size_change_functions (Lisp_Object frame) while (CONSP (functions)) { if (!EQ (XCAR (functions), Qt)) - call1 (XCAR (functions), frame); + safe_call1 (XCAR (functions), frame); functions = XCDR (functions); } @@ -4619,6 +4619,9 @@ grow_mini_window (struct window *w, int delta, bool pixelwise) adjust_frame_glyphs (f); unblock_input (); } + else + error ("Failed to grow minibuffer window"); + } } @@ -4662,6 +4665,8 @@ shrink_mini_window (struct window *w, bool pixelwise) one window frame here. The same routine will be needed when shrinking the frame (and probably when making the initial *scratch* window). For the moment leave things as they are. */ + else + error ("Failed to shrink minibuffer window"); } }