Tassilo Horn writes: >>> When I open an OpenDocument spreadsheet (file extension ods), by >>> default this happens via doc-view. Then, when I edit the file (say, >>> content.xml) and try to save it, doc-view--revert-buffer bails out >>> with the error (wrong-type-argument stringp nil). >>> >>> If, instead, I open and edit the file as a zip archive without >>> doc-view, I can save it without any problems. >> >> Thanks. >> >> Tassilo, could you please look into this? You actually don't need an ODS document for that error to trigger. A PDF works, too. - Find foo.pdf - C-c C-c to switch to the editing mode - M-x revert-buffer RET ==> bang! The difference with OpenDocuments is that after editing some file inside the archive, the archive buffer will be reverted automatically. The problem is that when switching to the editing mode, the buffer-local value of doc-view--buffer-file-name is killed and so our doc-view--revert-buffer advice function errors when trying to update the cached copy of the document (which only exists if the document is remote or inside some archive). I've added a nil-check there. I think that's ok. Alternatively, we could possibly remove the advice function when switching to the editing mode. Stefan, what do you think? I've also found and fixed another related bug. When switching to the editing mode for an OpenDocument (archive-mode), then editing its contents and saving (causing a revert), doc-view-minor-mode was disabled, i.e., you couldn't C-c C-c back to doc-view-mode. Here's possibly also an alternative: the archive--mode-revert advice function could bind revert-buffer-preserve-modes just as our doc-view--revert-buffer does. But I think my version is better because otherwise we'd need to make all possible editing modes play to doc-view's rules. Stefan, do you think my patch is ok? And Eli, in which version do you want the fix? I think the issue is quite old and as explained above, you will usually only trigger it when editing OpenDocument contents which probably is quite uncommon. Bye, Tassilo