Improve TTY library detection
[sxemacs] / lisp / files-nomule.el
1 ;;; files-nomule.el --- file I/O stubs when not under Mule.
2
3 ;; Copyright (C) 1985-1987, 1992-1994, 1997 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995 Sun Microsystems.
5
6 ;; Maintainer: SXEmacs Development Team
7 ;; Keywords: extensions, dumped
8
9 ;; This file is part of SXEmacs.
10
11 ;; SXEmacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
15
16 ;; SXEmacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
24 ;;; Synched up with: FSF 19.34 (files.el).   (Is it?  Please check)
25
26 ;;; Commentary:
27
28 ;; This file is dumped with SXEmacs (when Mule is not compiled in).
29
30 ;; These stubs were moved from the bottom of files.el.
31
32 ;;; Code:
33
34 (defun insert-file-contents (filename &optional visit start end replace)
35   "Insert contents of file FILENAME after point.
36 Returns list of absolute file name and length of data inserted.
37 If second argument VISIT is non-nil, the buffer's visited filename
38 and last save file modtime are set, and it is marked unmodified.
39 If visiting and the file does not exist, visiting is completed
40 before the error is signaled.
41
42 The optional third and fourth arguments START and END
43 specify what portion of the file to insert.
44 If VISIT is non-nil, START and END must be nil.
45 If optional fifth argument REPLACE is non-nil,
46 it means replace the current buffer contents (in the accessible portion)
47 with the file contents.  This is better than simply deleting and inserting
48 the whole thing because (1) it preserves some marker positions
49 and (2) it puts less data in the undo list."
50   (insert-file-contents-internal filename visit start end replace nil nil))
51
52 (defun write-region (start end filename &optional append visit lockname coding-system)
53   "Write current region into specified file.
54 By default, the file's existing contents are replaced by the specified region.
55 When called from a program, takes three arguments:
56 START, END and FILENAME.  START and END are buffer positions.
57 Optional fourth argument APPEND if non-nil means
58   append to existing file contents (if any).
59 Optional fifth argument VISIT if t means
60   set the last-save-file-modtime of buffer to this file's modtime
61   and mark buffer not modified.
62 If VISIT is a string, it is a second file name;
63   the output goes to FILENAME, but the buffer is marked as visiting VISIT.
64   VISIT is also the file name to lock and unlock for clash detection.
65 If VISIT is neither t nor nil nor a string,
66   that means do not print the \"Wrote file\" message.
67 The optional sixth arg LOCKNAME, if non-nil, specifies the name to
68   use for locking and unlocking, overriding FILENAME and VISIT.
69 Kludgy feature: if START is a string, then that string is written
70 to the file, instead of any buffer contents, and END is ignored.
71 Optional seventh argument CODING-SYSTEM is meaningful only if support
72   for Mule is present in XEmacs and specifies the coding system
73   used to encode the text when it is written out, and defaults to
74   the value of `buffer-file-coding-system' in the current buffer.
75   When Mule support is not present, the CODING-SYSTEM argument is
76   ignored."
77   (interactive "r\nFWrite region to file: ")
78   (write-region-internal start end filename append visit lockname nil))
79
80 (defun load (file &optional noerror nomessage nosuffix)
81   "Execute a file of Lisp code named FILE.
82 First try FILE with `.elc' appended, then try with `.el',
83  then try FILE unmodified.
84 This function searches the directories in `load-path'.
85 If optional second arg NOERROR is non-nil,
86  report no error if FILE doesn't exist.
87 Print messages at start and end of loading unless
88  optional third arg NOMESSAGE is non-nil (ignored in -batch mode).
89 If optional fourth arg NOSUFFIX is non-nil, don't try adding
90  suffixes `.elc' or `.el' to the specified name FILE.
91 Return t if file exists."
92   (load-internal file noerror nomessage nosuffix nil nil))
93
94 ;;; files-nomule.el ends here