GNU bug report logs - #76478
30.0.92; doc-view--revert-buffer fails when saving OpenDocument spreadsheets

Previous Next

Package: emacs;

Reported by: Roland Winkler <winkler <at> gnu.org>

Date: Fri, 21 Feb 2025 19:55:01 UTC

Severity: normal

Merged with 75515

Found in version 30.0.92

Fixed in version 31.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 76478 in the body.
You can then email your comments to 76478 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#76478; Package emacs. (Fri, 21 Feb 2025 19:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roland Winkler <winkler <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 21 Feb 2025 19:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Roland Winkler <winkler <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.92; doc-view--revert-buffer fails when saving OpenDocument
 spreadsheets
Date: Fri, 21 Feb 2025 13:53:59 -0600
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.


In GNU Emacs 30.0.92 (build 2, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.16.0) of 2024-11-01 built on regnitz
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76478; Package emacs. (Sat, 22 Feb 2025 06:53:02 GMT) Full text and rfc822 format available.

Message #8 received at 76478 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Roland Winkler <winkler <at> gnu.org>, Tassilo Horn <tsdh <at> gnu.org>
Cc: 76478 <at> debbugs.gnu.org
Subject: Re: bug#76478: 30.0.92;
 doc-view--revert-buffer fails when saving OpenDocument spreadsheets
Date: Sat, 22 Feb 2025 08:52:17 +0200
> From: Roland Winkler <winkler <at> gnu.org>
> Date: Fri, 21 Feb 2025 13:53:59 -0600
> 
> 
> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76478; Package emacs. (Sat, 22 Feb 2025 07:14:02 GMT) Full text and rfc822 format available.

Message #11 received at 76478 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Roland Winkler <winkler <at> gnu.org>, 76478 <at> debbugs.gnu.org
Subject: Re: bug#76478: 30.0.92; doc-view--revert-buffer fails when saving
 OpenDocument spreadsheets
Date: Sat, 22 Feb 2025 08:13:21 +0100
Eli Zaretskii <eliz <at> gnu.org> 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?

Yes, I'll have a look.

Bye,
Tassilo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76478; Package emacs. (Sun, 23 Feb 2025 09:09:01 GMT) Full text and rfc822 format available.

Message #14 received at 76478 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Roland Winkler <winkler <at> gnu.org>, 76478 <at> debbugs.gnu.org
Subject: Re: bug#76478: 30.0.92; doc-view--revert-buffer fails when saving
 OpenDocument spreadsheets
Date: Sun, 23 Feb 2025 10:08:38 +0100
[Message part 1 (text/plain, inline)]
Tassilo Horn <tsdh <at> gnu.org> 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

