diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-07-17 11:16:26 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-07-17 11:16:26 +0200 |
commit | e51850297fdb66e5141dd428cfd04c2005d9b80d (patch) | |
tree | a92511c50849a146ee3e62056d2e4119d8fc86bb | |
parent | dbed53839136ef0e3f283599f51a5cef00343e28 (diff) | |
download | emacs-e51850297fdb66e5141dd428cfd04c2005d9b80d.tar.gz |
Improve error messaging when parent archive buffers are missing
* lisp/arc-mode.el (archive-write-file-member):
* lisp/tar-mode.el (tar-subfile-save-buffer): Give a better error
message when the parent buffer is dead (bug#56605).
-rw-r--r-- | lisp/arc-mode.el | 2 | ||||
-rw-r--r-- | lisp/tar-mode.el | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index c52f2a44322..35189f1bfd8 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -1318,6 +1318,8 @@ NEW-NAME." ;;; Section: IO stuff (defun archive-write-file-member () + (unless (buffer-live-p archive-superior-buffer) + (error "The archive buffer no longer exists; can't save")) (save-excursion (save-restriction (message "Updating archive...") diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index 7b5a869ab57..d7a09789699 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@ -1329,6 +1329,8 @@ to make your changes permanent." (error "This buffer has no superior tar file buffer")) (if (not (and (boundp 'tar-superior-descriptor) tar-superior-descriptor)) (error "This buffer doesn't have an index into its superior tar file!")) + (unless (buffer-live-p tar-superior-buffer) + (error "The tar buffer no longer exists; can't save")) (let ((subfile (current-buffer)) (coding buffer-file-coding-system) (descriptor tar-superior-descriptor) |