Mercurial > emacs
comparison lisp/tar-mode.el @ 14769:acf049402d18
(tar-subfile-mode): Doc fix.
(tar-extract): Call tar-subfile-mode after setting buffer-read-only
and the buffer modified flag.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 06 Mar 1996 07:49:55 +0000 |
parents | f8eba77ccb7f |
children | 85a85480fa3c |
comparison
equal
deleted
inserted
replaced
14768:ba3525471dae | 14769:acf049402d18 |
---|---|
600 ) | 600 ) |
601 | 601 |
602 | 602 |
603 (defun tar-subfile-mode (p) | 603 (defun tar-subfile-mode (p) |
604 "Minor mode for editing an element of a tar-file. | 604 "Minor mode for editing an element of a tar-file. |
605 This mode redefines the save-buffer command to save the current buffer back | 605 This mode arranges for \"saving\" this buffer to write the data |
606 into its associated tar-file buffer. You must save that buffer to actually | 606 into the tar-file buffer that it came from. The changes will actually |
607 save your changes to disk." | 607 appear on disk when you save the tar-file's buffer." |
608 (interactive "P") | 608 (interactive "P") |
609 (or (and (boundp 'tar-superior-buffer) tar-superior-buffer) | 609 (or (and (boundp 'tar-superior-buffer) tar-superior-buffer) |
610 (error "This buffer is not an element of a tar file")) | 610 (error "This buffer is not an element of a tar file")) |
611 ;;; Don't do this, because it is redundant and wastes mode line space. | 611 ;;; Don't do this, because it is redundant and wastes mode line space. |
612 ;;; (or (assq 'tar-subfile-mode minor-mode-alist) | 612 ;;; (or (assq 'tar-subfile-mode minor-mode-alist) |
729 (rename-buffer bufname) | 729 (rename-buffer bufname) |
730 (make-local-variable 'tar-superior-buffer) | 730 (make-local-variable 'tar-superior-buffer) |
731 (make-local-variable 'tar-superior-descriptor) | 731 (make-local-variable 'tar-superior-descriptor) |
732 (setq tar-superior-buffer tar-buffer) | 732 (setq tar-superior-buffer tar-buffer) |
733 (setq tar-superior-descriptor descriptor) | 733 (setq tar-superior-descriptor descriptor) |
734 (tar-subfile-mode 1) | 734 (setq buffer-read-only read-only-p) |
735 (setq buffer-read-only read-only-p) | 735 (set-buffer-modified-p nil) |
736 (set-buffer-modified-p nil)) | 736 (tar-subfile-mode 1)) |
737 (set-buffer tar-buffer)) | 737 (set-buffer tar-buffer)) |
738 (narrow-to-region 1 tar-header-offset))) | 738 (narrow-to-region 1 tar-header-offset))) |
739 (if view-p | 739 (if view-p |
740 (progn | 740 (progn |
741 (view-buffer buffer) | 741 (view-buffer buffer) |