• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:other +defs:file

11 ;; This file is part of GNU Emacs.
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
31 ;; When this code is loaded, visiting a file whose name ends in '.tar' will
32 ;; cause the contents of that archive file to be displayed in a Dired-like
36 ;; It is also possible to delete sub-files from within the tar file and write
56 ;; o It's not possible to add a NEW file to a tar archive; not that
67 ;; o Sometimes (but not always) reverting the tar-file buffer does not
73 ;; write-file-hook actually writes the file. Instead it should remove the
74 ;; header (and conspire to put it back afterwards) so that other write-file
76 ;; might be a problem if the tar write-file-hook does not come *first* on
84 ;; Why does tar-mode edit the file itself instead of using tar?
90 ;; can't replace a file in the middle of a tar file with a new version.
92 ;; An implementation which involved unpacking and repacking the file into
94 ;; preserve the file owners.
105 The blocksize of a tar file is not really the size of the blocks; rather, it is
107 this is the size of the *tape* blocks, but when writing to a file, it doesn't
108 matter much. The only noticeable difference is that if a tar file does not
110 how many null padding bytes go on the end of the tar file."
115 "Non-nil means Tar mode should play fast and loose with sub-file datestamps.
116 If this is true, then editing and saving a tar file entry back into its
117 tar file will update its datestamp. If false, the datestamp is unchanged.
118 You may or may not want this - it is good in that you can tell when a file
120 editing a file in the tar archive at all is bad - the changed version of
121 the file never exists on disk."
127 This information is useful, but it takes screen space away from file names."
237 (or file-name-coding-system
238 default-file-name-coding-system
242 (or file-name-coding-system
243 default-file-name-coding-system
318 (defun tar-header-block-check-checksum (hblock desired-checksum file-name)
321 (progn (beep) (message "Invalid checksum for file %s!" file-name))))
327 (defun tar-grind-file-mode (mode)
329 MODE should be an integer which is a file mode value."
370 (tar-grind-file-mode mode)
377 'help-echo "mouse-2: extract this file into a buffer")
383 "Extract all archive members in the tar-file into the current directory."
393 (dir (file-name-directory name))
397 (unless (file-directory-p name)
399 (if (and dir (not (file-exists-p dir)))
401 (unless (file-directory-p name)
403 (set-file-modes name (tar-header-mode tokens))))))
407 "Parse the contents of the tar file in the current buffer.
416 (make-progress-reporter "Parsing tar file..."
449 ;; A tar file should end with a block or two of nulls,
453 (message "Warning: premature EOF parsing tar file")))
488 (define-key map "o" 'tar-extract-other-window)
498 (define-key map "E" 'tar-extract-other-window)
514 '("Display in Other Window" . tar-display-other-window))
515 (define-key map [menu-bar immediate find-file-other-window]
516 '("Find in Other Window" . tar-extract-other-window))
517 (define-key map [menu-bar immediate find-file]
557 "Major mode for viewing a tar file as a dired-like listing of its contents.
560 Type `e' to pull a file out of the tar file and into its own buffer;
561 or click mouse-2 on the file's line in the Tar mode buffer.
562 Type `c' to copy an entry from the tar file into another file on disk.
564 If you edit a sub-file of this archive (as with the `e' command) and
566 saved back into the tar-file buffer; in this way you can edit a file
581 ;; Prevent loss of data when saving the file.
582 (set (make-local-variable 'file-precious-flag) t)
584 (set (make-local-variable 'write-contents-functions) '(tar-mode-write-file))
594 "Minor mode for editing an element of a tar-file.
596 into the tar-file buffer that it came from. The changes will actually
597 appear on disk when you save the tar-file's buffer."
600 (error "This buffer is not an element of a tar file"))
611 (add-hook 'write-file-functions 'tar-subfile-save-buffer nil t)
614 (setq buffer-auto-save-file-name nil)
617 (remove-hook 'write-file-functions 'tar-subfile-save-buffer t))))
656 (error "This line does not describe a tar-file entry"))))
664 (error "This is a %s, not a real file"
672 (if (zerop size) (error "This is a zero-length file"))
676 "Extract a file whose tar directory line you click on."
688 (defun tar-file-name-handler (op &rest args)
690 (or (eq op 'file-exists-p)
691 (let ((file-name-handler-alist nil))
694 (defun tar-extract (&optional other-window-p)
695 "In Tar mode, extract this entry of the tar file into its own buffer."
697 (let* ((view-p (eq other-window-p 'view))
708 (bufname (concat (file-name-nondirectory name)
713 (new-buffer-file-name (expand-file-name
716 (buffer (get-file-buffer new-buffer-file-name))
737 (setq buffer-file-name new-buffer-file-name)
738 (setq buffer-file-truename
739 (abbreviate-file-name buffer-file-name))
740 ;; We need to mimic the parts of insert-file-contents
749 ;; find-buffer-file-type-coding-system
751 ;; the file being extracted existed, so
752 ;; that the file's contents' encoding and
754 (let ((file-name-handler-alist
756 '(("" . tar-file-name-handler))
757 file-name-handler-alist)))
759 'insert-file-contents
772 (find-new-buffer-file-coding-system detected)))
781 ;; Force buffer-file-coding-system to what
783 (set-buffer-file-coding-system last-coding-system-used t))
804 (if (eq other-window-p 'display)
806 (if other-window-p
807 (switch-to-buffer-other-window buffer)
811 (defun tar-extract-other-window ()
812 "In Tar mode, find this entry of the tar file in another window."
816 (defun tar-display-other-window ()
817 "In Tar mode, display this entry of the tar file in another window."
822 "In Tar mode, view the tar file entry on this line."
827 (defun tar-read-file-name (&optional prompt)
828 "Read a file name with this line's entry as the default."
830 (let* ((default-file (expand-file-name
833 (target (expand-file-name
834 (read-file-name prompt
835 (file-name-directory default-file)
836 default-file nil))))
837 (if (or (string= "" (file-name-nondirectory target))
838 (file-directory-p target))
843 (file-name-nondirectory default-file))))
847 (defun tar-copy (&optional to-file)
848 "In Tar mode, extract this entry of the tar file into a file on disk.
851 (interactive (list (tar-read-file-name)))
860 (inhibit-file-name-handlers inhibit-file-name-handlers)
861 (inhibit-file-name-operation inhibit-file-name-operation))
865 ;; to-file are handled by jka-compr
866 (if (and (eq (find-file-name-handler name 'write-region) 'jka-compr-handler)
867 (eq (find-file-name-handler to-file 'write-region) 'jka-compr-handler))
868 (setq inhibit-file-name-handlers
870 (and (eq inhibit-file-name-operation 'write-region)
871 inhibit-file-name-handlers))
872 inhibit-file-name-operation 'write-region))
876 (write-region start end to-file nil nil nil t))
878 (message "Copied tar entry %s to %s" name to-file)))
881 "In Tar mode, mark this sub-file to be deleted from the tar file.
894 "In Tar mode, un-mark this sub-file if it is marked to be deleted.
900 "In Tar mode, un-mark this sub-file if it is marked to be deleted.
930 ;; delete the data from inside the file...
940 ;; the next file to be deleted.
951 This does not modify the disk image; you must save the tar file itself
989 "Change the user-id associated with this entry in the tar file.
990 If this tar file was written by GNU tar, then you will be able to edit
993 This does not modify the disk image; you must save the tar file itself
1017 "Change the group-id associated with this entry in the tar file.
1018 If this tar file was written by GNU tar, then you will be able to edit
1021 This does not modify the disk image; you must save the tar file itself
1045 "Change the name associated with this entry in the tar file.
1046 This does not modify the disk image; you must save the tar file itself
1057 (or file-name-coding-system
1058 default-file-name-coding-system))))
1064 "Change the protection bits associated with this entry in the tar file.
1065 This does not modify the disk image; you must save the tar file itself
1132 "In tar subfile mode, save this buffer into its parent tar-file buffer.
1133 This doesn't write anything to disk; you must save the parent tar-file buffer
1137 (error "This buffer has no superior tar file buffer"))
1139 (error "This buffer doesn't have an index into its superior tar file!"))
1143 (coding buffer-file-coding-system)
1160 (error "Can't find this tar file entry in its parent tar file!"))
1235 (set-buffer-modified-p t) ; mark the tar file as modified
1244 (setq last-coding-system-used buffer-file-coding-system)
1251 "If we are being anal about tar file blocksizes, fix up the current buffer.
1276 ;; Used in write-file-hook to write tar-files out correctly.
1277 (defun tar-mode-write-file ()
1291 buffer-file-name nil t))
1295 ;; Return t because we've written the file.