Commit 05c65251 authored by Eli Zaretskii's avatar Eli Zaretskii

Use KVAR in MS-Windows build, remove buffer-file-type.

 w32fns.c (Fx_create_frame): Use KVAR.
 w32term.c (w32_create_terminal): Use KVAR.
 s/ms-w32.h (MODE_LINE_BINARY_TEXT): Remove.
 xdisp.c (decode_mode_spec): Don't use MODE_LINE_BINARY_TEXT.
 fileio.c (Finsert_file_contents, Fwrite_region): Remove
 references to buffer_file_type.
 (syms_of_fileio): Don't intern and staticpro
 find-buffer-file-type.
 callproc.c (syms_of_callproc): Remove references to
 buffer_file_type.
 buffer.c (reset_buffer_local_variables): Don't set
 buffer_file_type.
 (init_buffer_once): Likewise.
 (syms_of_buffer): Don't define buffer-file-type.
 buffer.h (struct buffer): Remove buffer_file_type.
parent 689743a2
2011-02-16 Eli Zaretskii <eliz@gnu.org>
* w32fns.c (Fx_create_frame): Use KVAR.
* w32term.c (w32_create_terminal): Use KVAR.
* s/ms-w32.h (MODE_LINE_BINARY_TEXT): Remove.
* xdisp.c (decode_mode_spec): Don't use MODE_LINE_BINARY_TEXT.
* fileio.c (Finsert_file_contents, Fwrite_region): Remove
references to buffer_file_type.
(syms_of_fileio): Don't intern and staticpro
find-buffer-file-type.
* callproc.c (syms_of_callproc): Remove references to
buffer_file_type.
* buffer.c (reset_buffer_local_variables): Don't set
buffer_file_type.
(init_buffer_once): Likewise.
(syms_of_buffer): Don't define buffer-file-type.
* buffer.h (struct buffer): Remove buffer_file_type.
2011-02-16 Tom Tromey <tromey@parfait>
* callint.c (Fcall_interactively): Update.
......@@ -715,9 +715,6 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
BVAR (b, case_canon_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[1];
BVAR (b, case_eqv_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[2];
BVAR (b, invisibility_spec) = Qt;
#ifndef DOS_NT
BVAR (b, buffer_file_type) = Qnil;
#endif
/* Reset all (or most) per-buffer variables to their defaults. */
if (permanent_too)
......@@ -5040,9 +5037,6 @@ init_buffer_once (void)
BVAR (&buffer_defaults, extra_line_spacing) = Qnil;
BVAR (&buffer_defaults, cursor_in_non_selected_windows) = Qt;
#ifdef DOS_NT
BVAR (&buffer_defaults, buffer_file_type) = Qnil; /* TEXT */
#endif
BVAR (&buffer_defaults, enable_multibyte_characters) = Qt;
BVAR (&buffer_defaults, buffer_file_coding_system) = Qnil;
XSETFASTINT (BVAR (&buffer_defaults, fill_column), 70);
......@@ -5112,11 +5106,6 @@ init_buffer_once (void)
XSETFASTINT (BVAR (&buffer_local_flags, left_margin), idx); ++idx;
XSETFASTINT (BVAR (&buffer_local_flags, abbrev_table), idx); ++idx;
XSETFASTINT (BVAR (&buffer_local_flags, display_table), idx); ++idx;
#ifdef DOS_NT
XSETFASTINT (BVAR (&buffer_local_flags, buffer_file_type), idx);
/* Make this one a permanent local. */
buffer_permanent_local_flags[idx++] = 1;
#endif
XSETFASTINT (BVAR (&buffer_local_flags, syntax_table), idx); ++idx;
XSETFASTINT (BVAR (&buffer_local_flags, cache_long_line_scans), idx); ++idx;
XSETFASTINT (BVAR (&buffer_local_flags, category_table), idx); ++idx;
......@@ -5415,14 +5404,6 @@ This is the same as (default-value 'tab-width). */);
doc: /* Default value of `case-fold-search' for buffers that don't override it.
This is the same as (default-value 'case-fold-search). */);
#ifdef DOS_NT
DEFVAR_BUFFER_DEFAULTS ("default-buffer-file-type",
buffer_file_type,
doc: /* Default file type for buffers that do not override it.
This is the same as (default-value 'buffer-file-type).
The file type is nil for text, t for binary. */);
#endif
DEFVAR_BUFFER_DEFAULTS ("default-left-margin-width",
left_margin_cols,
doc: /* Default value of `left-margin-width' for buffers that don't override it.
......@@ -5673,15 +5654,6 @@ word-wrapping, you might want to reduce the value of
`truncate-partial-width-windows', since wrapping can make text readable
in narrower windows. */);
#ifdef DOS_NT
DEFVAR_PER_BUFFER ("buffer-file-type", &BVAR (current_buffer, buffer_file_type),
Qnil,
doc: /* Non-nil if the visited file is a binary file.
This variable is meaningful on MS-DOG and Windows NT.
On those systems, it is automatically local in every buffer.
On other systems, this variable is normally always nil. */);
#endif
DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory),
make_number (Lisp_String),
doc: /* Name of default directory of current buffer. Should end with slash.
......
......@@ -662,12 +662,6 @@ struct buffer
Lisp_Object BUFFER_INTERNAL_FIELD (left_margin);
/* Function to call when insert space past fill column. */
Lisp_Object BUFFER_INTERNAL_FIELD (auto_fill_function);
/* nil: text, t: binary.
This value is meaningful only on certain operating systems. */
/* Actually, we don't need this flag any more because end-of-line
is handled correctly according to the buffer-file-coding-system
of the buffer. Just keeping it for backward compatibility. */
Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_type);
/* Case table for case-conversion in this buffer.
This char-table maps each char into its lower-case version. */
......
......@@ -74,10 +74,6 @@ extern char **environ;
/* Pattern used by call-process-region to make temp files. */
static Lisp_Object Vtemp_file_name_pattern;
#ifdef DOS_NT
Lisp_Object Qbuffer_file_type;
#endif /* DOS_NT */
/* True if we are about to fork off a synchronous process or if we
are waiting for it. */
int synch_process_alive;
......@@ -1535,11 +1531,6 @@ set_initial_environment (void)
void
syms_of_callproc (void)
{
#ifdef DOS_NT
Qbuffer_file_type = intern_c_string ("buffer-file-type");
staticpro (&Qbuffer_file_type);
#endif /* DOS_NT */
#ifndef DOS_NT
Vtemp_file_name_pattern = build_string ("emacsXXXXXX");
#elif defined (WINDOWSNT)
......
......@@ -3075,10 +3075,6 @@ otherwise, if FILE2 does not exist, the answer is t. */)
return (mtime1 > st.st_mtime) ? Qt : Qnil;
}
#ifdef DOS_NT
Lisp_Object Qfind_buffer_file_type;
#endif /* DOS_NT */
#ifndef READ_BUF_SIZE
#define READ_BUF_SIZE (64 << 10)
#endif
......@@ -4103,18 +4099,6 @@ variable `last-coding-system-used' to the coding system actually used. */)
/* Now INSERTED is measured in characters. */
#ifdef DOS_NT
/* Use the conversion type to determine buffer-file-type
(find-buffer-file-type is now used to help determine the
conversion). */
if ((VECTORP (CODING_ID_EOL_TYPE (coding.id))
|| EQ (CODING_ID_EOL_TYPE (coding.id), Qunix))
&& ! CODING_REQUIRE_DECODING (&coding))
BVAR (current_buffer, buffer_file_type) = Qt;
else
BVAR (current_buffer, buffer_file_type) = Qnil;
#endif
handled:
if (deferred_remove_unwind_protect)
......@@ -4484,9 +4468,6 @@ This calls `write-region-annotate-functions' at the start, and
int quietly = !NILP (visit);
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
struct buffer *given_buffer;
#ifdef DOS_NT
int buffer_file_type = O_BINARY;
#endif /* DOS_NT */
struct coding_system coding;
if (current_buffer->base_buffer && visiting)
......@@ -4596,7 +4577,7 @@ This calls `write-region-annotate-functions' at the start, and
desc = -1;
if (!NILP (append))
#ifdef DOS_NT
desc = emacs_open (fn, O_WRONLY | buffer_file_type, 0);
desc = emacs_open (fn, O_WRONLY | O_BINARY, 0);
#else /* not DOS_NT */
desc = emacs_open (fn, O_WRONLY, 0);
#endif /* not DOS_NT */
......@@ -4604,7 +4585,7 @@ This calls `write-region-annotate-functions' at the start, and
if (desc < 0 && (NILP (append) || errno == ENOENT))
#ifdef DOS_NT
desc = emacs_open (fn,
O_WRONLY | O_CREAT | buffer_file_type
O_WRONLY | O_CREAT | O_BINARY
| (EQ (mustbenew, Qexcl) ? O_EXCL : O_TRUNC),
S_IREAD | S_IWRITE);
#else /* not DOS_NT */
......@@ -5586,11 +5567,6 @@ syms_of_fileio (void)
Qexcl = intern_c_string ("excl");
staticpro (&Qexcl);
#ifdef DOS_NT
Qfind_buffer_file_type = intern_c_string ("find-buffer-file-type");
staticpro (&Qfind_buffer_file_type);
#endif /* DOS_NT */
DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system,
doc: /* *Coding system for encoding file names.
If it is nil, `default-file-name-coding-system' (which see) is used. */);
......
......@@ -181,8 +181,6 @@ struct sigaction {
#define HAVE_MENUS 1
#endif
#define MODE_LINE_BINARY_TEXT(_b_) (NILP (B_(_b_,buffer_file_type)) ? "T" : "B")
/* Get some redefinitions in place. */
#ifdef emacs
......
......@@ -4348,9 +4348,9 @@ This function is an internal primitive--use `make-frame' instead. */)
/* Initialize `default-minibuffer-frame' in case this is the first
frame on this terminal. */
if (FRAME_HAS_MINIBUF_P (f)
&& (!FRAMEP (kb->Vdefault_minibuffer_frame)
|| !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))))
kb->Vdefault_minibuffer_frame = frame;
&& (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
|| !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
KVAR (kb, Vdefault_minibuffer_frame) = frame;
/* All remaining specified parameters, which have not been "used"
by x_get_arg and friends, now go in the misc. alist of the frame. */
......
......@@ -6082,7 +6082,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
terminal like X does. */
terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
init_kboard (terminal->kboard);
terminal->kboard->Vwindow_system = intern ("w32");
KVAR (terminal->kboard, Vwindow_system) = intern ("w32");
terminal->kboard->next_kboard = all_kboards;
all_kboards = terminal->kboard;
/* Don't let the initial kboard remain current longer than necessary.
......
......@@ -19585,11 +19585,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
}
case 't': /* indicate TEXT or BINARY */
#ifdef MODE_LINE_BINARY_TEXT
return MODE_LINE_BINARY_TEXT (b);
#else
return "T";
#endif
case 'z':
/* coding-system (not including end-of-line format) */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment