emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Upcoming 23.1 release


From: Chong Yidong
Subject: Re: Upcoming 23.1 release
Date: Mon, 20 Jul 2009 14:51:21 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.96 (gnu/linux)

Eli Zaretskii <address@hidden> 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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]