emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103296: Use KVAR in MS-Windows build


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103296: Use KVAR in MS-Windows build, remove buffer-file-type.
Date: Wed, 16 Feb 2011 20:39:46 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103296
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Wed 2011-02-16 20:39:46 +0200
message:
  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.
modified:
  src/ChangeLog
  src/buffer.c
  src/buffer.h
  src/callproc.c
  src/fileio.c
  src/s/ms-w32.h
  src/w32fns.c
  src/w32term.c
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-02-16 16:35:16 +0000
+++ b/src/ChangeLog     2011-02-16 18:39:46 +0000
@@ -1,3 +1,28 @@
+2011-02-16  Eli Zaretskii  <address@hidden>
+
+       * 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  <address@hidden>
 
        * callint.c (Fcall_interactively): Update.

=== modified file 'src/buffer.c'
--- a/src/buffer.c      2011-02-16 15:02:50 +0000
+++ b/src/buffer.c      2011-02-16 18:39:46 +0000
@@ -715,9 +715,6 @@
   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 @@
   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 @@
   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 @@
                          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 @@
 `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.

=== modified file 'src/buffer.h'
--- a/src/buffer.h      2011-02-16 15:02:50 +0000
+++ b/src/buffer.h      2011-02-16 18:39:46 +0000
@@ -662,12 +662,6 @@
   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.  */

=== modified file 'src/callproc.c'
--- a/src/callproc.c    2011-02-16 15:02:50 +0000
+++ b/src/callproc.c    2011-02-16 18:39:46 +0000
@@ -74,10 +74,6 @@
 /* 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 @@
 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)

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2011-02-16 15:02:50 +0000
+++ b/src/fileio.c      2011-02-16 18:39:46 +0000
@@ -3075,10 +3075,6 @@
   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 @@
 
   /* 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 @@
   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 @@
   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 @@
   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 @@
   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.  */);

=== modified file 'src/s/ms-w32.h'
--- a/src/s/ms-w32.h    2011-02-14 17:35:21 +0000
+++ b/src/s/ms-w32.h    2011-02-16 18:39:46 +0000
@@ -181,8 +181,6 @@
 #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

=== modified file 'src/w32fns.c'
--- a/src/w32fns.c      2011-02-16 15:02:50 +0000
+++ b/src/w32fns.c      2011-02-16 18:39:46 +0000
@@ -4348,9 +4348,9 @@
   /* 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.  */

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2011-01-26 08:36:39 +0000
+++ b/src/w32term.c     2011-02-16 18:39:46 +0000
@@ -6082,7 +6082,7 @@
      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.

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2011-02-16 15:02:50 +0000
+++ b/src/xdisp.c       2011-02-16 18:39:46 +0000
@@ -19585,11 +19585,7 @@
       }
 
     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) */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]