changeset 12810:bd486675e103

(get_truename_buffer): New function.
author Richard M. Stallman <rms@gnu.org>
date Wed, 09 Aug 1995 22:39:09 +0000
parents c388f6f7f210
children 11f5ce737c57
files src/buffer.c
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c	Wed Aug 09 16:08:55 1995 +0000
+++ b/src/buffer.c	Wed Aug 09 22:39:09 1995 +0000
@@ -236,6 +236,24 @@
   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;