diff options
| author | Richard M. Stallman | 1994-11-01 06:39:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-11-01 06:39:38 +0000 |
| commit | f7975d0711438a8260199720072a3b8f0ad85325 (patch) | |
| tree | 4db4329d72825ca6929e518d7837afb09aa8a25b /src/buffer.c | |
| parent | 5e028eee2a750bbdd8d96ff26fc5fc16b8767177 (diff) | |
| download | emacs-f7975d0711438a8260199720072a3b8f0ad85325.tar.gz emacs-f7975d0711438a8260199720072a3b8f0ad85325.zip | |
(init_buffer): Use DIRECTORY_SEP, IS_DIRECTORY_SEP macros,
not character constants.
(init_buffer_once, syms_of_buffer): Test DOS_NT, not MSDOS.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/buffer.c b/src/buffer.c index c9deb2cb0f2..4b70b113c2f 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -2504,7 +2504,7 @@ init_buffer_once () | |||
| 2504 | buffer_defaults.truncate_lines = Qnil; | 2504 | buffer_defaults.truncate_lines = Qnil; |
| 2505 | buffer_defaults.ctl_arrow = Qt; | 2505 | buffer_defaults.ctl_arrow = Qt; |
| 2506 | 2506 | ||
| 2507 | #ifdef MSDOS | 2507 | #ifdef DOS_NT |
| 2508 | buffer_defaults.buffer_file_type = Qnil; /* TEXT */ | 2508 | buffer_defaults.buffer_file_type = Qnil; /* TEXT */ |
| 2509 | #endif | 2509 | #endif |
| 2510 | XSETFASTINT (buffer_defaults.fill_column, 70); | 2510 | XSETFASTINT (buffer_defaults.fill_column, 70); |
| @@ -2550,7 +2550,7 @@ init_buffer_once () | |||
| 2550 | XSETFASTINT (buffer_local_flags.display_table, 0x2000); | 2550 | XSETFASTINT (buffer_local_flags.display_table, 0x2000); |
| 2551 | XSETFASTINT (buffer_local_flags.syntax_table, 0x8000); | 2551 | XSETFASTINT (buffer_local_flags.syntax_table, 0x8000); |
| 2552 | XSETFASTINT (buffer_local_flags.cache_long_line_scans, 0x10000); | 2552 | XSETFASTINT (buffer_local_flags.cache_long_line_scans, 0x10000); |
| 2553 | #ifdef MSDOS | 2553 | #ifdef DOS_NT |
| 2554 | XSETFASTINT (buffer_local_flags.buffer_file_type, 0x4000); | 2554 | XSETFASTINT (buffer_local_flags.buffer_file_type, 0x4000); |
| 2555 | #endif | 2555 | #endif |
| 2556 | 2556 | ||
| @@ -2584,12 +2584,13 @@ init_buffer () | |||
| 2584 | char *pwd; | 2584 | char *pwd; |
| 2585 | struct stat dotstat, pwdstat; | 2585 | struct stat dotstat, pwdstat; |
| 2586 | Lisp_Object temp; | 2586 | Lisp_Object temp; |
| 2587 | int rc; | ||
| 2587 | 2588 | ||
| 2588 | Fset_buffer (Fget_buffer_create (build_string ("*scratch*"))); | 2589 | Fset_buffer (Fget_buffer_create (build_string ("*scratch*"))); |
| 2589 | 2590 | ||
| 2590 | /* If PWD is accurate, use it instead of calling getwd. This is faster | 2591 | /* If PWD is accurate, use it instead of calling getwd. This is faster |
| 2591 | when PWD is right, and may avoid a fatal error. */ | 2592 | when PWD is right, and may avoid a fatal error. */ |
| 2592 | if ((pwd = getenv ("PWD")) != 0 && *pwd == '/' | 2593 | if ((pwd = getenv ("PWD")) != 0 && IS_DIRECTORY_SEP (*pwd) |
| 2593 | && stat (pwd, &pwdstat) == 0 | 2594 | && stat (pwd, &pwdstat) == 0 |
| 2594 | && stat (".", &dotstat) == 0 | 2595 | && stat (".", &dotstat) == 0 |
| 2595 | && dotstat.st_ino == pwdstat.st_ino | 2596 | && dotstat.st_ino == pwdstat.st_ino |
| @@ -2602,8 +2603,12 @@ init_buffer () | |||
| 2602 | #ifndef VMS | 2603 | #ifndef VMS |
| 2603 | /* Maybe this should really use some standard subroutine | 2604 | /* Maybe this should really use some standard subroutine |
| 2604 | whose definition is filename syntax dependent. */ | 2605 | whose definition is filename syntax dependent. */ |
| 2605 | if (buf[strlen (buf) - 1] != '/') | 2606 | rc = strlen (buf); |
| 2606 | strcat (buf, "/"); | 2607 | if (!(IS_DIRECTORY_SEP (buf[rc - 1]))) |
| 2608 | { | ||
| 2609 | buf[rc] = DIRECTORY_SEP; | ||
| 2610 | buf[rc + 1] = '\0'; | ||
| 2611 | } | ||
| 2607 | #endif /* not VMS */ | 2612 | #endif /* not VMS */ |
| 2608 | current_buffer->directory = build_string (buf); | 2613 | current_buffer->directory = build_string (buf); |
| 2609 | 2614 | ||
| @@ -2691,7 +2696,7 @@ This is the same as (default-value 'tab-width)."); | |||
| 2691 | "Default value of `case-fold-search' for buffers that don't override it.\n\ | 2696 | "Default value of `case-fold-search' for buffers that don't override it.\n\ |
| 2692 | This is the same as (default-value 'case-fold-search)."); | 2697 | This is the same as (default-value 'case-fold-search)."); |
| 2693 | 2698 | ||
| 2694 | #ifdef MSDOS | 2699 | #ifdef DOS_NT |
| 2695 | DEFVAR_LISP_NOPRO ("default-buffer-file-type", | 2700 | DEFVAR_LISP_NOPRO ("default-buffer-file-type", |
| 2696 | &buffer_defaults.buffer_file_type, | 2701 | &buffer_defaults.buffer_file_type, |
| 2697 | "Default file type for buffers that do not override it.\n\ | 2702 | "Default file type for buffers that do not override it.\n\ |
| @@ -2791,7 +2796,7 @@ Note that this is overridden by the variable\n\ | |||
| 2791 | `truncate-partial-width-windows' if that variable is non-nil\n\ | 2796 | `truncate-partial-width-windows' if that variable is non-nil\n\ |
| 2792 | and this buffer is not full-frame width."); | 2797 | and this buffer is not full-frame width."); |
| 2793 | 2798 | ||
| 2794 | #ifdef MSDOS | 2799 | #ifdef DOS_NT |
| 2795 | DEFVAR_PER_BUFFER ("buffer-file-type", ¤t_buffer->buffer_file_type, | 2800 | DEFVAR_PER_BUFFER ("buffer-file-type", ¤t_buffer->buffer_file_type, |
| 2796 | Qnil, | 2801 | Qnil, |
| 2797 | "*If visited file is text, nil; otherwise, t."); | 2802 | "*If visited file is text, nil; otherwise, t."); |