From: Richard M. Stallman Date: Wed, 9 Aug 1995 22:39:09 +0000 (+0000) Subject: (get_truename_buffer): New function. X-Git-Tag: emacs-19.34~3050 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=52e011899b22dec7f650d34a1145cf06f4e403bd;p=emacs.git (get_truename_buffer): New function. --- 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;