unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: bug#2137: 23.0.60; Saving Rmail buffer does not show the "Saving file ..." message
       [not found] <uab97e1c0.fsf@gnu.org>
@ 2009-02-01 22:48 ` Richard M Stallman
  2009-02-02  1:35   ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Richard M Stallman @ 2009-02-01 22:48 UTC (permalink / raw)
  To: Eli Zaretskii, 2137; +Cc: emacs-devel

    In an Rmail buffer, type "C-x C-s" to save it: you will almost never
    see the usual "Saving file FOO..." message, because buffer-soze,
    called by save-buffer, returns the size of the current message, not of
    the entire message collection.

The clean way to fix this is with something like `buffer-swapped-with'.

I did not remember the existence of this feature when I recommended
implementing `buffer-swapped-with', so I can't really say "I told you
so."  But there is a general tendency that these sorts of features
need to be checked and acted on in various places in the code, and
most of them don't have any hooks.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bug#2137: 23.0.60; Saving Rmail buffer does not show the "Saving file ..." message
  2009-02-01 22:48 ` bug#2137: 23.0.60; Saving Rmail buffer does not show the "Saving file ..." message Richard M Stallman
@ 2009-02-02  1:35   ` Stefan Monnier
  2009-02-02 21:05     ` Eli Zaretskii
  2009-02-03  9:59     ` Richard M Stallman
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Monnier @ 2009-02-02  1:35 UTC (permalink / raw)
  To: rms; +Cc: Eli Zaretskii, 2137, emacs-devel

>     In an Rmail buffer, type "C-x C-s" to save it: you will almost never
>     see the usual "Saving file FOO..." message, because buffer-soze,
>     called by save-buffer, returns the size of the current message, not of
>     the entire message collection.

> The clean way to fix this is with something like `buffer-swapped-with'.

> I did not remember the existence of this feature when I recommended
> implementing `buffer-swapped-with', so I can't really say "I told you
> so."  But there is a general tendency that these sorts of features
> need to be checked and acted on in various places in the code, and
> most of them don't have any hooks.

This problem at least simply points to a current bug in save-buffer.
Maybe with buffer-swapped-with you could work around the bug rather than
fixing it.  Or even fail to see that it's a general bug rather than
a problem with buffer-swapped-with.  I'm not sure it's a benefit.


        Stefan




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bug#2137: 23.0.60; Saving Rmail buffer does not show the "Saving file ..." message
  2009-02-02  1:35   ` Stefan Monnier
@ 2009-02-02 21:05     ` Eli Zaretskii
  2009-02-03 21:29       ` Stefan Monnier
  2009-02-03  9:59     ` Richard M Stallman
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2009-02-02 21:05 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel, rms, 2137

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Eli Zaretskii <eliz@gnu.org>,  2137@emacsbugs.donarmstrong.com,  emacs-devel@gnu.org
> Date: Sun, 01 Feb 2009 20:35:12 -0500
> 
> This problem at least simply points to a current bug in save-buffer.

Which bug is that?




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bug#2137: 23.0.60; Saving Rmail buffer does not show the "Saving file ..." message
  2009-02-02  1:35   ` Stefan Monnier
  2009-02-02 21:05     ` Eli Zaretskii
@ 2009-02-03  9:59     ` Richard M Stallman
  1 sibling, 0 replies; 7+ messages in thread
From: Richard M Stallman @ 2009-02-03  9:59 UTC (permalink / raw)
  To: Stefan Monnier, 2137; +Cc: eliz, 2137, emacs-devel

    This problem at least simply points to a current bug in save-buffer.

It is a bug, for certain.  What I'm saying is that it is easy to fix
with something like `buffer-swapped-with', and hard to fix otherwise.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bug#2137: 23.0.60; Saving Rmail buffer does not show the "Saving file ..." message
  2009-02-02 21:05     ` Eli Zaretskii
@ 2009-02-03 21:29       ` Stefan Monnier
  2009-02-04  4:16         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2009-02-03 21:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, rms, 2137

>> This problem at least simply points to a current bug in save-buffer.
> Which bug is that?

The bug is that is uses buffer-size to determine the size of the file,
without taking into account the fact that
write-region-annotate-functions can add lot of stuff to the file that's
not in the buffer's text.

The simplest fix is to simply always output the message rather than only
for files larger than 50KB.
The more difficult one is to move the message from save-buffer to
write-region.


        Stefan




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bug#2137: 23.0.60; Saving Rmail buffer does not show the "Saving file ..." message
  2009-02-03 21:29       ` Stefan Monnier
@ 2009-02-04  4:16         ` Eli Zaretskii
  2009-02-04 19:46           ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2009-02-04  4:16 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel, rms, 2137

> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Cc: rms@gnu.org, 2137@emacsbugs.donarmstrong.com, emacs-devel@gnu.org
> Date: Tue, 03 Feb 2009 16:29:08 -0500
> 
> >> This problem at least simply points to a current bug in save-buffer.
> > Which bug is that?
> 
> The bug is that is uses buffer-size to determine the size of the file,
> without taking into account the fact that
> write-region-annotate-functions can add lot of stuff to the file that's
> not in the buffer's text.

How can buffer-size take that into account?  The correct full size of
what's written to the disk file is never seen, since write-region does
its job piecemeal, and the annotations are applied separately to each
piece by a_write.

Am I missing something?

> The simplest fix is to simply always output the message rather than only
> for files larger than 50KB.

That may be the only (non-kludgey) solution.

> The more difficult one is to move the message from save-buffer to
> write-region.

If I'm right above, this won't solve the case where annotations add a
lot.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bug#2137: 23.0.60; Saving Rmail buffer does not show the "Saving file ..." message
  2009-02-04  4:16         ` Eli Zaretskii
@ 2009-02-04 19:46           ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2009-02-04 19:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, rms, 2137

>> The bug is that is uses buffer-size to determine the size of the file,
>> without taking into account the fact that
>> write-region-annotate-functions can add lot of stuff to the file that's
>> not in the buffer's text.
> How can buffer-size take that into account?

It can't.  Luckily we don't have to use buffer-size for that.

> The correct full size of what's written to the disk file is never
> seen, since write-region does its job piecemeal, and the annotations
> are applied separately to each piece by a_write.

Indeed.

> Am I missing something?

We do have all the annotations in a single place, so we can compute the
final total size before we start writing.

>> The simplest fix is to simply always output the message rather than only
>> for files larger than 50KB.
> That may be the only (non-kludgey) solution.

Yes, I find it to be the best solution.  I see no benefit in avoiding
the message for smaller files.


        Stefan




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-02-04 19:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <uab97e1c0.fsf@gnu.org>
2009-02-01 22:48 ` bug#2137: 23.0.60; Saving Rmail buffer does not show the "Saving file ..." message Richard M Stallman
2009-02-02  1:35   ` Stefan Monnier
2009-02-02 21:05     ` Eli Zaretskii
2009-02-03 21:29       ` Stefan Monnier
2009-02-04  4:16         ` Eli Zaretskii
2009-02-04 19:46           ` Stefan Monnier
2009-02-03  9:59     ` Richard M Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).