home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-User.iso / usr / lib / emacs / lisp / files.elc < prev    next >
Text File  |  1992-10-23  |  31KB  |  456 lines

  1.  
  2. (defconst delete-auto-save-files t "\
  3. *Non-nil means delete a buffer's auto-save file
  4. when the buffer is saved for real.")
  5.  
  6. (defconst make-backup-files (not (eq system-type (quote vax-vms))) "\
  7. *Create a backup of each file when it is saved for the first time.
  8. This can be done by renaming the file or by copying.
  9.  
  10. Renaming means that Emacs renames the existing file so that it is a
  11. backup file, then writes the buffer into a new file.  Any other names
  12. that the old file had will now refer to the backup file.
  13. The new file is owned by you and its group is defaulted.
  14.  
  15. Copying means that Emacs copies the existing file into the backup file,
  16. then writes the buffer on top of the existing file.  Any other names
  17. that the old file had will now refer to the new (edited) file.
  18. The file's owner and group are unchanged.
  19.  
  20. The choice of renaming or copying is controlled by the variables
  21. backup-by-copying, backup-by-copying-when-linked and
  22. backup-by-copying-when-mismatch.")
  23.  
  24. (defconst backup-by-copying nil "\
  25. *Non-nil means always use copying to create backup files.
  26. See documentation of variable  make-backup-files.")
  27.  
  28. (defconst backup-by-copying-when-linked nil "\
  29. *Non-nil means use copying to create backups for files with multiple names.
  30. This causes the alternate names to refer to the latest version as edited.
  31. This variable is relevant only if  backup-by-copying  is nil.")
  32.  
  33. (defconst backup-by-copying-when-mismatch nil "\
  34. *Non-nil means create backups by copying if this preserves owner or group.
  35. Renaming may still be used (subject to control of other variables)
  36. when it would not result in changing the owner or group of the file;
  37. that is, for files which are owned by you and whose group matches
  38. the default for a new file created there by you.
  39. This variable is relevant only if  backup-by-copying  is nil.")
  40.  
  41. (defconst buffer-offer-save nil "\
  42. *Non-nil in a buffer means offer to save the buffer on exit
  43. even if the buffer is not visiting a file.  Automatically local in
  44. all buffers.")
  45.  
  46. (make-variable-buffer-local (quote buffer-offer-save))
  47.  
  48. (defconst file-precious-flag nil "\
  49. *Non-nil means protect against I/O errors while saving files.
  50. Some modes set this non-nil in particular buffers.")
  51.  
  52. (defvar version-control nil "\
  53. *Control use of version numbers for backup files.
  54. t means make numeric backup versions unconditionally.
  55. nil means make them for files that have some already.
  56. never means do not make them.")
  57.  
  58. (defvar dired-kept-versions 2 "\
  59. *When cleaning directory, number of versions to keep.")
  60.  
  61. (defvar trim-versions-without-asking nil "\
  62. *If true, deletes excess backup versions silently.
  63. Otherwise asks confirmation.")
  64.  
  65. (defvar kept-old-versions 2 "\
  66. *Number of oldest versions to keep when a new numbered backup is made.")
  67.  
  68. (defvar kept-new-versions 2 "\
  69. *Number of newest versions to keep when a new numbered backup is made.
  70. Includes the new backup.  Must be > 0")
  71.  
  72. (defconst require-final-newline nil "\
  73. *t says silently put a newline at the end whenever a file is saved.
  74. Non-nil but not t says ask user whether to add a newline in each such case.
  75. nil means don't add newlines.")
  76.  
  77. (defconst auto-save-default t "\
  78. *t says by default do auto-saving of every file-visiting buffer.")
  79.  
  80. (defconst auto-save-visited-file-name nil "\
  81. *t says auto-save a buffer in the file it is visiting, when practical.
  82. Normally auto-save files are written under other names.")
  83.  
  84. (defconst save-abbrevs nil "\
  85. *Non-nil means save word abbrevs too when files are saved.
  86. Loading an abbrev file sets this to t.")
  87.  
  88. (defconst find-file-run-dired t "\
  89. *Non-nil says run dired if find-file is given the name of a directory.")
  90.  
  91. (defvar find-file-not-found-hooks nil "\
  92. List of functions to be called for find-file on nonexistent file.
  93. These functions are called as soon as the error is detected.
  94. buffer-file-name is already set up.
  95. The functions are called in the order given,
  96. until one of them returns non-nil.")
  97.  
  98. (defvar find-file-hooks nil "\
  99. List of functions to be called after a buffer is loaded from a file.
  100. The buffer's local variables (if any) will have been processed before the
  101. functions are called.")
  102.  
  103. (defvar write-file-hooks nil "\
  104. List of functions to be called before writing out a buffer to a file.
  105. If one of them returns non-nil, the file is considered already written
  106. and the rest are not called.")
  107.  
  108. (defconst inhibit-local-variables nil "\
  109. *Non-nil means query before obeying a file's local-variables list.
  110. This applies when the local-variables list is scanned automatically
  111. after you find a file.  If you explicitly request such a scan with
  112. \\[normal-mode], there is no query, regardless of this variable.")
  113.  
  114. (defconst ignore-local-eval nil "\
  115. *Non-nil means ignore the \"variable\" `eval' in a file's local variables.
  116. This applies when the local-variables list is scanned automatically
  117. after you find a file.  If you explicitly request such a scan with
  118. \\[normal-mode], there is no query, regardless of this variable.")
  119.  
  120. (or (fboundp (quote lock-buffer)) (fset (quote lock-buffer) (quote ignore)))
  121.  
  122. (or (fboundp (quote unlock-buffer)) (fset (quote unlock-buffer) (quote ignore)))
  123.  
  124. (defun pwd nil "\
  125. Show the current default directory." (interactive nil) (byte-code "¹È´ˆ    \"Ç" [nil default-directory message "Directory %s"] 3))
  126.  
  127. (defun cd (dir) "\
  128. 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))
  129.  
  130. (defun load-file (file) "\
  131. Load the file FILE of Lisp code." (interactive "fLoad file: ") (byte-code "ˋȈ˜!ˋˋ´$Ç" [file nil t load expand-file-name] 6))
  132.  
  133. (defun load-library (library) "\
  134. Load the library named LIBRARY.
  135. This is an interface to the function `load'." (interactive "sLoad library: ") (byte-code "ˋÈ´!Ç" [library nil load] 2))
  136.  
  137. (defun switch-to-buffer-other-window (buffer) "\
  138. Select buffer BUFFER in another window." (interactive "BSwitch to buffer in other window: ") (byte-code "ˆÈˋ˜
  139. ˋ\")Ç" [pop-up-windows t buffer nil pop-to-buffer] 3))
  140.  
  141. (defun find-file (filename) "\
  142. Edit file FILENAME.
  143. Switch to a buffer visiting file FILENAME,
  144. creating one if none already exists." (interactive "FFind file: ") (byte-code "ˋÈ´ˆ!!Ç" [filename nil switch-to-buffer find-file-noselect] 3))
  145.  
  146. (defun find-file-other-window (filename) "\
  147. Edit file FILENAME, in another window.
  148. May create a new window, or reuse an existing one;
  149. see the function display-buffer." (interactive "FFind file in other window: ") (byte-code "ˋÈ´ˆ!!Ç" [filename nil switch-to-buffer-other-window find-file-noselect] 3))
  150.  
  151. (defun find-file-read-only (filename) "\
  152. Edit file FILENAME but don't save without confirmation.
  153. 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))
  154.  
  155. (defun find-alternate-file (filename) "\
  156. Find file FILENAME, select its buffer, kill previous buffer.
  157. If the current buffer now contains an empty file that you just visited
  158. (presumably by mistake), use this command to visit the file you really want." (interactive "FFind alternate file: ") (byte-code "˜È˘ Ä˙¨²˚ \"!?ĸ³!Èp
  159. ˚ ˝˛!ȘÉÈˇÎ— È±!)Èp=Å8¼!+Ç" [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=Ä
  160. ÉȘ È¯ !Ç" [obuf buffer-file-name ofile oname lock-buffer rename-buffer] 3)) unlock-buffer find-file kill-buffer] 11))
  161.  
  162. (defun create-file-buffer (filename) "\
  163. Create a suitably named buffer for visiting FILENAME, and return it.
  164. FILENAME (sans directory) is used unchanged if that name is free;
  165. 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))
  166.  
  167. (defconst automount-dir-prefix "^/tmp_mnt/" "\
  168. Regexp to match the automounter prefix in a directory name.")
  169.  
  170. (defun find-file-noselect (filename &optional nowarn) "\
  171. Read file FILENAME into a buffer and return the buffer.
  172. If a buffer exists visiting FILENAME, return that one,
  173. but verify that the file has not changed since visited or saved.
  174. The buffer is not selected, just returned to the caller." (byte-code "¨!ÉȲ    \"Ä˚¸³˝!S˛O!!Ä$³˝!S˛OÉÈˇ!Â<
  175. Â5—!Á9˜±\"ÁÞ¼!˛ ÂzÅw½ !Åw˚!?Â^˜¾\"Áwàá !ÂiâÁjã!ÄwÊ qÈ䢢\")ÁÛÊå!ÉÈ qÈç È˛èéÏȸ!ÉÈê ?\")È *Ç" [filename automount-dir-prefix find-file-run-dired buf error nowarn t default-directory expand-file-name string-match file-exists-p file-name-directory match-end 0 nil file-directory-p dired-noselect "%s is a directory." get-file-buffer verify-visited-file-modtime "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 "ˋÉÈ 
  176. Ę
  177. @!?Ä
  178. AÉÈÁ)Ç" [error t hooks find-file-not-found-hooks funcall] 4))) after-find-file] 22))
  179.  
  180. (defun after-find-file (&optional error warn) "\
  181. Called after finding a file and by the default revert function.
  182. Sets buffer mode, parses local variables.
  183. Optional args ERROR and WARN: ERROR non-nil means there was an
  184. error in reading the file.  WARN non-nil means warn if there
  185. exists an auto-save file more recent than the visited file.
  186. Finishes by calling the functions in find-file-hooks." (byte-code "³    !?ÉÈ
  187. ˆÁyˆ?Â8Ä ˝˛     \"Â'ˇÁ5˙ÉÈÂ4—Á5ˆÁ^?ÂF˙ÉȱÁ^¼    !ÂP½Á^¼¾    !!Â]àÁ^áÄoâ!È Åoãä˙\"*È
  188. Ä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))
  189.  
  190. (defun normal-mode (&optional find-file) "\
  191. Choose the major mode for this buffer automatically.
  192. Also sets up any specified local variables of the file.
  193. Uses the visited file name, the -*- line, and the local variables spec.
  194.  
  195. This function is called automatically from `find-file'.  In that case,
  196. if `inhibit-local-variables' is non-`nil' we require confirmation before
  197. processing a local variables spec.  If you run `normal-mode' explicitly,
  198. 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))
  199.  
  200. (defun set-auto-mode nil "\
  201. Select major mode appropriate for current buffer.
  202. May base decision on visited file name (See variable  auto-mode-list)
  203. or on buffer contents (-*- line or local variables spec), but does not look
  204. for the \"mode:\" local variable.  For that, use  hack-local-variables." (byte-code "˚˚˚Êebȸ³!È˝˛Êˇ È`)ˆ#ÄÀ¸—!È`ÉÈ˝˛Êˇ È`)ˆ#ÄÀ±¼!Ƚ—!È`ÉÈbÈ˝¾    ˆ#Â{bȈ˝à    ˆ#)Äx¸—!È`ÉÈ˝á    ˆ#Âk±â!Ám    bȽ—!Èã`\"ÉÁÀã    \"ÉÂÐäåç
  205. !èP!!Áˇ    é=ê!ÉÈ
  206. ?ēįë@@\"Ä…@AÉÈAÉÈÁ⁄)È
  207. IJä
  208. !*)+Ç" [beg end mode t case-fold-search alist auto-mode-alist name buffer-file-name system-type nil skip-chars-forward "     
  209. " 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))
  210.  
  211. (defun hack-local-variables (&optional force) "\
  212. Parse, and bind or evaluate as appropriate, any local variables
  213. for current buffer." (byte-code "ÊdbÈ—±d¼Ze]½#Èˋ¾à´ˋ#Ä# ?Å# Å#áË)Äpˋ´´´´
  214.     âã!ÈlÅHä`å È`\"É    Èçè!bÈnÅ\\ä`é È`\"ÉÈÄnGê!ÉÈ    Ä}ê    !ëPÉ    ÈÄo ÂÎìÆ!ÁÑíª!ÈĤî!Â¥ï!Á¤ðñ!Èâã!È`É
  215. ÈâŁ!ÈlĉðØ!ÈŒã!Èä
  216. `\" º !´òó !ô\"ª´ÉÁjâõ!Èïª!Ⱥp!ÉÈŒö!Èâã!È    Âî    !ÁlÅðæ!Èù=Â$úûóı!!üP!!Áj˜=Â/´Ájˇ=Â:´Ájý=Â`ÄH ?ÅPłø œ\"ÂYßþ!Á]ý!Ájÿ!ÈL+ÈÁ~-)Ç" [case-fold-search t nil inhibit-local-variables force buffer-file-name continue prefix prefixlen suffix beg selective-display str var val ignore-local-eval search-backward "
  217. " 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 "[
  218. ]" forward-line 1 looking-at forward-char error "Local variables entry is missing the prefix" "^:
  219. " "Missing colon in local variables entry" skip-chars-backward read string-equal downcase "end" "^:" "
  220. " "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))
  221.  
  222. (defun set-visited-file-name (filename) "\
  223. Change name of file visited in current buffer to FILENAME.
  224. The next time the buffer is saved it will go in the newly specified file.
  225. nil or empty string as argument means make buffer not be visiting any file.
  226. Remember to delete the initial contents of the minibuffer
  227. if you wish to pass an empty string as the argument." (interactive "FSet visited file name: ") (byte-code "ˋÈÄ˚¸\"ÂˋÁ³!ÉÈ˝
  228. \"Å)?Å)˛!Èˇ ÈÂk—!± ¸\"Ä<¼½!Ⱦ!ÄG¼à\"È á=ÄSâ !ÉÈÉÈã
  229. !ÉÈä !Ågå !)ÁnˋÉÈˋÉÈç Èèé!Èèê!ÈÂÉë ÁÑì
  230. ÄÐ!È
  231. ÄÛƲ!Ç" [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" file-directory-p "File %s is a directory" 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] 21))
  232.  
  233. (defun write-file (filename) "\
  234. Write current buffer into file FILENAME.
  235. 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))
  236.  
  237. (defun backup-buffer nil "\
  238. Make a backup of the disk file visited by the current buffer, if appropriate.
  239. This is normally done before saving the buffer the first time.
  240. If the value is non-nil, it is the result of `file-modes' on the original file;
  241. this means that the caller, after saving the buffer, should change the modes
  242. of the new file to agree with the old modes." (byte-code "Ä2    ?Ä2ˆ
  243. !Ä2˜¯
  244. !˘\"˙H¨>Ä2
  245. G²WÅ+˚¸
  246. ˙²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²²˚¸ÏÈ˘ÉÈ Ä$Å$³˝˛    \"!Ä8 Ä8²ˇ—ÏÈ 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
  247. Å0 Ä˚    !¸VÅ0 Ä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 nil (byte-code "ˋ!Ç" [backupname delete-file] 2) ((file-error (byte-code "¹Ç" [nil] 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))
  248.  
  249. (defun file-name-sans-versions (name) "\
  250. Return FILENAME sans backup versions or strings.
  251. This is a separate procedure so your site-init or startup file can
  252. redefine it." (byte-code "´    ˆ=Â$˜¯\"Å!˜˘˜˙\"#Ä!˜¨²´!#Á(˜˚\"OÇ" [name system-type 0 vax-vms string-match ";[0-9]*\\'" "\\." "[]>]" "\\.[0-9]*\\'" match-end "\\(\\.~[0-9]+\\)?~\\'"] 10))
  253.  
  254. (defun make-backup-file-name (file) "\
  255. Create the non-numeric backup file name for FILE.
  256. This is a separate function so you can redefine it for customization." (byte-code "ˋPÇ" [file "~"] 2))
  257.  
  258. (defun backup-file-name-p (file) "\
  259. Return non-nil if FILE is a backup file name (numeric or not).
  260. This is a separate function so you can redefine it for customization.
  261. You may need to redefine file-name-sans-versions as well." (byte-code "ˋ´\"Ç" [file string-match "~$"] 3))
  262.  
  263. (defun find-backup-file-name (fn) "\
  264. Find a file name for a backup file, and suggestions for deletions.
  265. Value is a list whose car is the name for the backup file
  266.  and whose cdr is a list of old versions to consider deleting now." (byte-code "˝=²    !CÁÅˇ    !—P
  267. ¼    !\"½¾à \"á\"âãäB\"Å5äVåG    
  268. ç$?ÂO˛    !CÁà   —èT!éRäVÄhê
  269.     ç#äYľëì    \" Æì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] 19))
  270.  
  271. (defun backup-extract-version (fn) (byte-code "´ˆ    #Ę¯!    U¢    ˙O!Á¯Ç" [fn bv-length string-match "[0-9]+~$" match-beginning 0 string-to-int -1] 6))
  272.  
  273. (defun file-nlinks (filename) "\
  274. Return number of names file FILENAME has." (byte-code "ˋ!A@Ç" [filename file-attributes] 2))
  275.  
  276. (defun save-buffer (&optional args) "\
  277. Save current buffer in visited file if modified.  Versions described below.
  278.  
  279. By default, makes the previous version into a backup file
  280.  if previously requested or if this is the first save.
  281. With 1 or 3 \\[universal-argument]'s, marks this version
  282.  to become a backup when the next save is done.
  283. With 2 or 3 \\[universal-argument]'s,
  284.  unconditionally makes the previous version into a backup file.
  285. With argument of 0, never makes the previous version into a backup file.
  286.  
  287. If a file's name is FOO, the names of its numbered backup versions are
  288.  FOO.~i~ for various integers i.  A non-numbered backup file is called FOO~.
  289. Numeric backups (rather than FOO~) will be made if value of
  290.  `version-control' is not the atom `never' and either there are already
  291.  numeric versions of the file being backed up, or `version-control' is
  292.  non-nil.
  293. We don't want excessive versions piling up, so there are variables
  294.  `kept-old-versions', which tells Emacs how many oldest versions to keep,
  295.  and `kept-new-versions', which tells how many newest versions to keep.
  296.  Defaults are 2 old versions and 2 new.
  297. `dired-kept-versions' controls dired's clean-directory (.) command.
  298. If `trim-versions-without-asking' is nil, system will query user
  299.  before trimming versions.  Otherwise it does it silently." (interactive "p") (byte-code "¯È˘ ˙ ¨V
  300. Ä ²=?Ä  ˚>Ä ¯ÉÈÄ&    Ä.¸³˝ \"È˛ ÈÄ? ˇ>Ä?¯É+Ç" [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))
  301.  
  302. (defun delete-auto-save-file-if-necessary nil "\
  303. Delete the auto-save filename for the current buffer (if it has one)
  304. if variable  delete-auto-save-files  is non-nil." (byte-code "Ä    Äˆ
  305. \"?Ę¯˘ÏÈ˙ Ç" [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))
  306.  
  307. (defun basic-save-buffer nil "\
  308. Save the current buffer in its visited file, if it has been modified." (interactive) (byte-code "ˆÈ± Â'ˆˆ
  309. ż½¾!ˆ\"à
  310. !ÉÈá!Èâ
  311. !?Ä;ãäåç
  312. !\"!Â8˘ÉÁ;èé!Èêp!ÅRë
  313. !?ÅRãì!ÅRèÆ!ÈÅ\\í ÉÈ̪ ÈdîVÄÍïdSfð\"Ä͢=ÅÂÄÂãäñŁ \"!ÄÍÊdbÈðc)È
  314. ˆ         Ä£Ø    @!É ?Ä®    AÉ    ÈÁÕÈ Â…ˆÉÁ ?Ä Âó˘ˆ
  315. ŒPˆºòÏÈóÎô Èõed
  316. ˆ˘%ȈÉ)+Áö=ÄøˆˆÉÈ    Ä?Äæ
  317. !ÉÈù
  318. ú\"Èõed
  319. ˆ˘%*ÈĈûıÏ)Èü *Á*ýł!Ç" [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 system-type 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 "¯    
  320. ˆ#È˘ Á Å˙¨²ÏÇ" [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 vax-vms 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))
  321.  
  322. (defun save-some-buffers (&optional arg exiting) "\
  323. Save some modified file-visiting buffers.  Asks user about each one.
  324. Optional argument (the prefix) non-nil means save all with no questions.
  325. Optional second argument EXITING means ask about certain non-file buffers
  326.  as well as about file buffers." (interactive "P") (byte-code "¸È¸³     ÄZ    @˝
  327. !ÄPÊ
  328. qÈ Å( Ä(Ä(˛ ˇVÄO˘ÉÄOÅH— ÂB±¼ \"ÁG±½¾ \"!ÄO¸àáÏ))È    AÉÈÁÈÄ     Ä ˘ÉÈÅu—±â
  329. \"!Ä{ã¸!ȸÉ    ÈÂËäå!ÁÎäç!*Ç" [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))
  330.  
  331. (defun not-modified nil "\
  332. Mark current buffer as unmodified, not needing to be saved." (interactive) (byte-code "¹Èˋ´!Ȉ¹!Ç" [nil message "Modification-flag cleared" set-buffer-modified-p] 3))
  333.  
  334. (defun toggle-read-only nil "\
  335. 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))
  336.  
  337. (defun insert-file (filename) "\
  338. Insert contents of file FILENAME into buffer after point.
  339. Set mark after the inserted text." (interactive "fInsert file: ") (byte-code "´Èˆ    !˜`A@\\!)Ç" [tem filename nil insert-file-contents push-mark] 4))
  340.  
  341. (defun append-to-file (start end filename) "\
  342. Append the contents of the region to the end of file FILENAME.
  343. When called from a function, expects three arguments,
  344. START, END and FILENAME.  START and END are buffer positions
  345. saying what text to write." (interactive "r
  346. FAppend to file: ") (byte-code "˜È¯    
  347. ˆ$Ç" [start end filename t nil write-region] 5))
  348.  
  349. (defvar revert-buffer-function nil "\
  350. Function to use to revert this buffer, or nil to do the default.")
  351.  
  352. (defun revert-buffer (&optional arg noconfirm) "\
  353. Replace the buffer text with the text of the visited file on disk.
  354. This undoes all changes since the file was visited or saved.
  355. If latest auto-save file is more recent than the visited file,
  356. asks user whether to use that instead.
  357. First argument (optional) non-nil means don't offer to use auto-save file.
  358.  This is the prefix arg when called interactively.
  359.  
  360. Second argument (optional) non-nil means don't ask for confirmation at all.
  361.  
  362. If revert-buffer-function's value is non-nil, it is called to do the work." (interactive "P") (byte-code "²È½    
  363. #Á¢`    ?Ä'˛ Ä'Ä'ˇ!Ä'—±! Â0Á2?Â@¼½!Á¡¾!?ÂP¼à\"Á¡
  364. Å[áâã\"!Ä¡ ?Änäp!?Än²ÉÈ
  365. ¸=Åz²É
  366. Ȳ¸
  367.  ² ÅÊå Èç )Èè ?\"*È 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))
  368.  
  369. (defun recover-file (file) "\
  370. Visit file FILE, but get contents from its last auto-save file." (interactive "FRecover file: ") (byte-code "¯È²!ÉÈ˚!ĸ³\"È˝ )˛    \"?Â(¸ˇ    \"ÁI—ËÂF±¼˘\"!ȯ½ È¾    ¯\")Èà¯!ÁI¸á!)ȯÉÈâã!Ç" [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))
  371.  
  372. (defun kill-some-buffers nil "\
  373. For each buffer, ask whether to kill it." (interactive) (byte-code "ˆÈ˜ ÄB@¯    !˘
  374. ˙\"?Ä8¨
  375. ²H˚\"Ä8¸³˝
  376. ˛    !Â/ˇÁ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))
  377.  
  378. (defun auto-save-mode (arg) "\
  379. Toggle auto-saving of contents of current buffer.
  380. With arg, turn auto-saving on if arg is positive, else off." (interactive "P") (byte-code "˘È    ? ?Á     ´=Å     <Å ˙    !Ä     ¨VÄ6 Ä- Ä-?Â4 Á6² ÉÈtÄI˚¸ÂG³Á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))
  381.  
  382. (defun rename-auto-save-file nil "\
  383. Adjust current buffer's auto save file name for current conditions.
  384. Also rename any existing auto save file." (byte-code "    ˜ ÉÈÄ\"    Ä\"¯    
  385. \"?Ä\"¯    \"?Ä\"˘!Ä*˙    ˆ#)Ç" [osave buffer-auto-save-file-name buffer-file-name t make-auto-save-file-name string= file-exists-p rename-file] 8))
  386.  
  387. (defun make-auto-save-file-name nil "\
  388. Return file name to use for auto-saves of current buffer.
  389. Does not consider auto-save-visited-file-name; that is checked
  390. before calling this function.
  391. You can redefine this for customization.
  392. 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))
  393.  
  394. (defun auto-save-file-name-p (filename) "\
  395. Return non-nil if FILENAME can be yielded by make-auto-save-file-name.
  396. FILENAME should lack slashes.
  397. You can redefine this for customization." (byte-code "ˋ´\"Ç" [filename string-match "^#.*#$"] 3))
  398.  
  399. (defconst list-directory-brief-switches "-CF" "\
  400. *Switches for list-directory to pass to `ls' for brief listing,")
  401.  
  402. (defconst list-directory-verbose-switches "-l" "\
  403. *Switches for list-directory to pass to `ls' for verbose listing,")
  404.  
  405. (defun list-directory (dirname &optional verbose) "\
  406. Display a list of files in or matching DIRNAME, a la `ls'.
  407. DIRNAME is globbed by the shell if necessary.
  408. Prefix arg (second arg if noninteractive) means supply -l switch to `ls'.
  409. Actions controlled by variables list-directory-brief-switches
  410.  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))
  411.  
  412. (defun save-buffers-kill-emacs (&optional arg) "\
  413. Offer to save each buffer, then kill this Emacs fork.
  414. With prefix arg, silently save all file-visiting buffers, then kill." (interactive "P") (byte-code "¯È˘ˋ\"Èˋ˙¨² \">?Å˚¸!Ä\\³˝!?ÅW˝ ¯
  415. ÄM˛
  416. @!ˇ>ÄD—
  417. @!—
  418. @ \"È )ÄDˋÉÈ
  419. 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 open) process-kill-without-query "Active processes exist; kill them and exit anyway? " kill-emacs] 12))
  420.  
  421. (define-key ctl-x-map "" (quote find-file))
  422.  
  423. (define-key ctl-x-map "" (quote toggle-read-only))
  424.  
  425. (define-key ctl-x-map "" (quote find-file-read-only))
  426.  
  427. (define-key ctl-x-map "" (quote find-alternate-file))
  428.  
  429. (define-key ctl-x-map "" (quote save-buffer))
  430.  
  431. (define-key ctl-x-map "s" (quote save-some-buffers))
  432.  
  433. (define-key ctl-x-map "" (quote write-file))
  434.  
  435. (define-key ctl-x-map "i" (quote insert-file))
  436.  
  437. (define-key esc-map "~" (quote not-modified))
  438.  
  439. (define-key ctl-x-map "" (quote list-directory))
  440.  
  441. (define-key ctl-x-map "" (quote save-buffers-kill-emacs))
  442.  
  443. (defvar ctl-x-4-map (make-keymap) "\
  444. Keymap for subcommands of C-x 4")
  445.  
  446. (fset (quote ctl-x-4-prefix) ctl-x-4-map)
  447.  
  448. (define-key ctl-x-map "4" (quote ctl-x-4-prefix))
  449.  
  450. (define-key ctl-x-4-map "f" (quote find-file-other-window))
  451.  
  452. (define-key ctl-x-4-map "" (quote find-file-other-window))
  453.  
  454. (define-key ctl-x-4-map "b" (quote switch-to-buffer-other-window))
  455.