Mercurial > emacs
comparison src/buffer.c @ 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 | 0cf95629f6c4 |
children | 2b48fd9bc80e |
comparison
equal
deleted
inserted
replaced
5432:c3677267e74d | 5433:7ac1e6f1565f |
---|---|
32 #include "lisp.h" | 32 #include "lisp.h" |
33 #include "intervals.h" | 33 #include "intervals.h" |
34 #include "window.h" | 34 #include "window.h" |
35 #include "commands.h" | 35 #include "commands.h" |
36 #include "buffer.h" | 36 #include "buffer.h" |
37 #include "syntax.h" | |
38 #include "indent.h" | 37 #include "indent.h" |
39 #include "blockinput.h" | 38 #include "blockinput.h" |
40 | 39 |
41 struct buffer *current_buffer; /* the current buffer */ | 40 struct buffer *current_buffer; /* the current buffer */ |
42 | 41 |
128 | 127 |
129 Lisp_Object QSFundamental; /* A string "Fundamental" */ | 128 Lisp_Object QSFundamental; /* A string "Fundamental" */ |
130 | 129 |
131 Lisp_Object Qkill_buffer_hook; | 130 Lisp_Object Qkill_buffer_hook; |
132 | 131 |
132 Lisp_Object Qget_file_buffer; | |
133 | |
133 Lisp_Object Qoverlayp; | 134 Lisp_Object Qoverlayp; |
134 | 135 |
135 Lisp_Object Qmodification_hooks; | 136 Lisp_Object Qmodification_hooks; |
136 Lisp_Object Qinsert_in_front_hooks; | 137 Lisp_Object Qinsert_in_front_hooks; |
137 Lisp_Object Qinsert_behind_hooks; | 138 Lisp_Object Qinsert_behind_hooks; |
173 If there is no such live buffer, return nil.") | 174 If there is no such live buffer, return nil.") |
174 (filename) | 175 (filename) |
175 register Lisp_Object filename; | 176 register Lisp_Object filename; |
176 { | 177 { |
177 register Lisp_Object tail, buf, tem; | 178 register Lisp_Object tail, buf, tem; |
179 Lisp_Object handler; | |
180 | |
178 CHECK_STRING (filename, 0); | 181 CHECK_STRING (filename, 0); |
179 filename = Fexpand_file_name (filename, Qnil); | 182 filename = Fexpand_file_name (filename, Qnil); |
183 | |
184 /* If the file name has special constructs in it, | |
185 call the corresponding file handler. */ | |
186 handler = Ffind_file_name_handler (filename); | |
187 if (!NILP (handler)) | |
188 return call2 (handler, Qget_file_buffer, filename); | |
180 | 189 |
181 for (tail = Vbuffer_alist; CONSP (tail); tail = XCONS (tail)->cdr) | 190 for (tail = Vbuffer_alist; CONSP (tail); tail = XCONS (tail)->cdr) |
182 { | 191 { |
183 buf = Fcdr (XCONS (tail)->car); | 192 buf = Fcdr (XCONS (tail)->car); |
184 if (XTYPE (buf) != Lisp_Buffer) continue; | 193 if (XTYPE (buf) != Lisp_Buffer) continue; |
2173 Qmodification_hooks = intern ("modification-hooks"); | 2182 Qmodification_hooks = intern ("modification-hooks"); |
2174 staticpro (&Qinsert_in_front_hooks); | 2183 staticpro (&Qinsert_in_front_hooks); |
2175 Qinsert_in_front_hooks = intern ("insert-in-front-hooks"); | 2184 Qinsert_in_front_hooks = intern ("insert-in-front-hooks"); |
2176 staticpro (&Qinsert_behind_hooks); | 2185 staticpro (&Qinsert_behind_hooks); |
2177 Qinsert_behind_hooks = intern ("insert-behind-hooks"); | 2186 Qinsert_behind_hooks = intern ("insert-behind-hooks"); |
2187 staticpro (&Qget_file_buffer); | |
2188 Qget_file_buffer = intern ("get-file-buffer"); | |
2178 | 2189 |
2179 Qoverlayp = intern ("overlayp"); | 2190 Qoverlayp = intern ("overlayp"); |
2180 | 2191 |
2181 Fput (Qprotected_field, Qerror_conditions, | 2192 Fput (Qprotected_field, Qerror_conditions, |
2182 Fcons (Qprotected_field, Fcons (Qerror, Qnil))); | 2193 Fcons (Qprotected_field, Fcons (Qerror, Qnil))); |