From 8fa0d9679d25c431bfe2da3d93997f5ed222ce35 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 1 Dec 2018 17:21:29 -0800 Subject: [PATCH 1/3] * lisp/emacs-lisp/subr-x.el (if-let, when-let): Doc fix: active voice. --- lisp/emacs-lisp/subr-x.el | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 7fab9083e85..2e24d5607bf 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -122,7 +122,7 @@ If ELT is of the form ((EXPR)), listify (EXPR) with a dummy symbol." bindings))) (defmacro if-let* (varlist then &rest else) - "Bind variables according to VARLIST and eval THEN or ELSE. + "Bind variables according to VARLIST and evaluate THEN or ELSE. This is like `if-let' but doesn't handle a VARLIST of the form \(SYMBOL SOMETHING) specially." (declare (indent 2) @@ -136,14 +136,14 @@ This is like `if-let' but doesn't handle a VARLIST of the form `(let* () ,then))) (defmacro when-let* (varlist &rest body) - "Bind variables according to VARLIST and conditionally eval BODY. + "Bind variables according to VARLIST and conditionally evaluate BODY. This is like `when-let' but doesn't handle a VARLIST of the form \(SYMBOL SOMETHING) specially." (declare (indent 1) (debug if-let*)) (list 'if-let* varlist (macroexp-progn body))) (defmacro and-let* (varlist &rest body) - "Bind variables according to VARLIST and conditionally eval BODY. + "Bind variables according to VARLIST and conditionally evaluate BODY. Like `when-let*', except if BODY is empty and all the bindings are non-nil, then the result is non-nil." (declare (indent 1) @@ -157,22 +157,20 @@ are non-nil, then the result is non-nil." `(let* () ,@(or body '(t)))))) (defmacro if-let (spec then &rest else) - "Bind variables according to SPEC and eval THEN or ELSE. -Each binding is evaluated in turn, and evaluation stops if a -binding value is nil. If all are non-nil, the value of THEN is -returned, or the last form in ELSE is returned. + "Bind variables according to SPEC and evaluate THEN or ELSE. +Evaluate each binding in turn, stopping if a binding value is nil. +If all are non-nil return the value of THEN, otherwise the last form in ELSE. -Each element of SPEC is a list (SYMBOL VALUEFORM) which binds +Each element of SPEC is a list (SYMBOL VALUEFORM) that binds SYMBOL to the value of VALUEFORM. An element can additionally be of the form (VALUEFORM), which is evaluated and checked for nil; i.e. SYMBOL can be omitted if only the test result is of interest. It can also be of the form SYMBOL, then the binding of SYMBOL is checked for nil. -As a special case, a SPEC of the form \(SYMBOL SOMETHING) is -interpreted like \((SYMBOL SOMETHING)). This exists for backward -compatibility with the old syntax that accepted only one -binding." +As a special case, interprets a SPEC of the form \(SYMBOL SOMETHING) +like \((SYMBOL SOMETHING)). This exists for backward compatibility +with an old syntax that accepted only one binding." (declare (indent 2) (debug ([&or (&rest [&or symbolp (symbolp form) (form)]) (symbolp form)] @@ -184,10 +182,9 @@ binding." (list 'if-let* spec then (macroexp-progn else))) (defmacro when-let (spec &rest body) - "Bind variables according to SPEC and conditionally eval BODY. -Each binding is evaluated in turn, and evaluation stops if a -binding value is nil. If all are non-nil, the value of the last -form in BODY is returned. + "Bind variables according to SPEC and conditionally evaluate BODY. +Evaluate each binding in turn, stopping if a binding value is nil. +If all are non-nil, return the value of the last form in BODY. The variable list SPEC is the same as in `if-let'." (declare (indent 1) (debug if-let)) From c418c85617babbe7b63730fefb71e2c87a0141af Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 2 Dec 2018 09:39:04 +0200 Subject: [PATCH 2/3] Revert "Fix infloop in GC mark_kboards" This reverts commit af914fc26db273d8788e7efa57c569f0f778d037, since it caused unintended adverse effects on echoing of keys. (Bug#33571) --- src/keyboard.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index dccc6b7f128..0d56ea3f7ac 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -12011,12 +12011,7 @@ mark_kboards (void) for (event = kbd_fetch_ptr; event != kbd_store_ptr; event++) { if (event == kbd_buffer + KBD_BUFFER_SIZE) - { - event = kbd_buffer; - if (event == kbd_store_ptr) - break; - } - + event = kbd_buffer; /* These two special event types has no Lisp_Objects to mark. */ if (event->kind != SELECTION_REQUEST_EVENT && event->kind != SELECTION_CLEAR_EVENT) From 745c9c02582443680167501b218cc59f1a2d3fb6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 2 Dec 2018 20:04:05 +0200 Subject: [PATCH 3/3] Revert "Revert "Fix infloop in GC mark_kboards"" This reverts commit c418c85617babbe7b63730fefb71e2c87a0141af. This reinstates the original fix, as it had nothing to do with the behavior reported in bug#33571, which seems to be the expected behavior. --- src/keyboard.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/keyboard.c b/src/keyboard.c index 0d56ea3f7ac..dccc6b7f128 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -12011,7 +12011,12 @@ mark_kboards (void) for (event = kbd_fetch_ptr; event != kbd_store_ptr; event++) { if (event == kbd_buffer + KBD_BUFFER_SIZE) - event = kbd_buffer; + { + event = kbd_buffer; + if (event == kbd_store_ptr) + break; + } + /* These two special event types has no Lisp_Objects to mark. */ if (event->kind != SELECTION_REQUEST_EVENT && event->kind != SELECTION_CLEAR_EVENT)