comparison lisp/prim/files.el @ 110:fe104dbd9147 r20-1b7

Import from CVS: tag r20-1b7
author cvs
date Mon, 13 Aug 2007 09:19:45 +0200
parents 360340f9fd5f
children 9f59509498e1
comparison
equal deleted inserted replaced
109:e183fc049578 110:fe104dbd9147
30 ;; ITS-id version control, load- and write-hook handling, and the like. 30 ;; ITS-id version control, load- and write-hook handling, and the like.
31 31
32 ;;; Code: 32 ;;; Code:
33 33
34 ;; XEmacs: Avoid compilation warnings. 34 ;; XEmacs: Avoid compilation warnings.
35 (defvar overriding-file-coding-system) 35 (defvar coding-system-for-read)
36 (defvar file-coding-system) 36 (defvar buffer-file-coding-system)
37 37
38 ;; XEmacs: In buffer.c 38 ;; XEmacs: In buffer.c
39 ;(defconst delete-auto-save-files t 39 ;(defconst delete-auto-save-files t
40 ; "*Non-nil means delete auto-save file when a buffer is saved or killed.") 40 ; "*Non-nil means delete auto-save file when a buffer is saved or killed.")
41 41
588 Under XEmacs/Mule, optional second argument specifies the 588 Under XEmacs/Mule, optional second argument specifies the
589 coding system to use when decoding the file. Interactively, 589 coding system to use when decoding the file. Interactively,
590 with a prefix argument, you will be prompted for the coding system." 590 with a prefix argument, you will be prompted for the coding system."
591 (interactive "FFind file: \nZCoding system: ") 591 (interactive "FFind file: \nZCoding system: ")
592 (if codesys 592 (if codesys
593 (let ((overriding-file-coding-system 593 (let ((coding-system-for-read
594 (get-coding-system codesys))) 594 (get-coding-system codesys)))
595 (switch-to-buffer (find-file-noselect filename))) 595 (switch-to-buffer (find-file-noselect filename)))
596 (switch-to-buffer (find-file-noselect filename)))) 596 (switch-to-buffer (find-file-noselect filename))))
597 597
598 (defun find-file-other-window (filename &optional codesys) 598 (defun find-file-other-window (filename &optional codesys)
1687 (error "Canceled"))) 1687 (error "Canceled")))
1688 (set-visited-file-name filename))) 1688 (set-visited-file-name filename)))
1689 (set-buffer-modified-p t) 1689 (set-buffer-modified-p t)
1690 (setq buffer-read-only nil) 1690 (setq buffer-read-only nil)
1691 (if codesys 1691 (if codesys
1692 (let ((file-coding-system (get-coding-system codesys))) 1692 (let ((buffer-file-coding-system (get-coding-system codesys)))
1693 (save-buffer)) 1693 (save-buffer))
1694 (save-buffer))) 1694 (save-buffer)))
1695 1695
1696 (defun backup-buffer () 1696 (defun backup-buffer ()
1697 "Make a backup of the disk file visited by the current buffer, if appropriate. 1697 "Make a backup of the disk file visited by the current buffer, if appropriate.
2319 Under XEmacs/Mule, optional fourth argument specifies the 2319 Under XEmacs/Mule, optional fourth argument specifies the
2320 coding system to use when encoding the file. Interactively, 2320 coding system to use when encoding the file. Interactively,
2321 with a prefix argument, you will be prompted for the coding system." 2321 with a prefix argument, you will be prompted for the coding system."
2322 (interactive "r\nFAppend to file: \nZCoding system: ") 2322 (interactive "r\nFAppend to file: \nZCoding system: ")
2323 (if codesys 2323 (if codesys
2324 (let ((file-coding-system (get-coding-system codesys))) 2324 (let ((buffer-file-coding-system (get-coding-system codesys)))
2325 (write-region start end filename t)) 2325 (write-region start end filename t))
2326 (write-region start end filename t))) 2326 (write-region start end filename t)))
2327 2327
2328 (defun file-newest-backup (filename) 2328 (defun file-newest-backup (filename)
2329 "Return most recent backup file for FILENAME or nil if no backups exist." 2329 "Return most recent backup file for FILENAME or nil if no backups exist."