# HG changeset patch # User Stefan Monnier # Date 1202701899 0 # Node ID e1f7f307ce9e7f0f15a4bfc728d08e7559957cf9 # Parent 1402dc2e8440addd2b789fc46e63d2b4975ab68e (Fdelete_terminal): Clean up the `force' path. diff -r 1402dc2e8440 -r e1f7f307ce9e src/ChangeLog --- a/src/ChangeLog Mon Feb 11 03:29:34 2008 +0000 +++ b/src/ChangeLog Mon Feb 11 03:51:39 2008 +0000 @@ -1,3 +1,7 @@ +2008-02-11 Stefan Monnier + + * terminal.c (Fdelete_terminal): Clean up the `force' path. + 2008-02-10 Stefan Monnier * frame.c (Qnoelisp): New symbol. diff -r 1402dc2e8440 -r e1f7f307ce9e src/terminal.c --- a/src/terminal.c Mon Feb 11 03:29:34 2008 +0000 +++ b/src/terminal.c Mon Feb 11 03:51:39 2008 +0000 @@ -305,19 +305,20 @@ (terminal, force) Lisp_Object terminal, force; { - struct terminal *t, *p; - - t = get_terminal (terminal, 0); + struct terminal *t = get_terminal (terminal, 0); if (!t) return Qnil; - p = terminal_list; - while (p && (p == t || !TERMINAL_ACTIVE_P (p))) - p = p->next_terminal; - - if (NILP (force) && !p) - error ("Attempt to delete the sole active display terminal"); + if (NILP (force)) + { + struct terminal *p = terminal_list; + while (p && (p == t || !TERMINAL_ACTIVE_P (p))) + p = p->next_terminal; + + if (!p) + error ("Attempt to delete the sole active display terminal"); + } if (t->delete_terminal_hook) (*t->delete_terminal_hook) (t);