Mercurial > emacs
comparison src/terminal.c @ 91749:e1f7f307ce9e
(Fdelete_terminal): Clean up the `force' path.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 11 Feb 2008 03:51:39 +0000 |
parents | c33ec1f680a9 |
children | ed10c3092847 |
comparison
equal
deleted
inserted
replaced
91748:1402dc2e8440 | 91749:e1f7f307ce9e |
---|---|
303 Normally, you may not delete a display if all other displays are suspended, | 303 Normally, you may not delete a display if all other displays are suspended, |
304 but if the second argument FORCE is non-nil, you may do so. */) | 304 but if the second argument FORCE is non-nil, you may do so. */) |
305 (terminal, force) | 305 (terminal, force) |
306 Lisp_Object terminal, force; | 306 Lisp_Object terminal, force; |
307 { | 307 { |
308 struct terminal *t, *p; | 308 struct terminal *t = get_terminal (terminal, 0); |
309 | |
310 t = get_terminal (terminal, 0); | |
311 | 309 |
312 if (!t) | 310 if (!t) |
313 return Qnil; | 311 return Qnil; |
314 | 312 |
315 p = terminal_list; | 313 if (NILP (force)) |
316 while (p && (p == t || !TERMINAL_ACTIVE_P (p))) | 314 { |
317 p = p->next_terminal; | 315 struct terminal *p = terminal_list; |
318 | 316 while (p && (p == t || !TERMINAL_ACTIVE_P (p))) |
319 if (NILP (force) && !p) | 317 p = p->next_terminal; |
320 error ("Attempt to delete the sole active display terminal"); | 318 |
319 if (!p) | |
320 error ("Attempt to delete the sole active display terminal"); | |
321 } | |
321 | 322 |
322 if (t->delete_terminal_hook) | 323 if (t->delete_terminal_hook) |
323 (*t->delete_terminal_hook) (t); | 324 (*t->delete_terminal_hook) (t); |
324 else | 325 else |
325 delete_terminal (t); | 326 delete_terminal (t); |