From: Chong Yidong <cyd@stupidchicken.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Upcoming 23.1 release
Date: Mon, 20 Jul 2009 14:51:21 -0400 [thread overview]
Message-ID: <87ljmjchna.fsf@stupidchicken.com> (raw)
In-Reply-To: <83vdlnnqhv.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Jul 2009 21:44:44 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
> In Emacs 22.3, if one turns on auto-save in the Rmail buffer, would
> Emacs DTRT? If so, I'd suggest to try to fix this before the
> release. If it didn't DTRT in Emacs 22.3, I'm okay with postponing
> the fix.
>
> How complex is the fix proposed by Richard, and why do you think
> installing it on could destabilize the branch? Can you show the diffs
> here?
The fix proposed by Richard involves changing an undocumented behavior
of buffer-saved-size. Previously, the documentation said that a value
of -1 has a certain behavior, but actully any negative number does the
same thing as -1; this patch changes things to treat -2 specially. We
can't install this without a significant amount of testing to see if
this breaks anything.
*** fileio.c 7 Jul 2009 22:52:59 -0000 1.655
--- fileio.c 16 Jul 2009 01:45:11 -0000 1.656
***************
*** 4492,4498 ****
if (visiting)
{
SAVE_MODIFF = MODIFF;
! XSETFASTINT (current_buffer->save_length, Z - BEG);
current_buffer->filename = visit_file;
}
UNGCPRO;
--- 4492,4499 ----
if (visiting)
{
SAVE_MODIFF = MODIFF;
! if (XINT (current_buffer->save_length) != -2)
! XSETFASTINT (current_buffer->save_length, Z - BEG);
current_buffer->filename = visit_file;
}
UNGCPRO;
***************
*** 4703,4709 ****
if (visiting)
{
SAVE_MODIFF = MODIFF;
! XSETFASTINT (current_buffer->save_length, Z - BEG);
current_buffer->filename = visit_file;
update_mode_lines++;
}
--- 4704,4711 ----
if (visiting)
{
SAVE_MODIFF = MODIFF;
! if (XINT (current_buffer->save_length) != -2)
! XSETFASTINT (current_buffer->save_length, Z - BEG);
current_buffer->filename = visit_file;
update_mode_lines++;
}
***************
*** 5307,5313 ****
&& BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)
&& b->auto_save_modified < BUF_MODIFF (b)
/* -1 means we've turned off autosaving for a while--see below. */
! && XINT (b->save_length) >= 0
&& (do_handled_files
|| NILP (Ffind_file_name_handler (b->auto_save_file_name,
Qwrite_region))))
--- 5309,5315 ----
&& BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)
&& b->auto_save_modified < BUF_MODIFF (b)
/* -1 means we've turned off autosaving for a while--see below. */
! && XINT (b->save_length) != -1
&& (do_handled_files
|| NILP (Ffind_file_name_handler (b->auto_save_file_name,
Qwrite_region))))
***************
*** 5321,5328 ****
&& EMACS_SECS (before_time) - b->auto_save_failure_time < 1200)
continue;
! if ((XFASTINT (b->save_length) * 10
! > (BUF_Z (b) - BUF_BEG (b)) * 13)
/* A short file is likely to change a large fraction;
spare the user annoying messages. */
&& XFASTINT (b->save_length) > 5000
--- 5323,5332 ----
&& EMACS_SECS (before_time) - b->auto_save_failure_time < 1200)
continue;
! if (XINT (b->save_length) != -2
! /* -2 is a magic flag turning off this feature in a buffer. */
! && (XFASTINT (b->save_length) * 10
! > (BUF_Z (b) - BUF_BEG (b)) * 13)
/* A short file is likely to change a large fraction;
spare the user annoying messages. */
&& XFASTINT (b->save_length) > 5000
***************
*** 5347,5353 ****
internal_condition_case (auto_save_1, Qt, auto_save_error);
auto_saved++;
b->auto_save_modified = BUF_MODIFF (b);
! XSETFASTINT (current_buffer->save_length, Z - BEG);
set_buffer_internal (old);
EMACS_GET_TIME (after_time);
--- 5351,5358 ----
internal_condition_case (auto_save_1, Qt, auto_save_error);
auto_saved++;
b->auto_save_modified = BUF_MODIFF (b);
! if (XINT (current_buffer->save_length) != -2)
! XSETFASTINT (current_buffer->save_length, Z - BEG);
set_buffer_internal (old);
EMACS_GET_TIME (after_time);
***************
*** 5392,5398 ****
()
{
current_buffer->auto_save_modified = MODIFF;
! XSETFASTINT (current_buffer->save_length, Z - BEG);
current_buffer->auto_save_failure_time = -1;
return Qnil;
}
--- 5397,5404 ----
()
{
current_buffer->auto_save_modified = MODIFF;
! if (XINT (current_buffer->save_length) != -2)
! XSETFASTINT (current_buffer->save_length, Z - BEG);
current_buffer->auto_save_failure_time = -1;
return Qnil;
}
*** files.el 5 Jul 2009 22:15:37 -0000 1.1055
--- files.el 16 Jul 2009 01:52:36 -0000 1.1056
***************
*** 4996,5002 ****
(make-auto-save-file-name))))
;; If -1 was stored here, to temporarily turn off saving,
;; turn it back on.
! (and (< buffer-saved-size 0)
(setq buffer-saved-size 0))
(if (interactive-p)
(message "Auto-save %s (in this buffer)"
--- 4996,5002 ----
(make-auto-save-file-name))))
;; If -1 was stored here, to temporarily turn off saving,
;; turn it back on.
! (and (= buffer-saved-size -1)
(setq buffer-saved-size 0))
(if (interactive-p)
(message "Auto-save %s (in this buffer)"
*** rmail.el 18 May 2009 16:27:00 -0000 1.535
--- rmail.el 16 Jul 2009 01:52:36 -0000 1.536
***************
*** 371,377 ****
:group 'rmail-headers)
;;;###autoload
! (defcustom rmail-retry-ignored-headers "^x-authentication-warning:\\|content-type:\\|content-transfer-encoding:\\|mime-version:"
"Headers that should be stripped when retrying a failed message."
:type '(choice regexp (const nil :tag "None"))
:group 'rmail-headers
--- 371,377 ----
:group 'rmail-headers)
;;;###autoload
! (defcustom rmail-retry-ignored-headers "^x-authentication-warning:\\|^x-detected-operating-system:\\|^x-spam[-a-z]*:\\|content-type:\\|content-transfer-encoding:\\|mime-version:"
"Headers that should be stripped when retrying a failed message."
:type '(choice regexp (const nil :tag "None"))
:group 'rmail-headers
***************
*** 1410,1415 ****
--- 1410,1418 ----
;; Don't let a local variables list in a message cause confusion.
(make-local-variable 'local-enable-local-variables)
(setq local-enable-local-variables nil)
+ ;; Don't turn off auto-saving based on the size of the buffer
+ ;; because that code does not understand buffer-swapping.
+ (setq buffer-saved-size -2)
(make-local-variable 'revert-buffer-function)
(setq revert-buffer-function 'rmail-revert)
(make-local-variable 'font-lock-defaults)
next prev parent reply other threads:[~2009-07-20 18:51 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-20 18:32 Upcoming 23.1 release Chong Yidong
2009-07-20 18:44 ` Eli Zaretskii
2009-07-20 18:51 ` Chong Yidong [this message]
2009-07-20 19:06 ` Eli Zaretskii
2009-07-20 19:37 ` Chong Yidong
2009-07-20 20:36 ` Eli Zaretskii
2009-07-21 1:20 ` Stefan Monnier
2009-07-21 15:05 ` Chong Yidong
2009-07-21 15:42 ` Stefan Monnier
2009-07-21 14:41 ` Richard Stallman
2009-07-21 14:41 ` Richard Stallman
2009-07-21 15:38 ` Chong Yidong
2009-07-22 1:43 ` Richard Stallman
2009-07-20 19:02 ` Chong Yidong
2009-07-20 20:42 ` Eli Zaretskii
2009-07-21 15:31 ` Chong Yidong
2009-07-22 1:43 ` Richard Stallman
2009-07-21 14:42 ` Richard Stallman
2009-07-21 14:41 ` Richard Stallman
2009-07-20 18:55 ` Dan Nicolaescu
2009-07-20 19:06 ` Chong Yidong
2009-07-21 3:16 ` usefulness of no-byte-compile [was: Re: Upcoming 23.1 release] Dan Nicolaescu
2009-07-20 20:05 ` Upcoming 23.1 release Chong Yidong
2009-07-20 22:58 ` Jason Rumney
2009-07-20 23:12 ` Chong Yidong
2009-07-21 0:43 ` Kenichi Handa
2009-07-21 3:10 ` Eli Zaretskii
2009-07-21 3:55 ` Lennart Borgman
2009-07-22 6:55 ` Yavor Doganov
2009-07-22 7:24 ` David Reitter
2009-07-24 0:46 ` YAMAMOTO Mitsuharu
2009-07-24 0:53 ` YAMAMOTO Mitsuharu
2009-07-24 15:10 ` Yavor Doganov
2009-07-24 15:47 ` Adrian Robert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ljmjchna.fsf@stupidchicken.com \
--to=cyd@stupidchicken.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).