4.4BSD/usr/src/contrib/emacs-18.57/lisp/files.elc


(defconst delete-auto-save-files t "\
*Non-nil means delete a buffer's auto-save file
when the buffer is saved for real.")

(defconst make-backup-files (not (eq system-type (quote vax-vms))) "\
*Create a backup of each file when it is saved for the first time.
This can be done by renaming the file or by copying.

Renaming means that Emacs renames the existing file so that it is a
backup file, then writes the buffer into a new file.  Any other names
that the old file had will now refer to the backup file.
The new file is owned by you and its group is defaulted.

Copying means that Emacs copies the existing file into the backup file,
then writes the buffer on top of the existing file.  Any other names
that the old file had will now refer to the new (edited) file.
The file's owner and group are unchanged.

The choice of renaming or copying is controlled by the variables
backup-by-copying, backup-by-copying-when-linked and
backup-by-copying-when-mismatch.")

(defconst backup-by-copying nil "\
*Non-nil means always use copying to create backup files.
See documentation of variable  make-backup-files.")

(defconst backup-by-copying-when-linked nil "\
*Non-nil means use copying to create backups for files with multiple names.
This causes the alternate names to refer to the latest version as edited.
This variable is relevant only if  backup-by-copying  is nil.")

(defconst backup-by-copying-when-mismatch nil "\
*Non-nil means create backups by copying if this preserves owner or group.
Renaming may still be used (subject to control of other variables)
when it would not result in changing the owner or group of the file;
that is, for files which are owned by you and whose group matches
the default for a new file created there by you.
This variable is relevant only if  backup-by-copying  is nil.")

(defconst buffer-offer-save nil "\
*Non-nil in a buffer means offer to save the buffer on exit
even if the buffer is not visiting a file.  Automatically local in
all buffers.")

(make-variable-buffer-local (quote buffer-offer-save))

(defconst file-precious-flag nil "\
*Non-nil means protect against I/O errors while saving files.
Some modes set this non-nil in particular buffers.")

(defvar version-control nil "\
*Control use of version numbers for backup files.
t means make numeric backup versions unconditionally.
nil means make them for files that have some already.
never means do not make them.")

(defvar dired-kept-versions 2 "\
*When cleaning directory, number of versions to keep.")

(defvar trim-versions-without-asking nil "\
*If true, deletes excess backup versions silently.
Otherwise asks confirmation.")

(defvar kept-old-versions 2 "\
*Number of oldest versions to keep when a new numbered backup is made.")

(defvar kept-new-versions 2 "\
*Number of newest versions to keep when a new numbered backup is made.
Includes the new backup.  Must be > 0")

(defconst require-final-newline nil "\
*t says silently put a newline at the end whenever a file is saved.
Non-nil but not t says ask user whether to add a newline in each such case.
nil means don't add newlines.")

(defconst auto-save-default t "\
*t says by default do auto-saving of every file-visiting buffer.")

(defconst auto-save-visited-file-name nil "\
*t says auto-save a buffer in the file it is visiting, when practical.
Normally auto-save files are written under other names.")

(defconst save-abbrevs nil "\
*Non-nil means save word abbrevs too when files are saved.
Loading an abbrev file sets this to t.")

(defconst find-file-run-dired t "\
*Non-nil says run dired if find-file is given the name of a directory.")

(defvar find-file-not-found-hooks nil "\
List of functions to be called for find-file on nonexistent file.
These functions are called as soon as the error is detected.
buffer-file-name is already set up.
The functions are called in the order given,
until one of them returns non-nil.")

(defvar find-file-hooks nil "\
List of functions to be called after a buffer is loaded from a file.
The buffer's local variables (if any) will have been processed before the
functions are called.")

(defvar write-file-hooks nil "\
List of functions to be called before writing out a buffer to a file.
If one of them returns non-nil, the file is considered already written
and the rest are not called.")

(defconst inhibit-local-variables nil "\
*Non-nil means query before obeying a file's local-variables list.
This applies when the local-variables list is scanned automatically
after you find a file.  If you explicitly request such a scan with
\\[normal-mode], there is no query, regardless of this variable.")

(or (fboundp (quote lock-buffer)) (fset (quote lock-buffer) (quote ignore)))

(or (fboundp (quote unlock-buffer)) (fset (quote unlock-buffer) (quote ignore)))

(defun pwd nil "\
Show the current default directory." (interactive nil) (byte-code "	\"" [nil default-directory message "Directory %s"] 3))

(defun cd (dir) "\
Make DIR become the current buffer's default directory." (interactive "DChange default directory: ") (byte-code "È!	=?!!?#\"& " [dir system-type default-directory nil expand-file-name vax-vms file-name-as-directory file-directory-p error "%s is not a directory" pwd] 6))

(defun load-file (file) "\
Load the file FILE of Lisp code." (interactive "fLoad file: ") (byte-code "!$" [file nil t load expand-file-name] 6))

(defun load-library (library) "\
Load the library named LIBRARY.
This is an interface to the function `load'." (interactive "sLoad library: ") (byte-code "!" [library nil load] 2))

(defun switch-to-buffer-other-window (buffer) "\
Select buffer BUFFER in another window." (interactive "BSwitch to buffer in other window: ") (byte-code "È
\")" [pop-up-windows t buffer nil pop-to-buffer] 3))

(defun find-file (filename) "\
Edit file FILENAME.
Switch to a buffer visiting file FILENAME,
creating one if none already exists." (interactive "FFind file: ") (byte-code "!!" [filename nil switch-to-buffer find-file-noselect] 3))

(defun find-file-other-window (filename) "\
Edit file FILENAME, in another window.
May create a new window, or reuse an existing one;
see the function display-buffer." (interactive "FFind file in other window: ") (byte-code "!!" [filename nil switch-to-buffer-other-window find-file-noselect] 3))

(defun find-file-read-only (filename) "\
Edit file FILENAME but don't save without confirmation.
Like find-file but marks buffer as read-only." (interactive "fFind file read-only: ") (byte-code "È!‰" [filename buffer-read-only t nil find-file] 3))

(defun find-alternate-file (filename) "\
Find file FILENAME, select its buffer, kill previous buffer.
If the current buffer now contains an empty file that you just visited
(presumably by mistake), use this command to visit the file you really want." (interactive "FFind alternate file: ") (byte-code "Ĉ  \"!?!p
 !ĉώ 
!)!+" [obuf ofile buffer-file-name oname nil filename buffer-modified-p yes-or-no-p format "Buffer %s is modified; kill anyway? " buffer-name error "Aborted" rename-buffer " **lose**" ((byte-code "p=
 !" [obuf buffer-file-name ofile oname lock-buffer rename-buffer] 3)) unlock-buffer find-file kill-buffer] 11))

(defun create-file-buffer (filename) "\
Create a suitably named buffer for visiting FILENAME, and return it.
FILENAME (sans directory) is used unchanged if that name is free;
otherwise a string <2> or <3> or ... is appended to get an unused name." (byte-code "	!\"	!)" [lastname filename file-name-nondirectory string= "" generate-new-buffer] 4))

(defun find-file-noselect (filename &optional nowarn) "\
Read file FILENAME into a buffer and return the buffer.
If a buffer exists visiting FILENAME, return that one,
but verify that the file has not changed since visited or saved.
The buffer is not selected, just returned to the caller." (byte-code "!\"!SO!.	'!+\"!
li
!i!?P\"i
![ւ\\!i
q\")!
q ܏!?\")
*" [filename find-file-run-dired buf error nowarn t default-directory expand-file-name string-match "^/tmp_mnt/" match-end 0 nil file-directory-p dired-noselect "%s is a directory." get-file-buffer verify-visited-file-modtime file-exists-p "File %s no longer exists!" yes-or-no-p buffer-modified-p "File has changed since last visited or saved.  Flush your changes? " "File has changed since last visited or saved.  Read from disk? " revert-buffer create-file-buffer erase-buffer (byte-code "\"" [filename t insert-file-contents] 3) ((file-error (byte-code "

@!?
A)" [error t hooks find-file-not-found-hooks funcall] 4))) file-name-directory after-find-file] 19))

(defun after-find-file (&optional error warn) "\
Called after finding a file and by the default revert function.
Sets buffer mode, parses local variables.
Optional args ERROR and WARN: ERROR non-nil means there was an
error in reading the file.  WARN non-nil means warn if there
exists an auto-save file more recent than the visited file.
Finishes by calling the functions in find-file-hooks." (byte-code "	!?
Ây?8  	\"'ς5lj4Ђ5Â^?Fljт^	!Pӂ^	!!]Ղ^
o
!o\"*
y!!\"" [buffer-read-only buffer-file-name noninteractive nil not-serious msg warn t error default-directory auto-save-default find-file-hooks file-writable-p file-newer-than-file-p make-auto-save-file-name "Auto save file is newer; consider M-x recover-file" "(New file)" "File is write protected" file-attributes "File exists, but is read-protected." directory-file-name "File not found and directory write-protected" "File not found and directory doesn't exist" message sit-for 1 auto-save-mode normal-mode mapcar funcall] 13))

(defun normal-mode (&optional find-file) "\
Choose the major mode for this buffer automatically.
Also sets up any specified local variables of the file.
Uses the visited file name, the -*- line, and the local variables spec.

This function is called automatically from `find-file'.  In that case,
if `inhibit-local-variables' is non-`nil' we require confirmation before
processing a local variables spec.  If you run `normal-mode' explicitly,
confirmation is never required." (interactive) (byte-code "ˆ
	!Ǐɏ" [find-file default-major-mode nil funcall fundamental-mode err (byte-code " " [set-auto-mode] 2) ((error (byte-code "!\"" [err message "File mode specification error: %s" prin1-to-string] 4))) (byte-code "?!" [find-file hack-local-variables] 2) ((error (byte-code "!\"" [err message "File local-variables error: %s" prin1-to-string] 4)))] 4))

(defun set-auto-mode nil "\
Select major mode appropriate for current buffer.
May base decision on visited file name (See variable  auto-mode-list)
or on buffer contents (-*- line or local variables spec), but does not look
for the \"mode:\" local variable.  For that, use  hack-local-variables." (byte-code "eb!Ί `)#!`Ί `)#!!`b	#{b	#)x!`	#k!m	b!`\"	\"
!P!!	=!
?

@@\"
@A
A)

!*)+" [beg end mode t case-fold-search alist auto-mode-alist name buffer-file-name system-type nil skip-chars-forward " 	
" search-forward "-*-" end-of-line " 	" forward-char -3 skip-chars-backward ":" "mode:" ";" -1 buffer-substring funcall intern downcase "-mode" vax-vms file-name-sans-versions string-match] 24))

(defun hack-local-variables (&optional force) "\
Parse, and bind or evaluate as appropriate, any local variables
for current buffer." (byte-code "dbdZe]###?##Ջ)P
	!lH` `\"	!bn\\` `\"nG!	}	!P	O!!!!!!`
!l!!
`\"!
!\"‰J!!p!!!		!l
!
=$!!P!!J
=@ \"9!=!J
!
L+~-)" [case-fold-search t nil inhibit-local-variables force buffer-file-name continue prefix prefixlen suffix beg selective-display str var val search-backward "
" 3000 move search-forward "Local Variables:" ((byte-code "p!  `\")!\"!" [buffer-file-name switch-to-buffer beginning-of-line set-window-start selected-window y-or-n-p format "Set local variables as specified at end of %s? " file-name-nondirectory] 9)) skip-chars-forward " 	" buffer-substring end-of-line match-beginning 0 beginning-of-line regexp-quote "$" re-search-forward "[

]" forward-line 1 looking-at forward-char error "Local variables entry is missing the prefix" "^:
" "Missing colon in local variables entry" skip-chars-backward read string-equal downcase "end" "^:" "
" "Local variables entry is terminated incorrectly" mode funcall intern symbol-name "-mode" eval string= user-login-name "root" message "Ignoring `eval:' in file's local variables" make-local-variable] 42))

(defun set-visited-file-name (filename) "\
Change name of file visited in current buffer to FILENAME.
The next time the buffer is saved it will go in the newly specified file.
nil or empty string as argument means make buffer not be visiting any file.
Remember to delete the initial contents of the minibuffer
if you wish to pass an empty string as the argument." (interactive "FSet visited file name: ") (byte-code "\"!
\")?)! ]
!\"@!=L!
!!\\!) !!x 
!
!" [filename nil buffer-file-name new-name system-type default-directory buffer-backed-up buffer-auto-save-file-name auto-save-default t string-equal "" expand-file-name equal lock-buffer unlock-buffer file-name-nondirectory string= error "Empty file name" vax-vms downcase file-name-directory get-buffer rename-buffer clear-visited-file-modtime kill-local-variable write-file-hooks revert-buffer-function rename-auto-save-file auto-save-mode set-buffer-modified-p] 19))

(defun write-file (filename) "\
Write current buffer into file FILENAME.
Makes buffer visit that file, and marks it not modified." (interactive "FWrite file: ") (byte-code "ˆ?\"!! " [filename t nil string-equal "" set-visited-file-name set-buffer-modified-p save-buffer] 5))

(defun backup-buffer nil "\
Make a backup of the disk file visited by the current buffer, if appropriate.
This is normally done before saving the buffer the first time.
If the value is non-nil, it is the result of `file-modes' on the original file;
this means that the caller, after saving the buffer, should change the modes
of the new file to agree with the old modes." (byte-code "2	?2
!2
!\"H>2
GW+
O\"?2Ώ" [make-backup-files buffer-backed-up buffer-file-name file-exists-p elt file-attributes 8 0 (45 108) 5 string-equal "/tmp/" nil (byte-code "	!@AˏƉ$$	\"!88ЏA'," [backup-info buffer-file-name backupname targets setmodes buffer-backed-up t trim-versions-without-asking find-backup-file-name nil (byte-code "0	!0
0	!V00	!
8/
8 \")=	$Pԏ	#!" [file-precious-flag buffer-file-name backup-by-copying backup-by-copying-when-linked backup-by-copying-when-mismatch attr backupname t setmodes file-symlink-p file-nlinks 1 file-attributes 9 /= 2 user-uid copy-file nil (byte-code "!" [backupname delete-file] 2) ((file-error (byte-code "" [nil] 1))) rename-file file-modes] 10) ((file-error (byte-code "!!!	$" [backupname buffer-file-name t expand-file-name "~/%backup%~" message "Cannot write backup file; backing up in ~/%%backup%%~" sleep-for 1 copy-file] 8))) y-or-n-p format "Delete excess backup versions of %s? " (byte-code "@!" [targets delete-file] 2) ((file-error (byte-code "" [nil] 1)))] 7) ((file-error (byte-code "" [nil] 1)))] 8))

(defun file-name-sans-versions (name) "\
Return FILENAME sans backup versions or strings.
This is a separate procedure so your site-init or startup file can
redefine it." (byte-code "	=\"\"G+\"+\"+GO" [name system-type 0 vax-vms string-match ";[0-9]+\\'" ".[0-9]+\\'" "\\.~[0-9]+~\\'" "~\\'"] 8))

(defun make-backup-file-name (file) "\
Create the non-numeric backup file name for FILE.
This is a separate function so you can redefine it for customization." (byte-code "P" [file "~"] 2))

(defun backup-file-name-p (file) "\
Return non-nil if FILE is a backup file name (numeric or not).
This is a separate function so you can redefine it for customization.
You may need to redefine file-name-sans-versions as well." (byte-code "\"" [file string-match "~$"] 3))

(defun find-backup-file-name (fn) "\
Find a file name for a backup file, and suggestions for deletions.
Value is a list whose car is the name for the backup file
 and whose cdr is a list of old versions to consider deleting now." (byte-code "=
	!Cz	!P
G
	!\"\"\"
B\"5V
G	
$?O	!Cx	T!RVw	
\"S\"\")\"B." [version-control fn base-versions bv-length possibilities versions high-water-mark deserve-versions-p number-to-delete kept-old-versions kept-new-versions v nil never make-backup-file-name file-name-nondirectory ".~" file-name-all-completions file-name-directory sort mapcar backup-extract-version < apply max 0 - -1 int-to-string "~" (lambda (n) (byte-code "	!R" [fn n ".~" int-to-string "~"] 5)) nthcdr rplacd] 18))

(defun backup-extract-version (fn) (byte-code "	#
!	U	O!Ň" [fn bv-length string-match "[0-9]+~$" match-beginning 0 string-to-int -1] 6))

(defun file-nlinks (filename) "\
Return number of names file FILENAME has." (byte-code "!A@" [filename file-attributes] 2))

(defun save-buffer (&optional args) "\
Save current buffer in visited file if modified.  Versions described below.

By default, makes the previous version into a backup file
 if previously requested or if this is the first save.
With 1 or 3 \\[universal-argument]'s, marks this version
 to become a backup when the next save is done.
With 2 or 3 \\[universal-argument]'s,
 unconditionally makes the previous version into a backup file.
With argument of 0, never makes the previous version into a backup file.

If a file's name is FOO, the names of its numbered backup versions are
 FOO.~i~ for various integers i.  A non-numbered backup file is called FOO~.
Numeric backups (rather than FOO~) will be made if value of
 `version-control' is not the atom `never' and either there are already
 numeric versions of the file being backed up, or `version-control' is
 non-nil.
We don't want excessive versions piling up, so there are variables
 `kept-old-versions', which tells Emacs how many oldest versions to keep,
 and `kept-new-versions', which tells how many newest versions to keep.
 Defaults are 2 old versions and 2 new.
`dired-kept-versions' controls dired's clean-directory (.) command.
If `trim-versions-without-asking' is nil, system will query user
 before trimming versions.  Otherwise it does it silently." (interactive "p") (byte-code "ň  V
=? > ʼn&	. \" ?>?ʼn+" [modp large make-backup-files args buffer-backed-up nil buffer-modified-p buffer-size 50000 0 (16 64) message "Saving file %s..." buffer-file-name basic-save-buffer (4 64)] 7))

(defun delete-auto-save-file-if-necessary nil "\
Delete the auto-save filename for the current buffer (if it has one)
if variable  delete-auto-save-files  is non-nil." (byte-code "	
\"?Ə " [buffer-auto-save-file-name delete-auto-save-files buffer-file-name string= nil (byte-code "!" [buffer-auto-save-file-name delete-file] 2) ((file-error (byte-code "" [nil] 1))) set-buffer-auto-saved] 4))

(defun basic-save-buffer nil "\
Save the current buffer in its visited file, if it has been modified." (interactive) (byte-code "È 
!\"
!
!
!?;
!\"!8Ɖ;!p!R
!?R!R!\\  dVdSf\"= \"!dbc)
			@!?	A	?
P
돈 ed
%É
)+	?
!
\"ed
%*) *!" [setmodes tempsetmodes buffer-file-name nil default-directory auto-save-default t buffer-backed-up require-final-newline hooks write-file-hooks done file-precious-flag rename nodelete file buffer-modified-p expand-file-name read-file-name "File to save in: " file-name-directory auto-save-mode file-writable-p yes-or-no-p format "File %s is write-protected; try to save anyway? " file-name-nondirectory error "Attempt to save to a file which you aren't allowed to write" verify-visited-file-modtime file-exists-p "Disk file has changed since visited or saved.  Save anyway? " "Save not confirmed" backup-buffer widen 1 /= 10 "Buffer %s does not end in newline.  Add one? " buffer-name funcall "#" (byte-code "	#	!" [buffer-file-name file t setmodes rename-file file-modes] 4) ((file-error (byte-code "É" [rename nil nodelete t] 2))) ((byte-code "	
# ɏ" [rename file buffer-file-name t nodelete rename-file clear-visited-file-modtime nil (byte-code "!" [file delete-file] 2) ((error (byte-code "" [nil] 1)))] 5)) clear-visited-file-modtime write-region file-modes set-file-modes 511 (byte-code "	\"" [buffer-file-name setmodes set-file-modes] 3) ((error (byte-code "" [nil] 1))) delete-auto-save-file-if-necessary message "(No changes need to be saved)"] 31))

(defun save-some-buffers (&optional arg exiting) "\
Save some modified file-visiting buffers.  Asks user about each one.
With argument, saves all with no questions." (interactive "P") (byte-code "ˈ 	Z	@
!P
q((
( VOƉOHB\"G \"!O֏))	A	Ɖu
\"!{!ˉ	!!*" [considered list buffer buffer-file-name exiting buffer-offer-save t arg save-abbrevs abbrevs-changed abbrev-file-name nil buffer-list buffer-modified-p buffer-size 0 y-or-n-p format "Save file %s? " "Save buffer %s? " buffer-name (byte-code " " [save-buffer] 2) ((error (byte-code "" [nil] 1))) "Save abbrevs in %s? " write-abbrev-file message "" "(No files need saving)"] 13))

(defun not-modified nil "\
Mark current buffer as unmodified, not needing to be saved." (interactive) (byte-code "!!" [nil message "Modification-flag cleared" set-buffer-modified-p] 3))

(defun toggle-read-only nil "\
Change whether this buffer is visiting its file read-only." (interactive) (byte-code "? !" [buffer-read-only nil set-buffer-modified-p buffer-modified-p] 3))

(defun insert-file (filename) "\
Insert contents of file FILENAME into buffer after point.
Set mark after the inserted text." (interactive "fInsert file: ") (byte-code "ˆ	!`A@\\!)" [tem filename nil insert-file-contents push-mark] 4))

(defun append-to-file (start end filename) "\
Append the contents of the region to the end of file FILENAME.
When called from a function, expects three arguments,
START, END and FILENAME.  START and END are buffer positions
saying what text to write." (interactive "r
FAppend to file: ") (byte-code "Ĉ	
$" [start end filename t nil write-region] 5))

(defvar revert-buffer-function nil "\
Function to use to revert this buffer, or nil to do the default.")

(defun revert-buffer (&optional arg noconfirm) "\
Replace the buffer text with the text of the visited file on disk.
This undoes all changes since the file was visited or saved.
If latest auto-save file is more recent than the visited file,
asks user whether to use that instead.
First argument (optional) non-nil means don't offer to use auto-save file.
 This is the prefix arg when called interactively.

Second argument (optional) non-nil means don't ask for confirmation at all.

If revert-buffer-function's value is non-nil, it is called to do the work." (interactive "P") (byte-code "Ɉ	
#`	?' '
'
!'!0
2?@!!?P\"
[\"!?np!?nɉ
=zɉ

  )?\"*d^b!+" [revert-buffer-function arg noconfirm opoint auto-save-p buffer-auto-save-file-name file-name buffer-file-name buffer-backed-up nil buffer-undo-list t buffer-read-only funcall recent-auto-save-p file-readable-p y-or-n-p "Buffer has been auto-saved recently.  Revert from auto-save file? " error "Buffer does not seem to be associated with any file" file-exists-p "File %s no longer exists!" yes-or-no-p format "Revert buffer from file %s? " verify-visited-file-modtime unlock-buffer erase-buffer insert-file-contents after-find-file] 15))

(defun recover-file (file) "\
Visit file FILE, but get contents from its last auto-save file." (interactive "FRecover file: ") (byte-code "ň!!\" )	\"?(	\"IЋF\"! 	\")!I!)ʼn!" [file file-name buffer-file-name system-type standard-output nil t buffer-read-only buffer-auto-save-file-name expand-file-name auto-save-file-name-p error "%s is an auto-save file" make-auto-save-file-name file-newer-than-file-p "Auto-save file %s not current" ((byte-code "=?Ɛ	!	&\"!" [system-type standard-output nil file file-name vax-vms "*Directory*" buffer-flush-undo call-process "ls" "-l" yes-or-no-p format "Recover auto save file %s? "] 10)) switch-to-buffer find-file-noselect erase-buffer insert-file-contents after-find-file "Recover-file cancelled." message "Auto-save off in this buffer till you do M-x auto-save-mode."] 14))

(defun kill-some-buffers nil "\
For each buffer, ask whether to kill it." (interactive) (byte-code "È B@	!
\"?8
H\"8
	!/ς0#!8	!*A)" [list buffer name nil buffer-list buffer-name string-equal "" /= 0 32 yes-or-no-p format "Buffer %s %s.  Kill? " buffer-modified-p "HAS BEEN EDITED" "is unmodified" kill-buffer] 11))

(defun auto-save-mode (arg) "\
Toggle auto-saving of contents of current buffer.
With arg, turn auto-saving on if arg is positive, else off." (interactive "P") (byte-code "ƈ	?? 	= 	< 	! 	V6--
?46 tIĜH\"" [buffer-auto-save-file-name arg t buffer-file-name auto-save-visited-file-name buffer-read-only nil integerp 0 make-auto-save-file-name message "Auto-save %s (in this buffer)" "on" "off"] 5))

(defun rename-auto-save-file nil "\
Adjust current buffer's auto save file name for current conditions.
Also rename any existing auto save file." (byte-code "	 \"	\"	
\"?\"	\"?\"!*	#)" [osave buffer-auto-save-file-name buffer-file-name t make-auto-save-file-name string= file-exists-p rename-file] 8))

(defun make-auto-save-file-name nil "\
Return file name to use for auto-saves of current buffer.
Does not consider auto-save-visited-file-name; that is checked
before calling this function.
You can redefine this for customization.
See also auto-save-file-name-p." (byte-code "!!R Q!" [buffer-file-name file-name-directory "#" file-name-nondirectory expand-file-name "#%" buffer-name] 7))

(defun auto-save-file-name-p (filename) "\
Return non-nil if FILENAME can be yielded by make-auto-save-file-name.
FILENAME should lack slashes.
You can redefine this for customization." (byte-code "\"" [filename string-match "^#.*#$"] 3))

(defconst list-directory-brief-switches "-CF" "\
*Switches for list-directory to pass to `ls' for brief listing,")

(defconst list-directory-verbose-switches "-l" "\
*Switches for list-directory to pass to `ls' for verbose listing,")

(defun list-directory (dirname &optional verbose) "\
Display a list of files in or matching DIRNAME, a la `ls'.
DIRNAME is globbed by the shell if necessary.
Prefix arg (second arg if noninteractive) means supply -l switch to `ls'.
Actions controlled by variables list-directory-brief-switches
 and list-directory-verbose-switches." (interactive (byte-code "	ł$D)" [pfx current-prefix-arg nil default-directory read-file-name "List directory (verbose): " "List directory (brief): "] 5)) (byte-code "ˆ

			!6ʉ	\"6	P		!	Ґ!!	! e	&}	!	!R&)*" [pfx current-prefix-arg nil default-directory switches verbose list-directory-verbose-switches list-directory-brief-switches full-dir-p dirname t standard-output shell-file-name file-directory-p string-match "/$" "/" expand-file-name "*Directory*" buffer-flush-undo princ "Directory " terpri call-process "ls" file-name-directory "-c" "exec ls " " " file-name-nondirectory] 21))

(defun save-buffers-kill-emacs (&optional arg) "\
Offer to save each buffer, then kill this Emacs fork.
With prefix arg, silently save all file-visiting buffers, then kill." (interactive "P") (byte-code "ň\" \">?!\\!?W 
M
@!>D
@!
@\")D
A$?V!*\\ " [arg t processes active val nil save-some-buffers mapcar (lambda (buf) (byte-code "!	!" [buf buffer-file-name buffer-modified-p] 3)) buffer-list yes-or-no-p "Modified buffers exist; exit anyway? " fboundp process-list process-status (run stop) process-kill-without-query "Active processes exist; kill them and exit anyway? " kill-emacs] 12))

(define-key ctl-x-map "" (quote find-file))

(define-key ctl-x-map "" (quote toggle-read-only))

(define-key ctl-x-map "" (quote find-file-read-only))

(define-key ctl-x-map "" (quote find-alternate-file))

(define-key ctl-x-map "" (quote save-buffer))

(define-key ctl-x-map "s" (quote save-some-buffers))

(define-key ctl-x-map "" (quote write-file))

(define-key ctl-x-map "i" (quote insert-file))

(define-key esc-map "~" (quote not-modified))

(define-key ctl-x-map "" (quote list-directory))

(define-key ctl-x-map "" (quote save-buffers-kill-emacs))

(defvar ctl-x-4-map (make-keymap) "\
Keymap for subcommands of C-x 4")

(fset (quote ctl-x-4-prefix) ctl-x-4-map)

(define-key ctl-x-map "4" (quote ctl-x-4-prefix))

(define-key ctl-x-4-map "f" (quote find-file-other-window))

(define-key ctl-x-4-map "" (quote find-file-other-window))

(define-key ctl-x-4-map "b" (quote switch-to-buffer-other-window))