comparison lisp/prim/files.el @ 108:360340f9fd5f r20-1b6

Import from CVS: tag r20-1b6
author cvs
date Mon, 13 Aug 2007 09:18:39 +0200
parents a145efe76779
children fe104dbd9147
comparison
equal deleted inserted replaced
107:523141596bda 108:360340f9fd5f
602 Under XEmacs/Mule, optional second argument specifies the 602 Under XEmacs/Mule, optional second argument specifies the
603 coding system to use when decoding the file. Interactively, 603 coding system to use when decoding the file. Interactively,
604 with a prefix argument, you will be prompted for the coding system." 604 with a prefix argument, you will be prompted for the coding system."
605 (interactive "FFind file in other window: \nZCoding system: ") 605 (interactive "FFind file in other window: \nZCoding system: ")
606 (if codesys 606 (if codesys
607 (let ((overriding-file-coding-system 607 (let ((coding-system-for-read
608 (get-coding-system codesys))) 608 (get-coding-system codesys)))
609 (switch-to-buffer-other-window (find-file-noselect filename))) 609 (switch-to-buffer-other-window (find-file-noselect filename)))
610 (switch-to-buffer-other-window (find-file-noselect filename)))) 610 (switch-to-buffer-other-window (find-file-noselect filename))))
611 611
612 (defun find-file-other-frame (filename &optional codesys) 612 (defun find-file-other-frame (filename &optional codesys)
614 Under XEmacs/Mule, optional second argument specifies the 614 Under XEmacs/Mule, optional second argument specifies the
615 coding system to use when decoding the file. Interactively, 615 coding system to use when decoding the file. Interactively,
616 with a prefix argument, you will be prompted for the coding system." 616 with a prefix argument, you will be prompted for the coding system."
617 (interactive "FFind file in other frame: \nZCoding system: ") 617 (interactive "FFind file in other frame: \nZCoding system: ")
618 (if codesys 618 (if codesys
619 (let ((overriding-file-coding-system 619 (let ((coding-system-for-read
620 (get-coding-system codesys))) 620 (get-coding-system codesys)))
621 (switch-to-buffer-other-frame (find-file-noselect filename))) 621 (switch-to-buffer-other-frame (find-file-noselect filename)))
622 (switch-to-buffer-other-frame (find-file-noselect filename)))) 622 (switch-to-buffer-other-frame (find-file-noselect filename))))
623 623
624 (defun find-file-read-only (filename &optional codesys) 624 (defun find-file-read-only (filename &optional codesys)
628 Under XEmacs/Mule, optional second argument specifies the 628 Under XEmacs/Mule, optional second argument specifies the
629 coding system to use when decoding the file. Interactively, 629 coding system to use when decoding the file. Interactively,
630 with a prefix argument, you will be prompted for the coding system." 630 with a prefix argument, you will be prompted for the coding system."
631 (interactive "fFind file read-only: \nZCoding system: ") 631 (interactive "fFind file read-only: \nZCoding system: ")
632 (if codesys 632 (if codesys
633 (let ((overriding-file-coding-system 633 (let ((coding-system-for-read
634 (get-coding-system codesys))) 634 (get-coding-system codesys)))
635 (find-file filename)) 635 (find-file filename))
636 (find-file filename)) 636 (find-file filename))
637 (setq buffer-read-only t) 637 (setq buffer-read-only t)
638 (current-buffer)) 638 (current-buffer))
644 Under XEmacs/Mule, optional second argument specifies the 644 Under XEmacs/Mule, optional second argument specifies the
645 coding system to use when decoding the file. Interactively, 645 coding system to use when decoding the file. Interactively,
646 with a prefix argument, you will be prompted for the coding system." 646 with a prefix argument, you will be prompted for the coding system."
647 (interactive "fFind file read-only other window: \nZCoding system: ") 647 (interactive "fFind file read-only other window: \nZCoding system: ")
648 (if codesys 648 (if codesys
649 (let ((overriding-file-coding-system 649 (let ((coding-system-for-read
650 (get-coding-system codesys))) 650 (get-coding-system codesys)))
651 (find-file-other-window filename)) 651 (find-file-other-window filename))
652 (find-file-other-window filename)) 652 (find-file-other-window filename))
653 (setq buffer-read-only t) 653 (setq buffer-read-only t)
654 (current-buffer)) 654 (current-buffer))
660 Under XEmacs/Mule, optional second argument specifies the 660 Under XEmacs/Mule, optional second argument specifies the
661 coding system to use when decoding the file. Interactively, 661 coding system to use when decoding the file. Interactively,
662 with a prefix argument, you will be prompted for the coding system." 662 with a prefix argument, you will be prompted for the coding system."
663 (interactive "fFind file read-only other frame: \nZCoding system: ") 663 (interactive "fFind file read-only other frame: \nZCoding system: ")
664 (if codesys 664 (if codesys
665 (let ((overriding-file-coding-system 665 (let ((coding-system-for-read
666 (get-coding-system codesys))) 666 (get-coding-system codesys)))
667 (find-file-other-frame filename)) 667 (find-file-other-frame filename))
668 (find-file-other-frame filename)) 668 (find-file-other-frame filename))
669 (setq buffer-read-only t) 669 (setq buffer-read-only t)
670 (current-buffer)) 670 (current-buffer))
731 (setq buffer-file-truename nil) 731 (setq buffer-file-truename nil)
732 (unwind-protect 732 (unwind-protect
733 (progn 733 (progn
734 (unlock-buffer) 734 (unlock-buffer)
735 (if codesys 735 (if codesys
736 (let ((overriding-file-coding-system 736 (let ((coding-system-for-read
737 (get-coding-system codesys))) 737 (get-coding-system codesys)))
738 (find-file filename)) 738 (find-file filename))
739 (find-file filename))) 739 (find-file filename)))
740 (cond ((eq obuf (current-buffer)) 740 (cond ((eq obuf (current-buffer))
741 (setq buffer-file-name ofile) 741 (setq buffer-file-name ofile)
2303 (if (file-directory-p filename) 2303 (if (file-directory-p filename)
2304 (signal 'file-error (list "Opening input file" "file is a directory" 2304 (signal 'file-error (list "Opening input file" "file is a directory"
2305 filename))) 2305 filename)))
2306 (let ((tem 2306 (let ((tem
2307 (if codesys 2307 (if codesys
2308 (let ((overriding-file-coding-system 2308 (let ((coding-system-for-read
2309 (get-coding-system codesys))) 2309 (get-coding-system codesys)))
2310 (insert-file-contents filename)) 2310 (insert-file-contents filename))
2311 (insert-file-contents filename)))) 2311 (insert-file-contents filename))))
2312 (push-mark (+ (point) (car (cdr tem)))))) 2312 (push-mark (+ (point) (car (cdr tem))))))
2313 2313