summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-01-04 06:38:43 +0000
committerRichard M. Stallman <rms@gnu.org>1994-01-04 06:38:43 +0000
commit5fe0b67ed455a1f314e5cfbc99ed4cdec02b613e (patch)
tree2292de6fb83f8d586377e9cc312ad2534fa57e4e /src/buffer.c
parenta889bd0eff7f4d048b89dfdf5a3b0ae7248d83b3 (diff)
downloademacs-5fe0b67ed455a1f314e5cfbc99ed4cdec02b613e.tar.gz
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.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 5db9521916d..3d263a2d754 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -34,7 +34,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "window.h"
#include "commands.h"
#include "buffer.h"
-#include "syntax.h"
#include "indent.h"
#include "blockinput.h"
@@ -130,6 +129,8 @@ Lisp_Object QSFundamental; /* A string "Fundamental" */
Lisp_Object Qkill_buffer_hook;
+Lisp_Object Qget_file_buffer;
+
Lisp_Object Qoverlayp;
Lisp_Object Qmodification_hooks;
@@ -175,9 +176,17 @@ If there is no such live buffer, return nil.")
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 @@ syms_of_buffer ()
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");