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

Lines Matching +defs:copy +defs:file

10 ;; This file is part of GNU Emacs.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
42 ;; copy. When you make changes to a remote file the
52 ;; problem that 19.29's file formats may fix.
77 ;; ARC A series of (header,file). No interactions among members.
79 ;; LZH A series of (header,file). Headers are checksummed. No
94 ;; ZOO An archive header followed by a series of (header,file).
133 (expand-file-name (if (eq system-type 'ms-dos) "ar" "archive.tmp")
134 temporary-file-directory))
141 A non-local file is one whose file name is not proper outside Emacs.
142 A local copy of the archive will be used when updating."
153 ;; We always go via a local file since there seems to be no reliable way
157 "*Program and its options to run in order to extract an arc file member.
168 "*Program and its options to run in order to delete arc file members.
176 (defcustom archive-arc-write-file-member
178 "*Program and its options to run in order to update an arc file member.
190 "*Program and its options to run in order to extract an lzh file member.
201 "*Program and its options to run in order to delete lzh file members.
209 (defcustom archive-lzh-write-file-member
211 "*Program and its options to run in order to update an lzh file member.
226 "*Program and its options to run in order to extract a zip file member.
237 ;; existent. (3) It tends to do funny things with other systems' file
245 "*Program and its options to run in order to delete zip file members.
258 "*Program and its options to run in order to update a zip file member.
260 file. Archive and member name will be added."
273 Options should ensure that specified directory will be put into the zip file.
282 "*If non-nil then zip file members may be down-cased.
284 that uses caseless file names."
292 "*Program and its options to run in order to extract a zoo file member.
303 "*Program and its options to run in order to delete zoo file members.
311 (defcustom archive-zoo-write-file-member
313 "*Program and its options to run in order to update a zoo file member.
324 (defvar archive-file-list-start nil "Position of first contents line.")
325 (defvar archive-file-list-end nil "Position just after last contents line.")
326 (defvar archive-proper-file-start nil "Position of real archive's start.")
328 (defvar archive-local-name nil "Name of local copy of remote archive.")
334 ;;(define-key map "c" 'archive-copy)
380 :help "Toggle alternate file info display"))
383 :help "Display file at cursor in View Mode"))
386 :help "Display file at cursor in another window"))
387 (define-key map [menu-bar immediate find-file-other-window]
389 :help "Edit file at cursor in another window"))
390 (define-key map [menu-bar immediate find-file]
392 :help "Extract file at cursor and edit it"))
401 :help "Flag file at cursor for deletion"))
404 :help "Unmark file at cursor"))
407 :help "Mark file at cursor"))
427 ;;(define-key map [menu-bar operate copy]
428 ;; '(menu-item "Copy to..." archive-copy))
434 (defvar archive-file-name-indent nil "Column where file names start.")
436 (defvar archive-remote nil "Non-nil if the archive is outside file system.")
456 "Vector of file descriptors.
486 ;; FIXME: merge with tar-grind-file-mode.
506 "From the integer OLDMODE and the string NEWMODE calculate a new file mode.
586 (if (>= (point) archive-file-list-start)
587 (count-lines archive-file-list-start
592 "Return the descriptor vector for file at point.
595 (if (and (>= (point) archive-file-list-start)
609 "Major mode for viewing an archive file in a dired-like way.
612 Type `e' to pull a file out of the archive and into its own buffer;
613 or click mouse-2 on the file's line in the archive mode buffer.
615 If you edit a sub-file of this archive (as with the `e' command) and
632 ;; Buffer contains treated image of file before the file contents
639 (add-hook 'write-contents-functions 'archive-write-file nil t))
646 ;; Prevent loss of data when saving the file.
647 (make-local-variable 'file-precious-flag)
648 (setq file-precious-flag t)
654 (or (not (file-writable-p (buffer-file-name)))
656 (string-match file-name-invalid-regexp
659 ;; Should we use a local copy when accessing from outside Emacs?
666 (or (string-match archive-remote-regexp (buffer-file-name))
667 (string-match file-name-invalid-regexp
668 (buffer-file-name)))))
676 (make-local-variable 'archive-proper-file-start)
677 (make-local-variable 'archive-file-list-start)
678 (make-local-variable 'archive-file-list-end)
679 (make-local-variable 'archive-file-name-indent)
693 ;; The funny [] here make it unlikely that the .elc file will be treated
701 (or buffer-file-name (buffer-name))))
703 ;; This pattern modelled on the BSD/GNU+Linux `file' command.
704 ;; Have seen capital "LHA's", and file has lower case "LHa's" too.
710 "Parse the contents of the archive file in the current buffer.
720 (message "Parsing archive file..."))
724 (message "Parsing archive file...done."))
725 (setq archive-proper-file-start (point-marker))
729 (goto-char archive-file-list-start)
738 (delete-region (point-min) archive-proper-file-start)
741 (goto-char archive-file-list-start)
746 (setq archive-file-list-start (point-marker))
747 (setq archive-file-name-indent (if files (aref (car files) 1) 0))
763 help-echo "mouse-2: extract this file into a buffer")
767 (setq archive-file-list-end (point-marker)))
777 ;; Section: Local archive copy handling
780 "Make sure a file FNAME can be created uniquely in directory DIR.
784 file by that name already exists in DIR, a unique new name is generated
785 using `make-temp-file', and the generated name is returned."
786 (let ((fullname (expand-file-name fname dir))
787 (alien (string-match file-name-invalid-regexp fname)))
788 (if (or alien (file-exists-p fullname))
789 (make-temp-file
790 (expand-file-name
791 (if (if (fboundp 'msdos-long-file-names)
792 (not (msdos-long-file-names)))
798 (defun archive-maybe-copy (archive)
816 (make-directory (file-name-directory archive-local-name) t)
834 (insert-file-contents name)
836 (goto-char archive-file-list-start)
846 "Delete file NAME and its parents up to and including `archive-tmpdir'."
848 (top (directory-file-name (file-name-as-directory archive-tmpdir))))
850 (delete-file name)
853 (setq name (directory-file-name (file-name-directory name)))
861 (defun archive-file-name-handler (op &rest args)
862 (or (eq op 'file-exists-p)
863 (let ((file-name-handler-alist nil))
866 (defun archive-set-buffer-as-visiting-file (filename)
878 ;; find-buffer-file-type-coding-system for DOS/Windows
880 ;; (That function is called via file-coding-system-alist.)
881 ;; Here, we want it to act as if the extracted file existed.
882 ;; The following let-binding of file-name-handler-alist forces
883 ;; find-file-not-found-set-buffer-file-coding-system to ignore
884 ;; the file's name (see dos-w32.el).
885 (let ((file-name-handler-alist
886 '(("" . archive-file-name-handler))))
888 'insert-file-contents
899 (kill-local-variable 'buffer-file-coding-system)
900 (after-insert-file-set-coding (- (point-max) (point-min))))))
914 (archive (buffer-file-name))
915 (arcname (file-name-nondirectory archive))
916 (bufname (concat (file-name-nondirectory iname) " (" arcname ")"))
918 ;; Members with file names which aren't valid for the
922 (string-match file-name-invalid-regexp ename)))
923 (arcfilename (expand-file-name (concat arcname ":" iname)))
927 (string= (buffer-file-name buffer) arcfilename))
929 (setq archive (archive-maybe-copy archive))
934 (setq buffer-file-name arcfilename)
935 (setq buffer-file-truename
936 (abbreviate-file-name buffer-file-name))
941 (add-hook 'write-file-functions 'archive-write-file-member nil t)
945 (let (;; We may have to encode file name arguement for
949 file-name-coding-system))
952 ;; archive-set-buffer-as-visiting-file later.
966 (archive-set-buffer-as-visiting-file ename)
980 (remove-hook 'write-contents-functions 'archive-write-file t))
993 (let* ((default-directory (file-name-as-directory archive-tmpdir))
994 (tmpfile (expand-file-name (file-name-nondirectory name)
997 (make-directory (directory-file-name default-directory) t)
1006 (if (not (file-exists-p tmpfile))
1007 (ding (message "`%s': no such file or directory" tmpfile))
1008 (insert-file-contents tmpfile)
1059 (if buffer-file-name
1060 (file-name-nondirectory buffer-file-name)
1076 (funcall func buffer-file-name membuf name))
1081 (defun archive-write-file-member ()
1087 (archive-name "write-file-member")))
1089 (archive-maybe-copy (buffer-file-name)))))
1092 (archive-*-write-file-member archive
1105 (defun archive-*-write-file-member (archive descr command)
1107 (tmpfile (expand-file-name ename archive-tmpdir))
1108 (top (directory-file-name (file-name-as-directory archive-tmpdir)))
1109 (default-directory (file-name-as-directory top)))
1112 (make-directory (file-name-directory tmpfile) t)
1116 (archive-write-file tmpfile)
1119 ;; the value used to write the file, so save it before any
1121 ;; archive-write-file-member, above).
1124 ;; Set the file modes, but make sure we can read it.
1125 (set-file-modes tmpfile (logior ?\400 (aref descr 3))))
1128 (encode-coding-string ename file-name-coding-system)))
1140 (defun archive-write-file (&optional file)
1143 (write-region archive-proper-file-start (point-max)
1144 (or file buffer-file-name) nil t)
1187 (goto-char archive-file-list-start)
1188 (while (< (point) archive-file-list-end)
1204 (goto-char archive-file-list-start)
1205 (while (< (point) archive-file-list-end)
1219 (forward-char archive-file-name-indent)))
1265 (goto-char archive-file-list-start)
1266 (while (< (point) archive-file-list-end)
1278 (let ((archive (archive-maybe-copy (buffer-file-name)))
1297 "Change the name associated with this entry in the archive file."
1308 (encode-coding-string newname file-name-coding-system)
1323 (goto-char archive-file-list-start)
1380 (format " %8.0f %d file%s"
1399 (goto-char (+ archive-proper-file-start (aref descr 4) 2))
1415 (csize (archive-l-e (+ p 7) 4 'float)) ;size of a compressed file to follow (level 0 and 2),
1416 ;size of extended headers + the compressed file to follow (level 1).
1417 (ucsize (archive-l-e (+ p 11) 4 'float)) ;size of an uncompressed file.
1430 (if file-name-coding-system
1431 (decode-coding-string str file-name-coding-system)
1443 ((= etype 1) ;file name
1458 ((= etype 80) ;Unix file permission
1460 ((= etype 81) ;UNIX file group/user ID
1463 ((= etype 82) ;UNIX file group name
1468 ((= etype 83) ;UNIX file user name
1547 " %8.0f %d file%s"
1548 " %8.0f %d file%s")))
1577 (let* ((p (+ archive-proper-file-start (aref descr 4)))
1584 (error "The file name is too long"))
1598 (let* ((p (+ archive-proper-file-start (aref fil 4)))
1679 (if file-name-coding-system
1680 (decode-coding-string str file-name-coding-system)
1683 (string= (file-name-nondirectory efnname) "")))
1725 (format " %8.0f %d file%s"
1737 (defun archive-zip-write-file-member (archive descr)
1738 (archive-*-write-file-member
1749 (let* ((p (+ archive-proper-file-start (car (aref fil 4))))
1798 (if file-name-coding-system
1799 (decode-coding-string str file-name-coding-system)
1826 (format " %8.0f %d file%s"