comparison src/buffer.c @ 5502:2b48fd9bc80e

[MSDOS]: New buffer-local variable: buffer-file-type to handle DOS newlines.
author Richard M. Stallman <rms@gnu.org>
date Sat, 08 Jan 1994 09:21:59 +0000
parents 7ac1e6f1565f
children 2c5f3537a1cc
comparison
equal deleted inserted replaced
5501:902cd7024cfa 5502:2b48fd9bc80e
137 Lisp_Object Qinsert_in_front_hooks; 137 Lisp_Object Qinsert_in_front_hooks;
138 Lisp_Object Qinsert_behind_hooks; 138 Lisp_Object Qinsert_behind_hooks;
139 139
140 /* For debugging; temporary. See set_buffer_internal. */ 140 /* For debugging; temporary. See set_buffer_internal. */
141 /* Lisp_Object Qlisp_mode, Vcheck_symbol; */ 141 /* Lisp_Object Qlisp_mode, Vcheck_symbol; */
142
143 #ifdef MSDOS
144 Lisp_Object Qbuffer_file_type;
145 #endif
142 146
143 nsberror (spec) 147 nsberror (spec)
144 Lisp_Object spec; 148 Lisp_Object spec;
145 { 149 {
146 if (XTYPE (spec) == Lisp_String) 150 if (XTYPE (spec) == Lisp_String)
2062 2066
2063 XFASTINT (buffer_defaults.tab_width) = 8; 2067 XFASTINT (buffer_defaults.tab_width) = 8;
2064 buffer_defaults.truncate_lines = Qnil; 2068 buffer_defaults.truncate_lines = Qnil;
2065 buffer_defaults.ctl_arrow = Qt; 2069 buffer_defaults.ctl_arrow = Qt;
2066 2070
2071 #ifdef MSDOS
2072 buffer_defaults.buffer_file_type = 0; /* TEXT */
2073 #endif
2067 XFASTINT (buffer_defaults.fill_column) = 70; 2074 XFASTINT (buffer_defaults.fill_column) = 70;
2068 XFASTINT (buffer_defaults.left_margin) = 0; 2075 XFASTINT (buffer_defaults.left_margin) = 0;
2069 2076
2070 /* Assign the local-flags to the slots that have default values. 2077 /* Assign the local-flags to the slots that have default values.
2071 The local flag is a bit that is used in the buffer 2078 The local flag is a bit that is used in the buffer
2103 XFASTINT (buffer_local_flags.fill_column) = 0x400; 2110 XFASTINT (buffer_local_flags.fill_column) = 0x400;
2104 XFASTINT (buffer_local_flags.left_margin) = 0x800; 2111 XFASTINT (buffer_local_flags.left_margin) = 0x800;
2105 XFASTINT (buffer_local_flags.abbrev_table) = 0x1000; 2112 XFASTINT (buffer_local_flags.abbrev_table) = 0x1000;
2106 XFASTINT (buffer_local_flags.display_table) = 0x2000; 2113 XFASTINT (buffer_local_flags.display_table) = 0x2000;
2107 XFASTINT (buffer_local_flags.syntax_table) = 0x8000; 2114 XFASTINT (buffer_local_flags.syntax_table) = 0x8000;
2115 #ifdef MSDOS
2116 XFASTINT (buffer_local_flags.buffer_file_type) = 0x4000;
2117 #endif
2108 2118
2109 Vbuffer_alist = Qnil; 2119 Vbuffer_alist = Qnil;
2110 current_buffer = 0; 2120 current_buffer = 0;
2111 all_buffers = 0; 2121 all_buffers = 0;
2112 2122
2236 2246
2237 DEFVAR_LISP_NOPRO ("default-case-fold-search", 2247 DEFVAR_LISP_NOPRO ("default-case-fold-search",
2238 &buffer_defaults.case_fold_search, 2248 &buffer_defaults.case_fold_search,
2239 "Default value of `case-fold-search' for buffers that don't override it.\n\ 2249 "Default value of `case-fold-search' for buffers that don't override it.\n\
2240 This is the same as (default-value 'case-fold-search)."); 2250 This is the same as (default-value 'case-fold-search).");
2251
2252 #ifdef MSDOS
2253 DEFVAR_LISP_NOPRO ("default-buffer-file-type",
2254 &buffer_defaults.buffer_file_type,
2255 "Default file type for buffers that do not override it.\n\
2256 This is the same as (default-value 'buffer-file-type).\n\
2257 The file type is nil for text, t for binary.");
2258 #endif
2241 2259
2242 DEFVAR_PER_BUFFER ("mode-line-format", &current_buffer->mode_line_format, 2260 DEFVAR_PER_BUFFER ("mode-line-format", &current_buffer->mode_line_format,
2243 Qnil, 0); 2261 Qnil, 0);
2244 2262
2245 /* This doc string is too long for cpp; cpp dies if it isn't in a comment. 2263 /* This doc string is too long for cpp; cpp dies if it isn't in a comment.
2266 %b -- print buffer name. %f -- print visited file name.\n\ 2284 %b -- print buffer name. %f -- print visited file name.\n\
2267 %* -- print *, % or hyphen. %m -- print value of mode-name (obsolete).\n\ 2285 %* -- print *, % or hyphen. %m -- print value of mode-name (obsolete).\n\
2268 %s -- print process status. %l -- print the current line number.\n\ 2286 %s -- print process status. %l -- print the current line number.\n\
2269 %p -- print percent of buffer above top of window, or top, bot or all.\n\ 2287 %p -- print percent of buffer above top of window, or top, bot or all.\n\
2270 %n -- print Narrow if appropriate.\n\ 2288 %n -- print Narrow if appropriate.\n\
2289 %t -- print T if files is text, B if binary.\n\
2271 %[ -- print one [ for each recursive editing level. %] similar.\n\ 2290 %[ -- print one [ for each recursive editing level. %] similar.\n\
2272 %% -- print %. %- -- print infinitely many dashes.\n\ 2291 %% -- print %. %- -- print infinitely many dashes.\n\
2273 Decimal digits after the % specify field width to which to pad."); 2292 Decimal digits after the % specify field width to which to pad.");
2274 */ 2293 */
2275 2294
2323 Automatically becomes buffer-local when set in any fashion.\n\ 2342 Automatically becomes buffer-local when set in any fashion.\n\
2324 \n\ 2343 \n\
2325 Note that this is overridden by the variable\n\ 2344 Note that this is overridden by the variable\n\
2326 `truncate-partial-width-windows' if that variable is non-nil\n\ 2345 `truncate-partial-width-windows' if that variable is non-nil\n\
2327 and this buffer is not full-frame width."); 2346 and this buffer is not full-frame width.");
2347
2348 #ifdef MSDOS
2349 DEFVAR_PER_BUFFER ("buffer-file-type", &current_buffer->buffer_file_type,
2350 Qnil,
2351 "*If visited file is text, nil; otherwise, t.");
2352 #endif
2328 2353
2329 DEFVAR_PER_BUFFER ("default-directory", &current_buffer->directory, 2354 DEFVAR_PER_BUFFER ("default-directory", &current_buffer->directory,
2330 make_number (Lisp_String), 2355 make_number (Lisp_String),
2331 "Name of default directory of current buffer. Should end with slash.\n\ 2356 "Name of default directory of current buffer. Should end with slash.\n\
2332 Each buffer has its own value of this variable."); 2357 Each buffer has its own value of this variable.");