[0001-doc-view-Fix-error-during-revert-in-editing-mode.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76478; Package emacs. (Sun, 23 Feb 2025 09:13:02 GMT) Full text and rfc822 format available.

Message #17 received at 76478 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: 76478 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, winkler <at> gnu.org
Subject: Re: bug#76478: 30.0.92; doc-view--revert-buffer fails when saving
 OpenDocument spreadsheets
Date: Sun, 23 Feb 2025 11:12:04 +0200
> From: Tassilo Horn <tsdh <at> gnu.org>
> Cc: Roland Winkler <winkler <at> gnu.org>,   76478 <at> debbugs.gnu.org
> Date: Sun, 23 Feb 2025 10:08:38 +0100
> 
> 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.

I think fixing this on master should be okay, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76478; Package emacs. (Sat, 01 Mar 2025 12:33:02 GMT) Full text and rfc822 format available.

Message #20 received at 76478 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: tsdh <at> gnu.org
Cc: winkler <at> gnu.org, monnier <at> iro.umontreal.ca, 76478 <at> debbugs.gnu.org
Subject: Re: bug#76478: 30.0.92;
 doc-view--revert-buffer fails when saving OpenDocument spreadsheets
Date: Sat, 01 Mar 2025 14:32:05 +0200
> Cc: 76478 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, winkler <at> gnu.org
> Date: Sun, 23 Feb 2025 11:12:04 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: Tassilo Horn <tsdh <at> gnu.org>
> > Cc: Roland Winkler <winkler <at> gnu.org>,   76478 <at> debbugs.gnu.org
> > Date: Sun, 23 Feb 2025 10:08:38 +0100
> > 
> > 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.
> 
> I think fixing this on master should be okay, thanks.

Ping!  Tassilo, would you please install your patch?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76478; Package emacs. (Sat, 01 Mar 2025 12:56:02 GMT) Full text and rfc822 format available.

Message #23 received at 76478 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: winkler <at> gnu.org, monnier <at> iro.umontreal.ca, 76478 <at> debbugs.gnu.org
Subject: Re: bug#76478: 30.0.92; doc-view--revert-buffer fails when saving
 OpenDocument spreadsheets
Date: Sat, 01 Mar 2025 13:54:54 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Cc: 76478 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, winkler <at> gnu.org
>> Date: Sun, 23 Feb 2025 11:12:04 +0200
>> From: Eli Zaretskii <eliz <at> gnu.org>
>> 
>> > From: Tassilo Horn <tsdh <at> gnu.org>
>> > Cc: Roland Winkler <winkler <at> gnu.org>,   76478 <at> debbugs.gnu.org
>> > Date: Sun, 23 Feb 2025 10:08:38 +0100
>> > 
>> > 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.
>> 
>> I think fixing this on master should be okay, thanks.
>
> Ping!  Tassilo, would you please install your patch?

Done just now.  Roland, please give it a try.

Bye,
Tassilo




bug Marked as fixed in versions 31.1. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 02 Mar 2025 02:29:01 GMT) Full text and rfc822 format available.

Forcibly Merged 75515 76478. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 02 Mar 2025 07:31:02 GMT) Full text and rfc822 format available.

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 15 Mar 2025 11:13:02 GMT) Full text and rfc822 format available.

Notification sent to Roland Winkler <winkler <at> gnu.org>:
bug acknowledged by developer. (Sat, 15 Mar 2025 11:13:02 GMT) Full text and rfc822 format available.

Message #32 received at 76478-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: 76478-done <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, winkler <at> gnu.org
Subject: Re: bug#76478: 30.0.92; doc-view--revert-buffer fails when saving
 OpenDocument spreadsheets
Date: Sat, 15 Mar 2025 13:12:40 +0200
> From: Tassilo Horn <tsdh <at> gnu.org>
> Cc: 76478 <at> debbugs.gnu.org,   monnier <at> iro.umontreal.ca,   winkler <at> gnu.org
> Date: Sat, 01 Mar 2025 13:54:54 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> Cc: 76478 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, winkler <at> gnu.org
> >> Date: Sun, 23 Feb 2025 11:12:04 +0200
> >> From: Eli Zaretskii <eliz <at> gnu.org>
> >> 
> >> > From: Tassilo Horn <tsdh <at> gnu.org>
> >> > Cc: Roland Winkler <winkler <at> gnu.org>,   76478 <at> debbugs.gnu.org
> >> > Date: Sun, 23 Feb 2025 10:08:38 +0100
> >> > 
> >> > 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.
> >> 
> >> I think fixing this on master should be okay, thanks.
> >
> > Ping!  Tassilo, would you please install your patch?
> 
> Done just now.  Roland, please give it a try.

No further comments within 2 weeks, so I presume the bug was indeed
solved, and I'm therefore closing it.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 15 Mar 2025 11:13:02 GMT) Full text and rfc822 format available.

Notification sent to Benjamin Riefenstahl <b.riefenstahl <at> turtle-trading.net>:
bug acknowledged by developer. (Sat, 15 Mar 2025 11:13:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 12 Apr 2025 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 85 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.