files.elc 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. (defconst delete-auto-save-files t "\
  2. *Non-nil means delete a buffer's auto-save file
  3. when the buffer is saved for real.")
  4. (defconst make-backup-files (not (eq system-type (quote vax-vms))) "\
  5. *Create a backup of each file when it is saved for the first time.
  6. This can be done by renaming the file or by copying.
  7. Renaming means that Emacs renames the existing file so that it is a
  8. backup file, then writes the buffer into a new file. Any other names
  9. that the old file had will now refer to the backup file.
  10. The new file is owned by you and its group is defaulted.
  11. Copying means that Emacs copies the existing file into the backup file,
  12. then writes the buffer on top of the existing file. Any other names
  13. that the old file had will now refer to the new (edited) file.
  14. The file's owner and group are unchanged.
  15. The choice of renaming or copying is controlled by the variables
  16. backup-by-copying, backup-by-copying-when-linked and
  17. backup-by-copying-when-mismatch.")
  18. (defconst backup-by-copying nil "\
  19. *Non-nil means always use copying to create backup files.
  20. See documentation of variable make-backup-files.")
  21. (defconst backup-by-copying-when-linked nil "\
  22. *Non-nil means use copying to create backups for files with multiple names.
  23. This causes the alternate names to refer to the latest version as edited.
  24. This variable is relevant only if backup-by-copying is nil.")
  25. (defconst backup-by-copying-when-mismatch nil "\
  26. *Non-nil means create backups by copying if this preserves owner or group.
  27. Renaming may still be used (subject to control of other variables)
  28. when it would not result in changing the owner or group of the file;
  29. that is, for files which are owned by you and whose group matches
  30. the default for a new file created there by you.
  31. This variable is relevant only if backup-by-copying is nil.")
  32. (defconst buffer-offer-save nil "\
  33. *Non-nil in a buffer means offer to save the buffer on exit
  34. even if the buffer is not visiting a file. Automatically local in
  35. all buffers.")
  36. (make-variable-buffer-local (quote buffer-offer-save))
  37. (defconst file-precious-flag nil "\
  38. *Non-nil means protect against I/O errors while saving files.
  39. Some modes set this non-nil in particular buffers.")
  40. (defvar version-control nil "\
  41. *Control use of version numbers for backup files.
  42. t means make numeric backup versions unconditionally.
  43. nil means make them for files that have some already.
  44. never means do not make them.")
  45. (defvar dired-kept-versions 2 "\
  46. *When cleaning directory, number of versions to keep.")
  47. (defvar trim-versions-without-asking nil "\
  48. *If true, deletes excess backup versions silently.
  49. Otherwise asks confirmation.")
  50. (defvar kept-old-versions 2 "\
  51. *Number of oldest versions to keep when a new numbered backup is made.")
  52. (defvar kept-new-versions 2 "\
  53. *Number of newest versions to keep when a new numbered backup is made.
  54. Includes the new backup. Must be > 0")
  55. (defconst require-final-newline nil "\
  56. *t says silently put a newline at the end whenever a file is saved.
  57. Non-nil but not t says ask user whether to add a newline in each such case.
  58. nil means don't add newlines.")
  59. (defconst auto-save-default t "\
  60. *t says by default do auto-saving of every file-visiting buffer.")
  61. (defconst auto-save-visited-file-name nil "\
  62. *t says auto-save a buffer in the file it is visiting, when practical.
  63. Normally auto-save files are written under other names.")
  64. (defconst save-abbrevs nil "\
  65. *Non-nil means save word abbrevs too when files are saved.
  66. Loading an abbrev file sets this to t.")
  67. (defconst find-file-run-dired t "\
  68. *Non-nil says run dired if find-file is given the name of a directory.")
  69. (defvar find-file-not-found-hooks nil "\
  70. List of functions to be called for find-file on nonexistent file.
  71. These functions are called as soon as the error is detected.
  72. buffer-file-name is already set up.
  73. The functions are called in the order given,
  74. until one of them returns non-nil.")
  75. (defvar find-file-hooks nil "\
  76. List of functions to be called after a buffer is loaded from a file.
  77. The buffer's local variables (if any) will have been processed before the
  78. functions are called.")
  79. (defvar write-file-hooks nil "\
  80. List of functions to be called before writing out a buffer to a file.
  81. If one of them returns non-nil, the file is considered already written
  82. and the rest are not called.")
  83. (defconst inhibit-local-variables nil "\
  84. *Non-nil means query before obeying a file's local-variables list.
  85. This applies when the local-variables list is scanned automatically
  86. after you find a file. If you explicitly request such a scan with
  87. \\[normal-mode], there is no query, regardless of this variable.")
  88. (or (fboundp (quote lock-buffer)) (fset (quote lock-buffer) (quote ignore)))
  89. (or (fboundp (quote unlock-buffer)) (fset (quote unlock-buffer) (quote ignore)))
  90. (defun pwd nil "\
  91. Show the current default directory." (interactive nil) (byte-code "ÀˆÂà \"‡" [nil default-directory message "Directory %s"] 3))
  92. (defun cd (dir) "\
  93. 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))
  94. (defun load-file (file) "\
  95. Load the file FILE of Lisp code." (interactive "fLoad file: ") (byte-code "ÁˆÃÄ!ÁÁÂ$‡" [file nil t load expand-file-name] 6))
  96. (defun load-library (library) "\
  97. Load the library named LIBRARY.
  98. This is an interface to the function `load'." (interactive "sLoad library: ") (byte-code "ÁˆÂ!‡" [library nil load] 2))
  99. (defun switch-to-buffer-other-window (buffer) "\
  100. Select buffer BUFFER in another window." (interactive "BSwitch to buffer in other window: ") (byte-code "ÈÁÄ
  101. Á\")‡" [pop-up-windows t buffer nil pop-to-buffer] 3))
  102. (defun find-file (filename) "\
  103. Edit file FILENAME.
  104. Switch to a buffer visiting file FILENAME,
  105. creating one if none already exists." (interactive "FFind file: ") (byte-code "ÁˆÂÃ!!‡" [filename nil switch-to-buffer find-file-noselect] 3))
  106. (defun find-file-other-window (filename) "\
  107. Edit file FILENAME, in another window.
  108. May create a new window, or reuse an existing one;
  109. see the function display-buffer." (interactive "FFind file in other window: ") (byte-code "ÁˆÂÃ!!‡" [filename nil switch-to-buffer-other-window find-file-noselect] 3))
  110. (defun find-file-read-only (filename) "\
  111. Edit file FILENAME but don't save without confirmation.
  112. 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))
  113. (defun find-alternate-file (filename) "\
  114. Find file FILENAME, select its buffer, kill previous buffer.
  115. If the current buffer now contains an empty file that you just visited
  116. (presumably by mistake), use this command to visit the file you really want." (interactive "FFind alternate file: ") (byte-code "ÅˆÇ …?…ÈÉÊË \"!?…ÌÍ!ˆp Ë ÎÏ!ˆÅ‰ˆÐŽÑ ˆÒ!)ˆÓ !+‡" [buffer-read-only 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=…
  117. ‰ˆÄ ˆÅ !‡" [obuf buffer-file-name ofile oname lock-buffer rename-buffer] 3)) unlock-buffer find-file kill-buffer] 11))
  118. (defun create-file-buffer (filename) "\
  119. Create a suitably named buffer for visiting FILENAME, and return it.
  120. FILENAME (sans directory) is used unchanged if that name is free;
  121. otherwise a string <2> or <3> or ... is appended to get an unused name." (byte-code "ÁÂ!!‡" [filename generate-new-buffer file-name-nondirectory] 3))
  122. (defun find-file-noselect (filename &optional nowarn) "\
  123. Read file FILENAME into a buffer and return the buffer.
  124. If a buffer exists visiting FILENAME, return that one,
  125. but verify that the file has not changed since visited or saved.
  126. The buffer is not selected, just returned to the caller." (byte-code "Ç!‰ˆÈ!ƒ ƒÉ!‚ÃÊ\"‚}Ë!Ì
  127. ƒ[ †XÍ
  128. !†XÎ!?ƒ?ÃÏ\"‚XÐÑ
  129. !ƒJÒ‚KÓ!…XŠ
  130. qˆÔÅÅ\")‚zŠÕ!‰ˆ
  131. qˆÖ ˆÌר�ˆÙ!‰ˆÚ ?\")ˆ
  132. *‡" [filename find-file-run-dired buf error nowarn t default-directory expand-file-name file-directory-p dired-noselect "%s is a directory." get-file-buffer nil 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 "Á‰ˆ 
  133. …Ä
  134. @!?…
  135. A‰ˆ‚)‡" [error t hooks find-file-not-found-hooks funcall] 4))) file-name-directory after-find-file] 17))
  136. (defun after-find-file (&optional error warn) "\
  137. Called after finding a file and by the default revert function.
  138. Sets buffer mode, parses local variables.
  139. Optional args ERROR and WARN: ERROR non-nil means there was an
  140. error in reading the file. WARN non-nil means warn if there
  141. exists an auto-save file more recent than the visited file.
  142. Finishes by calling the functions in find-file-hooks." (byte-code "Ì !?‰ˆ
  143. ƒÂyÃ?ƒ8… ÍÎ \"ƒ'Ï‚5ljˆƒ4Ђ5Â^?ƒFljˆÑ‚^Ò !ƒPÓ‚^ÒÔ !!ƒ]Õ‚^Ö …o× !ˆ †oØÙÇ\"*ˆ
  144. …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))
  145. (defun normal-mode (&optional find-file) "\
  146. Choose the major mode for this buffer automatically.
  147. Also sets up any specified local variables of the file.
  148. Uses the visited file name, the -*- line, and the local variables spec.
  149. This function is called automatically from `find-file'. In that case,
  150. if `inhibit-local-variables' is non-`nil' we require confirmation before
  151. processing a local variables spec. If you run `normal-mode' explicitly,
  152. 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))
  153. (defun set-auto-mode nil "\
  154. Select major mode appropriate for current buffer.
  155. May base decision on visited file name (See variable auto-mode-list)
  156. or on buffer contents (-*- line or local variables spec), but does not look
  157. for the \"mode:\" local variable. For that, use hack-local-variables." (byte-code "ÊÊÊŠebˆËÌ!ˆÍÎŠÏ ˆ`)Ã#…�ËÐ!ˆ`‰ˆÍÎŠÏ ˆ`)Ã#…�ÑÒ!ˆÓÐ!ˆ`‰ˆbˆÍÔ Ã#ƒ{bˆÃÍÕ Ã#)…xËÐ!ˆ`‰ˆÍÖ Ã#ƒkÑ×!‚m bˆÓÐ!ˆØ`\"‰‚�Ø \"‰ƒ�ÙÚÛ
  158. !ÜP!!‚Ï Ý=Þ!‰ˆ
  159. ?…ª …Åß @@\"…¼ @A‰ˆ A‰ˆ‚¤)ˆ
  160. …ÎÙ
  161. !*)+‡" [beg end mode t case-fold-search alist auto-mode-alist name buffer-file-name system-type nil skip-chars-forward "
  162. " 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))
  163. (defun hack-local-variables (&optional force) "\
  164. Parse, and bind or evaluate as appropriate, any local variables
  165. for current buffer." (byte-code "ŠdbˆÎÏdÐZe]Ñ#ˆÁÒÓÂÁ#…) ?†) †)ÔÕÖ× !\"!)…;ÁÂÂÂÂ
  166.  ØÙ!ˆl†NÚ`Û ˆ`\"‰ ˆÜÝ!bˆn†bÚ`Þ ˆ`\"‰ˆ…tGß!‰ˆ …�ß !‰ ˆ…:àá!ˆ…¡â!ƒžã!‚¡äå!ˆØÙ!ˆ`‰
  167. ˆØæ!ˆl…¶äç!ˆèÙ!ˆÚ
  168. `\" é !  êë !ì\"ƒÜ‰‚5Øí!ˆãá!ˆép!‰ ˆèî!ˆØÙ!ˆ ƒÿâ !‚l†äï!ˆ ð=ƒñòëó !!ôP!!‚5 õ=ƒ+õ !‚5ö !ˆ  L+ˆ‚‚-)‡" [case-fold-search t nil inhibit-local-variables force buffer-file-name continue prefix prefixlen suffix beg str var val search-backward "
  169. " 3000 move search-forward "Local Variables:" y-or-n-p format "Set local variables as specified at end of %s? " file-name-nondirectory skip-chars-forward " " buffer-substring end-of-line match-beginning 0 beginning-of-line regexp-quote forward-line 1 looking-at forward-char error "Local variables entry is missing the prefix" "^:
  170. " "Missing colon in local variables entry" skip-chars-backward read string-equal downcase "end" "^:" "
  171. " "Local variables entry is terminated incorrectly" mode funcall intern symbol-name "-mode" eval make-local-variable] 41))
  172. (defun set-visited-file-name (filename) "\
  173. Change name of file visited in current buffer to FILENAME.
  174. The next time the buffer is saved it will go in the newly specified file.
  175. nil or empty string as argument means make buffer not be visiting any file.
  176. Remember to delete the initial contents of the minibuffer
  177. if you wish to pass an empty string as the argument." (interactive "FSet visited file name: ") (byte-code "Áˆ…ÈÉ\"ƒÁ‚Ê!‰ˆË
  178. \"†)?†)Ì!ˆÍ ˆ‰ˆ…EÎ
  179. !‰ˆÏÐ
  180. !!†EÑÐ
  181. !!ˆÁ‰ˆÒ ˆÓÔ!ˆÓÕ!ˆ ƒ^Ö ‚f×
  182. …e!ˆ
  183. …nØÇ!‡" [filename nil buffer-file-name 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-directory get-buffer file-name-nondirectory 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] 17))
  184. (defun write-file (filename) "\
  185. Write current buffer into file FILENAME.
  186. 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))
  187. (defun backup-buffer nil "\
  188. Make a backup of the disk file visited by the current buffer.
  189. This is done before saving the buffer the first time." (byte-code "…2 ?…2Ã
  190. !…2ÄÅ
  191. !Æ\"ÇHÈ>…2
  192. GÉW†+ÊË
  193. ÇÉ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
  194. †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 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))
  195. (defun file-name-sans-versions (name) "\
  196. Return FILENAME sans backup versions or strings.
  197. This is a separate procedure so your site-init or startup file can
  198. redefine it." (byte-code " Ã=ƒÄÅ\"†ÄÆ\"†G‚+ÄÇ\"†+ÄÈ\"†+GO‡" [name system-type 0 vax-vms string-match ";[0-9]+\\'" "\\$__\\$\\'" "\\.~[0-9]+~\\'" "~\\'"] 8))
  199. (defun make-backup-file-name (file) "\
  200. Create the non-numeric backup file name for FILE.
  201. This is a separate function so you can redefine it for customization." (byte-code "ÁP‡" [file "~"] 2))
  202. (defun backup-file-name-p (file) "\
  203. Return non-nil if FILE is a backup file name (numeric or not).
  204. This is a separate function so you can redefine it for customization.
  205. You may need to redefine file-name-sans-versions as well." (byte-code "ÁÂ\"‡" [file string-match "~$"] 3))
  206. (defun find-backup-file-name (fn) "\
  207. Find a file name for a backup file, and suggestions for deletions.
  208. Value is a list whose car is the name for the backup file
  209. and whose cdr is a list of old versions to consider deleting now." (byte-code "Í=ƒ Î !C‚zÏ !ÐP
  210. GÑ
  211. Ò !\"ÓÔÕ \"Ö\"×ØÙ B\"†5ÙVÚ G 
  212. Û$?ƒOÎ !C‚x ÐÜT!ÝRÙV…wÔÞß \" àß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))
  213. (defun backup-extract-version (fn) (byte-code "Âà #… ÄÅ! UƒÆ ÇO!‚Ň" [fn bv-length string-match "[0-9]+~$" match-beginning 0 string-to-int -1] 6))
  214. (defun file-nlinks (filename) "\
  215. Return number of names file FILENAME has." (byte-code "Á!A@‡" [filename file-attributes] 2))
  216. (defun save-buffer (&optional args) "\
  217. Save current buffer in visited file if modified. Versions described below.
  218. With no arg, only backs up if first save or previously motivated.
  219. With 1 or 3 \\[universal-argument]'s, marks this version to be backed up.
  220. With 2 or 3 \\[universal-argument]'s, unconditionally backs up previous version.
  221. If a file's name is FOO, the names of its numbered backup versions are
  222. FOO.~i~ for various integers i. A non-numbered backup file is called FOO~.
  223. Numeric backups (rather than FOO~) will be made if value of
  224. version-control is not the atom never and either there are already
  225. numeric versions of the file being backed up, or version-control is
  226. non-nil.
  227. dired-kept-versions controls dired's clean-directory (.) command.
  228. We don't want excessive versions piling up, so variables
  229. kept-old-versions , which tells system how many oldest versions to
  230. keep, and kept-new-versions , which tells how many new versions to
  231. keep, are provided. Defaults are 2 old versions and 2 new.
  232. If trim-versions-without-asking is nil, system will query user
  233. before trimming versions. Otherwise it does it silently." (interactive "p") (byte-code "ÃˆÄ … Å>…ÉˆÆ ˆ…# Ç>…#É)‡" [modp args buffer-backed-up nil buffer-modified-p (16 64) basic-save-buffer (4 64)] 4))
  234. (defun delete-auto-save-file-if-necessary nil "\
  235. Delete the auto-save filename for the current buffer (if it has one)
  236. if variable delete-auto-save-files is non-nil." (byte-code "… …ÂÃÄ�ˆÅ ‡" [buffer-auto-save-file-name delete-auto-save-files nil (byte-code "Á!‡" [buffer-auto-save-file-name delete-file] 2) ((file-error (byte-code "À‡" [nil] 1))) set-buffer-auto-saved] 3))
  237. (defun basic-save-buffer nil "\
  238. Save the current buffer in its visited file, if it has been modified." (interactive) (byte-code "ÃˆÏ ƒ ÃÃ
  239. †ÐÑÒ!Ã\"Ó
  240. !‰ˆÔ !ˆÕ
  241. !?…;ÖרÙ
  242. !\"!ƒ8Ɖ‚;ÚÛ!ˆÜp!†RÝ
  243. !?†RÖÞ!†RÚß!ˆ†\\à ‰ˆŒá ˆdâV…�ãdSfä\"…�Æ=†ƒ…ƒÖ×åæ \"!…�Šdbˆäc)ˆ
  244. à   …£ç @!‰ ?…° A‰ ˆ‚•ˆ ?…ú ƒßÆ
  245. èP Ãéê�ˆëŽì ˆíed
  246. ÃÆ%ˆÃ‰ )*‚ú …å?…òî
  247. !‰ˆï
  248. ð\"ˆíed
  249. ÃÆ%*ˆ…Ãñò�)ˆó *‚ôõ!‡" [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 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] 2))) ((byte-code "ƒÄ
  250. Ã#ˆÅ ‚ÆÇÈ�‡" [rename file buffer-file-name t 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))
  251. (defun save-some-buffers (&optional arg exiting) "\
  252. Save some modified file-visiting buffers. Asks user about each one.
  253. With argument, saves all with no questions." (interactive "P") (byte-code "ˈËÌ  …Z @Í
  254. !…PŠ
  255. qˆ †( …( …(Î ÏV…OƉ…O†HÐ ƒBÑÒ \"‚GÑÓÔ \"!…OËÕÖ�))ˆ A‰ˆ‚ˆ…€ …€Æ‰ˆ†uÐÑ×
  256. \"!…{ØË!ˆË‰ ˆƒ‹ÙÚ!‚ŽÙÛ!*‡" [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))
  257. (defun not-modified nil "\
  258. Mark current buffer as unmodified, not needing to be saved." (interactive) (byte-code "ÀˆÁÂ!ˆÃÀ!‡" [nil message "Modification-flag cleared" set-buffer-modified-p] 3))
  259. (defun toggle-read-only nil "\
  260. 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))
  261. (defun insert-file (filename) "\
  262. Insert contents of file FILENAME into buffer after point.
  263. Set mark after the inserted text." (interactive "fInsert file: ") (byte-code "ˆà !Ä`A@\\!)‡" [tem filename nil insert-file-contents push-mark] 4))
  264. (defun append-to-file (start end filename) "\
  265. Append the contents of the region to the end of file FILENAME.
  266. When called from a function, expects three arguments,
  267. START, END and FILENAME. START and END are buffer positions
  268. saying what text to write." (interactive "r
  269. FAppend to file: ") (byte-code "ĈÅ
  270. Ã$‡" [start end filename t nil write-region] 5))
  271. (defvar revert-buffer-function nil "\
  272. Function to use to revert this buffer, or nil to do the default.")
  273. (defun revert-buffer (&optional arg noconfirm) "\
  274. Replace the buffer text with the text of the visited file on disk.
  275. This undoes all changes since the file was visited or saved.
  276. If latest auto-save file is more recent than the visited file,
  277. asks user whether to use that instead.
  278. First argument (optional) non-nil means don't offer to use auto-save file.
  279. This is the prefix arg when called interactively.
  280. Second argument (optional) non-nil means don't ask for confirmation at all.
  281. If revert-buffer-function's value is non-nil, it is called to do the work." (interactive "P") (byte-code "ɈƒÊ
  282. #‚|` ?…#Ë …#Ì !…#ÍÎ! ƒ, ‚.?ƒ<ÏÐ!‚{Ñ!?ƒLÏÒ\"‚{
  283. †WÓÔÕ\"!…{ÉÉ †fÖ ˆ× )ˆØ ?\")ˆ d^bˆÙÉ!+‡" [revert-buffer-function arg noconfirm opoint auto-save-p buffer-auto-save-file-name file-name buffer-file-name buffer-read-only nil 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? " unlock-buffer erase-buffer insert-file-contents after-find-file] 14))
  284. (defun recover-file (file) "\
  285. 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))
  286. (defun kill-some-buffers nil "\
  287. For each buffer, ask whether to kill it." (interactive) (byte-code "ÃˆÄ …B@Å !Æ
  288. Ç\"?…8È
  289. ÉHÊ\"…8ËÌÍ
  290. Î !ƒ/Ï‚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))
  291. (defun auto-save-mode (arg) "\
  292. Toggle auto-saving of contents of current buffer.
  293. 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))
  294. (defun rename-auto-save-file nil "\
  295. Adjust current buffer's auto save file name for current conditions.
  296. Also rename any existing auto save file." (byte-code " Ä ‰ˆ…\" …\"Å
  297. \"?…\"Å \"?…\"Æ!…*Ç Ã#)‡" [osave buffer-auto-save-file-name buffer-file-name t make-auto-save-file-name string= file-exists-p rename-file] 8))
  298. (defun make-auto-save-file-name nil "\
  299. Return file name to use for auto-saves of current buffer.
  300. Does not consider auto-save-visited-file-name; that is checked
  301. before calling this function.
  302. You can redefine this for customization.
  303. 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))
  304. (defun auto-save-file-name-p (filename) "\
  305. Return t if FILENAME can be yielded by make-auto-save-file-name.
  306. FILENAME should lack slashes.
  307. You can redefine this for customization." (byte-code "ÁÂ\"‡" [filename string-match "^#.*#$"] 3))
  308. (defconst list-directory-brief-switches "-CF" "\
  309. *Switches for list-directory to pass to `ls' for brief listing,")
  310. (defconst list-directory-verbose-switches "-l" "\
  311. *Switches for list-directory to pass to `ls' for verbose listing,")
  312. (defun list-directory (dirname &optional verbose) "\
  313. Display a list of files in or matching DIRNAME, a la `ls'.
  314. DIRNAME is globbed by the shell if necessary.
  315. Prefix arg (second arg if noninteractive) means supply -l switch to `ls'.
  316. Actions controlled by variables list-directory-brief-switches
  317. 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))
  318. (defun save-buffers-kill-emacs (&optional arg) "\
  319. Offer to save each buffer, then kill this Emacs fork.
  320. With prefix arg, silently save all file-visiting buffers, then kill." (interactive "P") (byte-code "ˆÃÁ\"ˆÄ ‡" [arg t nil save-some-buffers kill-emacs] 3))
  321. (define-key ctl-x-map "" (quote find-file))
  322. (define-key ctl-x-map "" (quote toggle-read-only))
  323. (define-key ctl-x-map "" (quote find-file-read-only))
  324. (define-key ctl-x-map "" (quote find-alternate-file))
  325. (define-key ctl-x-map "" (quote save-buffer))
  326. (define-key ctl-x-map "s" (quote save-some-buffers))
  327. (define-key ctl-x-map "" (quote write-file))
  328. (define-key ctl-x-map "i" (quote insert-file))
  329. (define-key esc-map "~" (quote not-modified))
  330. (define-key ctl-x-map "" (quote list-directory))
  331. (define-key ctl-x-map "" (quote save-buffers-kill-emacs))
  332. (defvar ctl-x-4-map (make-keymap) "\
  333. Keymap for subcommands of C-x 4")
  334. (fset (quote ctl-x-4-prefix) ctl-x-4-map)
  335. (define-key ctl-x-map "4" (quote ctl-x-4-prefix))
  336. (define-key ctl-x-4-map "f" (quote find-file-other-window))
  337. (define-key ctl-x-4-map "" (quote find-file-other-window))
  338. (define-key ctl-x-4-map "b" (quote switch-to-buffer-other-window))