emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: C-c C-c in recover session produces "Args out of range"


From: Markus Rost
Subject: Re: C-c C-c in recover session produces "Args out of range"
Date: Thu, 12 Jun 2003 21:56:06 -0400 (EDT)

address@hidden wrote:

   ====
   Here's what's in .save-xxx file:
   ====
   /home/aronov/papers/separation/2003-06-05/separability.tex
   /home/aronov/papers/separation/2003-06-05/#separability.tex#
   ====
   Here's what I get when I do C-c C-c
   => Args out of range: "", 1, -1

I have the same experience.  However, whenever this happened, the
corresponding auto-save-list-file .saves-NNN-abc~ had two consecutive
empty lines in it.

In fact, it is possible to reproduce that error by adding two
consecutive empty lines manually to an auto-save-list-file.

There is a bug in emacs which can cause a crash and a corrupted
auto-save-list-file with consecutive empty lines.  That bug was never
identified and fixed.

Anyway, one should perhaps modify recover-session-finish as follows.

        * files.el (recover-session-finish): Don't give up when there are
        two consecutive empty lines in the auto-save-list file.

===Buffer *diff*============================================
cd /home/rost/cvs/emacs/lisp/
diff -c /home/rost/cvs/emacs/lisp/files.el /tmp/buffer-content-6911_yS
*** /home/rost/cvs/emacs/lisp/files.el  Tue Jun  3 20:26:33 2003
--- /tmp/buffer-content-6911_yS Thu Jun 12 21:45:35 2003
***************
*** 3688,3705 ****
                  ;; a "visited file name" from that.
                  (progn
                    (forward-line 1)
!                   (setq autofile
!                         (buffer-substring-no-properties
!                          (point)
!                          (save-excursion
!                            (end-of-line)
!                            (point))))
!                   (setq thisfile
!                         (expand-file-name
!                          (substring
!                           (file-name-nondirectory autofile)
!                           1 -1)
!                          (file-name-directory autofile)))
                    (forward-line 1))
                ;; This pair of lines is a file-visiting
                ;; buffer.  Use the visited file name.
--- 3688,3708 ----
                  ;; a "visited file name" from that.
                  (progn
                    (forward-line 1)
!                   ;; If there is no auto-save file name, the
!                   ;; auto-save-list file is probably corrupted. 
!                   (unless (eolp)
!                     (setq autofile
!                           (buffer-substring-no-properties
!                            (point)
!                            (save-excursion
!                              (end-of-line)
!                              (point))))
!                     (setq thisfile
!                           (expand-file-name
!                            (substring
!                             (file-name-nondirectory autofile)
!                             1 -1)
!                            (file-name-directory autofile))))
                    (forward-line 1))
                ;; This pair of lines is a file-visiting
                ;; buffer.  Use the visited file name.
***************
*** 3713,3719 ****
                         (point) (progn (end-of-line) (point))))
                  (forward-line 1)))
              ;; Ignore a file if its auto-save file does not exist now.
!             (if (file-exists-p autofile)
                  (setq files (cons thisfile files)))))
          (setq files (nreverse files))
          ;; The file contains a pair of line for each auto-saved buffer.
--- 3716,3722 ----
                         (point) (progn (end-of-line) (point))))
                  (forward-line 1)))
              ;; Ignore a file if its auto-save file does not exist now.
!             (if (and autofile (file-exists-p autofile))
                  (setq files (cons thisfile files)))))
          (setq files (nreverse files))
          ;; The file contains a pair of line for each auto-saved buffer.

Diff finished at Thu Jun 12 21:45:36

============================================================





reply via email to

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