From 52e011899b22dec7f650d34a1145cf06f4e403bd Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 9 Aug 1995 22:39:09 +0000 Subject: [PATCH] (get_truename_buffer): New function. --- src/buffer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/buffer.c b/src/buffer.c index f0bd7013e50..db1e3110dd0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -236,6 +236,24 @@ See also `find-buffer-visiting'.") return Qnil; } +Lisp_Object +get_truename_buffer (filename) + register Lisp_Object filename; +{ + register Lisp_Object tail, buf, tem; + + for (tail = Vbuffer_alist; CONSP (tail); tail = XCONS (tail)->cdr) + { + buf = Fcdr (XCONS (tail)->car); + if (!BUFFERP (buf)) continue; + if (!STRINGP (XBUFFER (buf)->file_truename)) continue; + tem = Fstring_equal (XBUFFER (buf)->file_truename, filename); + if (!NILP (tem)) + return buf; + } + return Qnil; +} + /* Incremented for each buffer created, to assign the buffer number. */ int buffer_count; -- 2.39.2