diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-02-11 03:51:39 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-02-11 03:51:39 +0000 |
commit | 5b8de9c5e6ae9df7de19ad97143553eeb8a2573a (patch) | |
tree | c5b1a91c2311c1be51852719793a5c30bdf08bde /src/terminal.c | |
parent | d725f53da2a3956ea64a9b2bb4e94180c2015b63 (diff) | |
download | emacs-5b8de9c5e6ae9df7de19ad97143553eeb8a2573a.tar.gz |
(Fdelete_terminal): Clean up the `force' path.
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/terminal.c b/src/terminal.c index 2e0bcbb45a6..bbc2fd74c2e 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -305,19 +305,20 @@ but if the second argument FORCE is non-nil, you may do so. */) (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); |