Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
3006c8dc
Commit
3006c8dc
authored
Jan 07, 2009
by
Stefan Monnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(tar-mode, tar-mode-write-contents)
(tar-write-region-annotate): Undo Andreas's last change.
parent
41ec3f54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/tar-mode.el
lisp/tar-mode.el
+12
-12
No files found.
lisp/ChangeLog
View file @
3006c8dc
2009-01-07 Stefan Monnier <monnier@iro.umontreal.ca>
* tar-mode.el (tar-mode, tar-mode-write-contents)
(tar-write-region-annotate): Undo Andreas's last change.
2009-01-06 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-do-copy-or-rename-file-directly)
...
...
lisp/tar-mode.el
View file @
3006c8dc
...
...
@@ -637,7 +637,10 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
;; buffer for the summary.
(
assert
(
not
(
tar-data-swapped-p
)))
(
set
(
make-local-variable
'revert-buffer-function
)
'tar-mode-revert
)
(
add-hook
'write-contents-functions
'tar-mode-write-contents
nil
t
)
;; We started using write-contents-functions, but this hook is not
;; used during auto-save, so we now use
;; write-region-annotate-functions which hooks at a lower-level.
(
add-hook
'write-region-annotate-functions
'tar-write-region-annotate
nil
t
)
(
add-hook
'kill-buffer-hook
'tar-mode-kill-buffer-hook
nil
t
)
(
add-hook
'change-major-mode-hook
'tar-change-major-mode-hook
nil
t
)
;; Tar data is made of bytes, not chars.
...
...
@@ -1213,18 +1216,15 @@ Leaves the region wide."
(
insert
(
make-string
(
-
goal-end
(
point-max
))
?\0
))))))))
;; Used in write-contents-functions to write tar-files out correctly.
(
defun
tar-mode-write-contents
()
(
save-excursion
(
unwind-protect
(
progn
(
when
(
tar-data-swapped-p
)
(
tar-swap-data
))
(
write-region
nil
nil
buffer-file-name
nil
t
))
(
unless
(
tar-data-swapped-p
)
(
tar-swap-data
))))
;; Used in write-region-annotate-functions to write tar-files out correctly.
(
defun
tar-write-region-annotate
(
start
end
)
;; When called from write-file (and auto-save), `start' is nil.
;; When called from M-x write-region, we assume the user wants to save
;; (part of) the summary, not the tar data.
(
unless
(
or
start
(
not
(
tar-data-swapped-p
)))
(
tar-clear-modification-flags
)
(
set-buffer-modified-p
nil
)
;; Return t because we've written the file.
t
)
(
set-buffer
tar-data-buffer
)
nil
))
(
provide
'tar-mode
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment