aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2011-02-16 20:39:46 +0200
committerEli Zaretskii2011-02-16 20:39:46 +0200
commit05c652517317d10690aaf0a6aa0bc876382b9d82 (patch)
tree14bdd1f74a7148e9a95b034b14fcacf5064eb4f9 /src
parent689743a20ba5883750ab24192ec955941f2b9752 (diff)
downloademacs-05c652517317d10690aaf0a6aa0bc876382b9d82.tar.gz
emacs-05c652517317d10690aaf0a6aa0bc876382b9d82.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog25
-rw-r--r--src/buffer.c28
-rw-r--r--src/buffer.h6
-rw-r--r--src/callproc.c9
-rw-r--r--src/fileio.c28
-rw-r--r--src/s/ms-w32.h2
-rw-r--r--src/w32fns.c6
-rw-r--r--src/w32term.c2
-rw-r--r--src/xdisp.c4
9 files changed, 31 insertions, 79 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 13b19453562..20a85d87113 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,28 @@
12011-02-16 Eli Zaretskii <eliz@gnu.org>
2
3 * w32fns.c (Fx_create_frame): Use KVAR.
4
5 * w32term.c (w32_create_terminal): Use KVAR.
6
7 * s/ms-w32.h (MODE_LINE_BINARY_TEXT): Remove.
8
9 * xdisp.c (decode_mode_spec): Don't use MODE_LINE_BINARY_TEXT.
10
11 * fileio.c (Finsert_file_contents, Fwrite_region): Remove
12 references to buffer_file_type.
13 (syms_of_fileio): Don't intern and staticpro
14 find-buffer-file-type.
15
16 * callproc.c (syms_of_callproc): Remove references to
17 buffer_file_type.
18
19 * buffer.c (reset_buffer_local_variables): Don't set
20 buffer_file_type.
21 (init_buffer_once): Likewise.
22 (syms_of_buffer): Don't define buffer-file-type.
23
24 * buffer.h (struct buffer): Remove buffer_file_type.
25
12011-02-16 Tom Tromey <tromey@parfait> 262011-02-16 Tom Tromey <tromey@parfait>
2 27
3 * callint.c (Fcall_interactively): Update. 28 * callint.c (Fcall_interactively): Update.
diff --git a/src/buffer.c b/src/buffer.c
index d05fe1754c2..c95fbb5f516 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -715,9 +715,6 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
715 BVAR (b, case_canon_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[1]; 715 BVAR (b, case_canon_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[1];
716 BVAR (b, case_eqv_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[2]; 716 BVAR (b, case_eqv_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[2];
717 BVAR (b, invisibility_spec) = Qt; 717 BVAR (b, invisibility_spec) = Qt;
718#ifndef DOS_NT
719 BVAR (b, buffer_file_type) = Qnil;
720#endif
721 718
722 /* Reset all (or most) per-buffer variables to their defaults. */ 719 /* Reset all (or most) per-buffer variables to their defaults. */
723 if (permanent_too) 720 if (permanent_too)
@@ -5040,9 +5037,6 @@ init_buffer_once (void)
5040 BVAR (&buffer_defaults, extra_line_spacing) = Qnil; 5037 BVAR (&buffer_defaults, extra_line_spacing) = Qnil;
5041 BVAR (&buffer_defaults, cursor_in_non_selected_windows) = Qt; 5038 BVAR (&buffer_defaults, cursor_in_non_selected_windows) = Qt;
5042 5039
5043#ifdef DOS_NT
5044 BVAR (&buffer_defaults, buffer_file_type) = Qnil; /* TEXT */
5045#endif
5046 BVAR (&buffer_defaults, enable_multibyte_characters) = Qt; 5040 BVAR (&buffer_defaults, enable_multibyte_characters) = Qt;
5047 BVAR (&buffer_defaults, buffer_file_coding_system) = Qnil; 5041 BVAR (&buffer_defaults, buffer_file_coding_system) = Qnil;
5048 XSETFASTINT (BVAR (&buffer_defaults, fill_column), 70); 5042 XSETFASTINT (BVAR (&buffer_defaults, fill_column), 70);
@@ -5112,11 +5106,6 @@ init_buffer_once (void)
5112 XSETFASTINT (BVAR (&buffer_local_flags, left_margin), idx); ++idx; 5106 XSETFASTINT (BVAR (&buffer_local_flags, left_margin), idx); ++idx;
5113 XSETFASTINT (BVAR (&buffer_local_flags, abbrev_table), idx); ++idx; 5107 XSETFASTINT (BVAR (&buffer_local_flags, abbrev_table), idx); ++idx;
5114 XSETFASTINT (BVAR (&buffer_local_flags, display_table), idx); ++idx; 5108 XSETFASTINT (BVAR (&buffer_local_flags, display_table), idx); ++idx;
5115#ifdef DOS_NT
5116 XSETFASTINT (BVAR (&buffer_local_flags, buffer_file_type), idx);
5117 /* Make this one a permanent local. */
5118 buffer_permanent_local_flags[idx++] = 1;
5119#endif
5120 XSETFASTINT (BVAR (&buffer_local_flags, syntax_table), idx); ++idx; 5109 XSETFASTINT (BVAR (&buffer_local_flags, syntax_table), idx); ++idx;
5121 XSETFASTINT (BVAR (&buffer_local_flags, cache_long_line_scans), idx); ++idx; 5110 XSETFASTINT (BVAR (&buffer_local_flags, cache_long_line_scans), idx); ++idx;
5122 XSETFASTINT (BVAR (&buffer_local_flags, category_table), idx); ++idx; 5111 XSETFASTINT (BVAR (&buffer_local_flags, category_table), idx); ++idx;
@@ -5415,14 +5404,6 @@ This is the same as (default-value 'tab-width). */);
5415 doc: /* Default value of `case-fold-search' for buffers that don't override it. 5404 doc: /* Default value of `case-fold-search' for buffers that don't override it.
5416This is the same as (default-value 'case-fold-search). */); 5405This is the same as (default-value 'case-fold-search). */);
5417 5406
5418#ifdef DOS_NT
5419 DEFVAR_BUFFER_DEFAULTS ("default-buffer-file-type",
5420 buffer_file_type,
5421 doc: /* Default file type for buffers that do not override it.
5422This is the same as (default-value 'buffer-file-type).
5423The file type is nil for text, t for binary. */);
5424#endif
5425
5426 DEFVAR_BUFFER_DEFAULTS ("default-left-margin-width", 5407 DEFVAR_BUFFER_DEFAULTS ("default-left-margin-width",
5427 left_margin_cols, 5408 left_margin_cols,
5428 doc: /* Default value of `left-margin-width' for buffers that don't override it. 5409 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
5673`truncate-partial-width-windows', since wrapping can make text readable 5654`truncate-partial-width-windows', since wrapping can make text readable
5674in narrower windows. */); 5655in narrower windows. */);
5675 5656
5676#ifdef DOS_NT
5677 DEFVAR_PER_BUFFER ("buffer-file-type", &BVAR (current_buffer, buffer_file_type),
5678 Qnil,
5679 doc: /* Non-nil if the visited file is a binary file.
5680This variable is meaningful on MS-DOG and Windows NT.
5681On those systems, it is automatically local in every buffer.
5682On other systems, this variable is normally always nil. */);
5683#endif
5684
5685 DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory), 5657 DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory),
5686 make_number (Lisp_String), 5658 make_number (Lisp_String),
5687 doc: /* Name of default directory of current buffer. Should end with slash. 5659 doc: /* Name of default directory of current buffer. Should end with slash.
diff --git a/src/buffer.h b/src/buffer.h
index 19a7c0b4632..65c7168d60a 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -662,12 +662,6 @@ struct buffer
662 Lisp_Object BUFFER_INTERNAL_FIELD (left_margin); 662 Lisp_Object BUFFER_INTERNAL_FIELD (left_margin);
663 /* Function to call when insert space past fill column. */ 663 /* Function to call when insert space past fill column. */
664 Lisp_Object BUFFER_INTERNAL_FIELD (auto_fill_function); 664 Lisp_Object BUFFER_INTERNAL_FIELD (auto_fill_function);
665 /* nil: text, t: binary.
666 This value is meaningful only on certain operating systems. */
667 /* Actually, we don't need this flag any more because end-of-line
668 is handled correctly according to the buffer-file-coding-system
669 of the buffer. Just keeping it for backward compatibility. */
670 Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_type);
671 665
672 /* Case table for case-conversion in this buffer. 666 /* Case table for case-conversion in this buffer.
673 This char-table maps each char into its lower-case version. */ 667 This char-table maps each char into its lower-case version. */
diff --git a/src/callproc.c b/src/callproc.c
index 20018c688c9..c53a92bbaf8 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -74,10 +74,6 @@ extern char **environ;
74/* Pattern used by call-process-region to make temp files. */ 74/* Pattern used by call-process-region to make temp files. */
75static Lisp_Object Vtemp_file_name_pattern; 75static Lisp_Object Vtemp_file_name_pattern;
76 76
77#ifdef DOS_NT
78Lisp_Object Qbuffer_file_type;
79#endif /* DOS_NT */
80
81/* True if we are about to fork off a synchronous process or if we 77/* True if we are about to fork off a synchronous process or if we
82 are waiting for it. */ 78 are waiting for it. */
83int synch_process_alive; 79int synch_process_alive;
@@ -1535,11 +1531,6 @@ set_initial_environment (void)
1535void 1531void
1536syms_of_callproc (void) 1532syms_of_callproc (void)
1537{ 1533{
1538#ifdef DOS_NT
1539 Qbuffer_file_type = intern_c_string ("buffer-file-type");
1540 staticpro (&Qbuffer_file_type);
1541#endif /* DOS_NT */
1542
1543#ifndef DOS_NT 1534#ifndef DOS_NT
1544 Vtemp_file_name_pattern = build_string ("emacsXXXXXX"); 1535 Vtemp_file_name_pattern = build_string ("emacsXXXXXX");
1545#elif defined (WINDOWSNT) 1536#elif defined (WINDOWSNT)
diff --git a/src/fileio.c b/src/fileio.c
index 3112d7620c6..2ccad83f668 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3075,10 +3075,6 @@ otherwise, if FILE2 does not exist, the answer is t. */)
3075 return (mtime1 > st.st_mtime) ? Qt : Qnil; 3075 return (mtime1 > st.st_mtime) ? Qt : Qnil;
3076} 3076}
3077 3077
3078#ifdef DOS_NT
3079Lisp_Object Qfind_buffer_file_type;
3080#endif /* DOS_NT */
3081
3082#ifndef READ_BUF_SIZE 3078#ifndef READ_BUF_SIZE
3083#define READ_BUF_SIZE (64 << 10) 3079#define READ_BUF_SIZE (64 << 10)
3084#endif 3080#endif
@@ -4103,18 +4099,6 @@ variable `last-coding-system-used' to the coding system actually used. */)
4103 4099
4104 /* Now INSERTED is measured in characters. */ 4100 /* Now INSERTED is measured in characters. */
4105 4101
4106#ifdef DOS_NT
4107 /* Use the conversion type to determine buffer-file-type
4108 (find-buffer-file-type is now used to help determine the
4109 conversion). */
4110 if ((VECTORP (CODING_ID_EOL_TYPE (coding.id))
4111 || EQ (CODING_ID_EOL_TYPE (coding.id), Qunix))
4112 && ! CODING_REQUIRE_DECODING (&coding))
4113 BVAR (current_buffer, buffer_file_type) = Qt;
4114 else
4115 BVAR (current_buffer, buffer_file_type) = Qnil;
4116#endif
4117
4118 handled: 4102 handled:
4119 4103
4120 if (deferred_remove_unwind_protect) 4104 if (deferred_remove_unwind_protect)
@@ -4484,9 +4468,6 @@ This calls `write-region-annotate-functions' at the start, and
4484 int quietly = !NILP (visit); 4468 int quietly = !NILP (visit);
4485 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 4469 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
4486 struct buffer *given_buffer; 4470 struct buffer *given_buffer;
4487#ifdef DOS_NT
4488 int buffer_file_type = O_BINARY;
4489#endif /* DOS_NT */
4490 struct coding_system coding; 4471 struct coding_system coding;
4491 4472
4492 if (current_buffer->base_buffer && visiting) 4473 if (current_buffer->base_buffer && visiting)
@@ -4596,7 +4577,7 @@ This calls `write-region-annotate-functions' at the start, and
4596 desc = -1; 4577 desc = -1;
4597 if (!NILP (append)) 4578 if (!NILP (append))
4598#ifdef DOS_NT 4579#ifdef DOS_NT
4599 desc = emacs_open (fn, O_WRONLY | buffer_file_type, 0); 4580 desc = emacs_open (fn, O_WRONLY | O_BINARY, 0);
4600#else /* not DOS_NT */ 4581#else /* not DOS_NT */
4601 desc = emacs_open (fn, O_WRONLY, 0); 4582 desc = emacs_open (fn, O_WRONLY, 0);
4602#endif /* not DOS_NT */ 4583#endif /* not DOS_NT */
@@ -4604,7 +4585,7 @@ This calls `write-region-annotate-functions' at the start, and
4604 if (desc < 0 && (NILP (append) || errno == ENOENT)) 4585 if (desc < 0 && (NILP (append) || errno == ENOENT))
4605#ifdef DOS_NT 4586#ifdef DOS_NT
4606 desc = emacs_open (fn, 4587 desc = emacs_open (fn,
4607 O_WRONLY | O_CREAT | buffer_file_type 4588 O_WRONLY | O_CREAT | O_BINARY
4608 | (EQ (mustbenew, Qexcl) ? O_EXCL : O_TRUNC), 4589 | (EQ (mustbenew, Qexcl) ? O_EXCL : O_TRUNC),
4609 S_IREAD | S_IWRITE); 4590 S_IREAD | S_IWRITE);
4610#else /* not DOS_NT */ 4591#else /* not DOS_NT */
@@ -5586,11 +5567,6 @@ syms_of_fileio (void)
5586 Qexcl = intern_c_string ("excl"); 5567 Qexcl = intern_c_string ("excl");
5587 staticpro (&Qexcl); 5568 staticpro (&Qexcl);
5588 5569
5589#ifdef DOS_NT
5590 Qfind_buffer_file_type = intern_c_string ("find-buffer-file-type");
5591 staticpro (&Qfind_buffer_file_type);
5592#endif /* DOS_NT */
5593
5594 DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system, 5570 DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system,
5595 doc: /* *Coding system for encoding file names. 5571 doc: /* *Coding system for encoding file names.
5596If it is nil, `default-file-name-coding-system' (which see) is used. */); 5572If it is nil, `default-file-name-coding-system' (which see) is used. */);
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 34814687597..be16866eaf5 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -181,8 +181,6 @@ struct sigaction {
181#define HAVE_MENUS 1 181#define HAVE_MENUS 1
182#endif 182#endif
183 183
184#define MODE_LINE_BINARY_TEXT(_b_) (NILP (B_(_b_,buffer_file_type)) ? "T" : "B")
185
186/* Get some redefinitions in place. */ 184/* Get some redefinitions in place. */
187 185
188#ifdef emacs 186#ifdef emacs
diff --git a/src/w32fns.c b/src/w32fns.c
index 3f350c2f591..ec48397657a 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4348,9 +4348,9 @@ This function is an internal primitive--use `make-frame' instead. */)
4348 /* Initialize `default-minibuffer-frame' in case this is the first 4348 /* Initialize `default-minibuffer-frame' in case this is the first
4349 frame on this terminal. */ 4349 frame on this terminal. */
4350 if (FRAME_HAS_MINIBUF_P (f) 4350 if (FRAME_HAS_MINIBUF_P (f)
4351 && (!FRAMEP (kb->Vdefault_minibuffer_frame) 4351 && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
4352 || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))) 4352 || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
4353 kb->Vdefault_minibuffer_frame = frame; 4353 KVAR (kb, Vdefault_minibuffer_frame) = frame;
4354 4354
4355 /* All remaining specified parameters, which have not been "used" 4355 /* All remaining specified parameters, which have not been "used"
4356 by x_get_arg and friends, now go in the misc. alist of the frame. */ 4356 by x_get_arg and friends, now go in the misc. alist of the frame. */
diff --git a/src/w32term.c b/src/w32term.c
index cd4ee54fd2c..692130b5140 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -6082,7 +6082,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
6082 terminal like X does. */ 6082 terminal like X does. */
6083 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 6083 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
6084 init_kboard (terminal->kboard); 6084 init_kboard (terminal->kboard);
6085 terminal->kboard->Vwindow_system = intern ("w32"); 6085 KVAR (terminal->kboard, Vwindow_system) = intern ("w32");
6086 terminal->kboard->next_kboard = all_kboards; 6086 terminal->kboard->next_kboard = all_kboards;
6087 all_kboards = terminal->kboard; 6087 all_kboards = terminal->kboard;
6088 /* Don't let the initial kboard remain current longer than necessary. 6088 /* Don't let the initial kboard remain current longer than necessary.
diff --git a/src/xdisp.c b/src/xdisp.c
index 1cb4f7350c6..37fd9e4aaab 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -19585,11 +19585,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
19585 } 19585 }
19586 19586
19587 case 't': /* indicate TEXT or BINARY */ 19587 case 't': /* indicate TEXT or BINARY */
19588#ifdef MODE_LINE_BINARY_TEXT
19589 return MODE_LINE_BINARY_TEXT (b);
19590#else
19591 return "T"; 19588 return "T";
19592#endif
19593 19589
19594 case 'z': 19590 case 'z':
19595 /* coding-system (not including end-of-line format) */ 19591 /* coding-system (not including end-of-line format) */