changeset 5433:7ac1e6f1565f

Don't include syntax.h. (Qget_file_buffer): New variable. (syms_of_buffer): Set up Qget_file_buffer. (Fget_file_buffer): For magic file names, run the handler.
author Richard M. Stallman <rms@gnu.org>
date Tue, 04 Jan 1994 06:38:43 +0000
parents c3677267e74d
children c89fd1fbf068
files src/buffer.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c	Tue Jan 04 06:37:51 1994 +0000
+++ b/src/buffer.c	Tue Jan 04 06:38:43 1994 +0000
@@ -34,7 +34,6 @@
 #include "window.h"
 #include "commands.h"
 #include "buffer.h"
-#include "syntax.h"
 #include "indent.h"
 #include "blockinput.h"
 
@@ -130,6 +129,8 @@
 
 Lisp_Object Qkill_buffer_hook;
 
+Lisp_Object Qget_file_buffer;
+
 Lisp_Object Qoverlayp;
 
 Lisp_Object Qmodification_hooks;
@@ -175,9 +176,17 @@
      register Lisp_Object filename;
 {
   register Lisp_Object tail, buf, tem;
+  Lisp_Object handler;
+
   CHECK_STRING (filename, 0);
   filename = Fexpand_file_name (filename, Qnil);
 
+  /* If the file name has special constructs in it,
+     call the corresponding file handler.  */
+  handler = Ffind_file_name_handler (filename);
+  if (!NILP (handler))
+    return call2 (handler, Qget_file_buffer, filename);
+
   for (tail = Vbuffer_alist; CONSP (tail); tail = XCONS (tail)->cdr)
     {
       buf = Fcdr (XCONS (tail)->car);
@@ -2175,6 +2184,8 @@
   Qinsert_in_front_hooks = intern ("insert-in-front-hooks");
   staticpro (&Qinsert_behind_hooks);
   Qinsert_behind_hooks = intern ("insert-behind-hooks");
+  staticpro (&Qget_file_buffer);
+  Qget_file_buffer = intern ("get-file-buffer");
 
   Qoverlayp = intern ("overlayp");