From 50dca5dfd6adef80fb90a49736cdfcbd4c00d764 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 22 Nov 2013 18:58:28 -0800 Subject: [PATCH] * src/process.c (get_process): Explicit error for dead buffers That seems more in keeping with the existing behavior of this function in other situations. --- src/ChangeLog | 4 ++++ src/process.c | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c6f63adebcd..bc3d3ba6f25 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2013-11-23 Glenn Morris + + * process.c (get_process): Explicit error for dead buffers. + 2013-11-23 Andreas Schwab * process.c (get_process): Check that OBJ is a live buffer. (Bug#15923) diff --git a/src/process.c b/src/process.c index 7d4fb4e3ec4..7050bf9822e 100644 --- a/src/process.c +++ b/src/process.c @@ -1,7 +1,7 @@ /* Asynchronous subprocess control for GNU Emacs. -Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2013 Free Software -Foundation, Inc. +Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2013 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -812,12 +812,14 @@ get_process (register Lisp_Object name) else obj = name; - /* Now obj should be either a (live) buffer object or a process object. */ - if (BUFFERP (obj) && !NILP (BVAR (XBUFFER (obj), name))) + /* Now obj should be either a buffer object or a process object. */ + if (BUFFERP (obj)) { + if (NILP (BVAR (XBUFFER (obj), name))) + error ("Attempt to get process for a dead buffer"); proc = Fget_buffer_process (obj); if (NILP (proc)) - error ("Buffer %s has no process", SDATA (BVAR (XBUFFER (obj), name))); + error ("Buffer %s has no process", SDATA (BVAR (XBUFFER (obj), name))); } else { -- 2.39.2