unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [rmail-mbox-branch]: inital problems
@ 2004-09-14 23:28 Alfred M. Szmidt
  2004-09-16 16:59 ` Alexander Pohoyda
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Alfred M. Szmidt @ 2004-09-14 23:28 UTC (permalink / raw)


If you start rmail without having a file to read (or if you read a
babyl-RMAIL file), you get the following:

No messages to show.  Add something better soon.
rmail-desc-get-keywords: Args out of range: [], 0


Opening an existing mbox file on the other hand produces this:

Processing new messages...
rmail-get-sender: Symbol's function definition is void: mail-strip-quoted-names



I got the rmail mbox branch by going to the lisp/mail directory and
running "cvs up -r rmail-mbox-branch".  And recompiled emacs, and
installed it.


Happy hacking.

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-14 23:28 [rmail-mbox-branch]: inital problems Alfred M. Szmidt
@ 2004-09-16 16:59 ` Alexander Pohoyda
  2004-09-16 17:13   ` Alfred M. Szmidt
  2004-09-18 19:07   ` Richard Stallman
  2004-09-16 17:21 ` Alfred M. Szmidt
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 18+ messages in thread
From: Alexander Pohoyda @ 2004-09-16 16:59 UTC (permalink / raw)
  Cc: emacs-devel

"Alfred M. Szmidt" <ams@kemisten.nu> writes:

> If you start rmail without having a file to read (or if you read a
> babyl-RMAIL file), you get the following:
> 
> No messages to show.  Add something better soon.
> rmail-desc-get-keywords: Args out of range: [], 0
>
> Opening an existing mbox file on the other hand produces this:
> 
> Processing new messages...
> rmail-get-sender: Symbol's function definition is void: mail-strip-quoted-names

Please try this patch.

Index: rmail.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/rmail.el,v
retrieving revision 1.368.2.5
diff -u -r1.368.2.5 rmail.el
--- rmail.el	23 Feb 2003 00:33:25 -0000	1.368.2.5
+++ rmail.el	26 Nov 2003 22:21:37 -0000
@@ -49,6 +49,7 @@

 (eval-and-compile
   (require 'browse-url)
+  (require 'mail-utils)
   (require 'rmaildesc)
   (require 'rmailhdr))

@@ -172,7 +173,6 @@
          "\\|^x-attribution:\\|^x-disclaimer:\\|^x-trace:"
          "\\|^x-complaints-to:\\|^nntp-posting-date:\\|^user-agent:"
          "\\|^x-importance:\\|^envelope-to:\\|^delivery-date:"
-         "\\|^x-importance:\\|^envelope-to:\\|^delivery-date:"
           "\\|^x-*-priority:\\|x-mimeole:"
          "\\|^x-babyl-v6-attributes:\\|x-babyl-v6-keywords:")
   "*Regexp to match header fields that Rmail should normally hide.
@@ -645,6 +646,7 @@
 If `rmail-display-summary' is non-nil, make a summary for this RMAIL file."
   (interactive (if current-prefix-arg
 		   (list (read-file-name "Run rmail on RMAIL file: "))))
+  (require 'rmail-spam-filter)
   (rmail-require-mime-maybe)
   (let* ((file-name (expand-file-name (or file-name-arg rmail-file-name)))
 	 ;; Use find-buffer-visiting, not get-file-buffer, for those users
@@ -2126,13 +2128,14 @@
         (setq keyword-list (rmail-desc-get-keywords rmail-current-message)))

     ;; Generate the result string.
-    (setq result (mapconcat '(lambda (arg) arg) keyword-list " "))
+    (setq result (mapconcat '(lambda (arg) arg) keyword-list ", "))

     ;; Update the mode line to display the keywords, the current
     ;; message index and the total number of messages.
     (setq mode-line-process
-	  (format " %d/%d %s"
-		  rmail-current-message rmail-total-messages result))
+	  (concat (format " %d/%d" rmail-current-message rmail-total-messages)
+		  (unless (string-equal result "")
+		    (concat "; " result))))

     ;; If rmail-enable-mime is non-nil, we may have to update
     ;; `mode-line-process' of rmail-view-buffer too.
@@ -2458,7 +2461,7 @@
       ;; out of the Rmail file so as not to break other mail agents.
       (progn
         (message "No messages to show.  Add something better soon.")
-        (rmail-display-labels)
+        (setq mode-line-process " no messages")
         (force-mode-line-update))

     ;; There are messages.  Show one.
Index: rmailsum.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/rmailsum.el,v
retrieving revision 1.127.2.2
diff -u -r1.127.2.2 rmailsum.el
--- rmailsum.el	18 Feb 2003 16:47:23 -0000	1.127.2.2
+++ rmailsum.el	26 Nov 2003 22:21:38 -0000
@@ -1081,7 +1081,8 @@
       (if (< n 1)
 	  (progn (message "No preceding message")
 		 (setq n 1)))
-      (if (> n total)
+      (if (and (> n total)
+	       (> total 0))
 	  (progn (message "No following message")
 		 (goto-char (point-max))
 		 (rmail-summary-goto-msg nil nowarn skip-rmail)))



-- 
Alexander Pohoyda <alexander.pohoyda@gmx.net>
PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72  15 54 5F 62 20 23 C6 44

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-16 16:59 ` Alexander Pohoyda
@ 2004-09-16 17:13   ` Alfred M. Szmidt
  2004-09-17 23:22     ` Richard Stallman
  2004-09-18 19:07   ` Richard Stallman
  1 sibling, 1 reply; 18+ messages in thread
From: Alfred M. Szmidt @ 2004-09-16 17:13 UTC (permalink / raw)
  Cc: emacs-devel

It would be nice if the new rmail would report an error if it is
trying to open a old mailbox.  Right now it just assumes that it knows
what it is doing, and will barf with a babyl formated mailbox.


As for your patch, it worked.  Will poke around and see what I can
break...  Thanks.

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-14 23:28 [rmail-mbox-branch]: inital problems Alfred M. Szmidt
  2004-09-16 16:59 ` Alexander Pohoyda
@ 2004-09-16 17:21 ` Alfred M. Szmidt
  2004-09-17 23:23   ` Richard Stallman
  2004-09-17  9:36 ` Richard Stallman
  2004-09-18  0:18 ` Alfred M. Szmidt
  3 siblings, 1 reply; 18+ messages in thread
From: Alfred M. Szmidt @ 2004-09-16 17:21 UTC (permalink / raw)
  Cc: emacs-devel

Okie, here is the next problem, trying to do either rmail-reply,
rmail-edit-current-message will result in the following error:

rmail-desc-get-descriptor: Args out of range: [], 0

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-14 23:28 [rmail-mbox-branch]: inital problems Alfred M. Szmidt
  2004-09-16 16:59 ` Alexander Pohoyda
  2004-09-16 17:21 ` Alfred M. Szmidt
@ 2004-09-17  9:36 ` Richard Stallman
  2004-09-18  0:18 ` Alfred M. Szmidt
  3 siblings, 0 replies; 18+ messages in thread
From: Richard Stallman @ 2004-09-17  9:36 UTC (permalink / raw)
  Cc: emacs-devel

    Processing new messages...
    rmail-get-sender: Symbol's function definition is void: mail-strip-quoted-names

That function is in mail-utils.  Can you add

  (require 'mail-utils)

to the beginning of rmail-get-sender as a quick fix for this,
so you can test it some more?

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-16 17:13   ` Alfred M. Szmidt
@ 2004-09-17 23:22     ` Richard Stallman
  2004-09-18  0:09       ` Alfred M. Szmidt
  2004-10-06 21:50       ` Alexander Pohoyda
  0 siblings, 2 replies; 18+ messages in thread
From: Richard Stallman @ 2004-09-17 23:22 UTC (permalink / raw)
  Cc: alexander.pohoyda, emacs-devel

    It would be nice if the new rmail would report an error if it is
    trying to open a old mailbox.  Right now it just assumes that it knows
    what it is doing, and will barf with a babyl formated mailbox.

How about this?

*** rmail.el	22 Feb 2003 19:33:25 -0500	1.368.2.5
--- rmail.el	17 Sep 2004 10:57:33 -0400	
***************
*** 691,698 ****
  		   (setq run-mail-hook t)))
        (setq run-mail-hook t)
        (rmail-mode-2)
!       ;; Convert all or part to Babyl file if possible.
! ;;;      (rmail-convert-file)
        (goto-char (point-max)))
      ;; As we have read a file by raw-text, the buffer is set to
      ;; unibyte.  We must make it multibyte if necessary.
--- 691,700 ----
  		   (setq run-mail-hook t)))
        (setq run-mail-hook t)
        (rmail-mode-2)
!       (goto-char (point-min))
!       ;; If file starts like a Babyl file, reject it.
!       (if (looking-at "BABYL OPTIONS:")
! 	  (error "This is a BABYL file; use M-x unrmail to convert it")))
        (goto-char (point-max)))
      ;; As we have read a file by raw-text, the buffer is set to
      ;; unibyte.  We must make it multibyte if necessary.
***************
*** 2533,2539 ****
  	;; Deal with the message headers and URLs..
  	(rmail-header-hide-headers)
  	(rmail-highlight-headers)
!         (rmail-activate-urls)
  
  	;; ?
  	(if transient-mark-mode (deactivate-mark))
--- 2535,2541 ----
  	;; Deal with the message headers and URLs..
  	(rmail-header-hide-headers)
  	(rmail-highlight-headers)
! ;;;     (rmail-activate-urls)
  
  	;; ?
  	(if transient-mark-mode (deactivate-mark))

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-16 17:21 ` Alfred M. Szmidt
@ 2004-09-17 23:23   ` Richard Stallman
  2004-09-17 23:57     ` Alfred M. Szmidt
  0 siblings, 1 reply; 18+ messages in thread
From: Richard Stallman @ 2004-09-17 23:23 UTC (permalink / raw)
  Cc: ams, emacs-devel

    Okie, here is the next problem, trying to do either rmail-reply,
    rmail-edit-current-message will result in the following error:

    rmail-desc-get-descriptor: Args out of range: [], 0

Could you debug it a little, please?  For instance, send a backtrace?
What bad data causes the problem?

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-17 23:23   ` Richard Stallman
@ 2004-09-17 23:57     ` Alfred M. Szmidt
  2004-09-18 22:56       ` Richard Stallman
  2004-09-20  0:06       ` Richard Stallman
  0 siblings, 2 replies; 18+ messages in thread
From: Alfred M. Szmidt @ 2004-09-17 23:57 UTC (permalink / raw)
  Cc: emacs-devel

       Okie, here is the next problem, trying to do either rmail-reply,
       rmail-edit-current-message will result in the following error:

       rmail-desc-get-descriptor: Args out of range: [], 0

   Could you debug it a little, please?  For instance, send a
   backtrace?

Will this do?  I am not all that familiar with the elisp debugging
facilities...

Note that the mailbox doesn't contain any messages as of yet, which
probobly why the error happens. That is, it assumes that there is a
message and tries to edit it.

,----
| Debugger entered--Lisp error: (args-out-of-range [] 0)
|   aref([] 0)
|   rmail-desc-get-descriptor(1)
|   (nth rmail-desc-beg-index (rmail-desc-get-descriptor n))
|   (marker-position (nth rmail-desc-beg-index (rmail-desc-get-descriptor n)))
|   rmail-desc-get-start(1)
|   (overlays-at (rmail-desc-get-start n))
|   (null (overlays-at (rmail-desc-get-start n)))
|   rmail-desc-get-header-display-state(1)
|   rmail-msg-is-pruned()
|   (setq rmail-old-pruned (rmail-msg-is-pruned))
|   rmail-edit-current-message()
|   call-interactively(rmail-edit-current-message)
`----

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-17 23:22     ` Richard Stallman
@ 2004-09-18  0:09       ` Alfred M. Szmidt
  2004-09-18 22:56         ` Richard Stallman
  2004-10-06 21:50       ` Alexander Pohoyda
  1 sibling, 1 reply; 18+ messages in thread
From: Alfred M. Szmidt @ 2004-09-18  0:09 UTC (permalink / raw)
  Cc: alexander.pohoyda, emacs-devel

       It would be nice if the new rmail would report an error if it
       is trying to open a old mailbox.  Right now it just assumes
       that it knows what it is doing, and will barf with a babyl
       formated mailbox.

   How about this?

I don't like it, it does the check far far to late.  It should do it
before switching to any modes.

I was thinking something more along the lines of:

--- rmail.el	23 Feb 2003 00:33:25 -0000	1.368.2.5
+++ rmail.el	18 Sep 2004 00:08:34 -0000
@@ -684,16 +685,16 @@ If `rmail-display-summary' is non-nil, m
 	 (find-file-noselect file-name))))
     (if (eq major-mode 'rmail-edit-mode)
 	(error "Exit Rmail Edit mode before getting new mail"))
+    ;; If file starts like a Babyl file, reject it.
+    (if (looking-at "BABYL OPTIONS:")
+	(error "This is a BABYL file; use M-x unrmail to convert it"))
     (if (and existed (> (buffer-size) 0))
 	;; Buffer not new and not empty; ensure in proper mode, but that's all.
 	(or (eq major-mode 'rmail-mode)
 	    (progn (rmail-mode-2)
 		   (setq run-mail-hook t)))
       (setq run-mail-hook t)
-      (rmail-mode-2)
-      ;; Convert all or part to Babyl file if possible.
-;;;      (rmail-convert-file)
-      (goto-char (point-max)))
+      (rmail-mode-2))
     ;; As we have read a file by raw-text, the buffer is set to
     ;; unibyte.  We must make it multibyte if necessary.
     (if (and rmail-enable-multibyte

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-14 23:28 [rmail-mbox-branch]: inital problems Alfred M. Szmidt
                   ` (2 preceding siblings ...)
  2004-09-17  9:36 ` Richard Stallman
@ 2004-09-18  0:18 ` Alfred M. Szmidt
  3 siblings, 0 replies; 18+ messages in thread
From: Alfred M. Szmidt @ 2004-09-18  0:18 UTC (permalink / raw)
  Cc: emacs-devel

More problems, if you do get new mail so that RMAIL has something to
play with, then the following happens when you try to go to the
next/previous message:

,----
| Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
|   narrow-to-region(nil nil)
|   (let ((beg ...) (end ...)) (rmail-header-show-headers) (widen) (narrow-to-region beg end) (goto-char (point-min)) (if (re-search-forward "^X-Coding-System: *\\(.*\\)$" nil t) (let ... ...) (setq buffer-file-coding-system nil)) (if (rmail-desc-attr-p rmail-desc-unseen-index n) (rmail-desc-set-attribute rmail-desc-unseen-index nil n)) (rmail-display-labels) (if (eq rmail-enable-mime t) (funcall rmail-show-mime-function) (setq rmail-view-buffer rmail-buffer)) (rmail-header-hide-headers) (rmail-highlight-headers) (if transient-mark-mode (deactivate-mark)) (set-window-point (get-buffer-window rmail-buffer) (point)) (run-hooks (quote rmail-show-message-hook)) (and (rmail-summary-exists) (not no-summary) (save-excursion ...)) (with-current-buffer rmail-buffer (rmail-auto-file)) (if blurb (message blurb)))
|   (let (blurb coding-system) (if (not n) (setq n rmail-current-message) (cond ... ... ...)) (let (... ...) (rmail-header-show-headers) (widen) (narrow-to-region beg end) (goto-char ...) (if ... ... ...) (if ... ...) (rmail-display-labels) (if ... ... ...) (rmail-header-hide-headers) (rmail-highlight-headers) (if transient-mark-mode ...) (set-window-point ... ...) (run-hooks ...) (and ... ... ...) (with-current-buffer rmail-buffer ...) (if blurb ...)))
|   (if (zerop rmail-total-messages) (progn (message "No messages to show.  Add something better soon.") (setq mode-line-process " no messages") (force-mode-line-update)) (let (blurb coding-system) (if ... ... ...) (let ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)))
|   rmail-show-message(9)
|   (let ((lastwin rmail-current-message) (current rmail-current-message)) (while (and ... ...) (setq current ...) (if ... ...)) (while (and ... ...) (setq current ...) (if ... ...)) (rmail-show-message lastwin) (if (/= lastwin rmail-current-message) t (if ... ...) (if ... ...) nil))
|   rmail-next-undeleted-message(1)
|   call-interactively(rmail-next-undeleted-message)
`----

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-16 16:59 ` Alexander Pohoyda
  2004-09-16 17:13   ` Alfred M. Szmidt
@ 2004-09-18 19:07   ` Richard Stallman
  2004-09-18 21:10     ` Stefan
  1 sibling, 1 reply; 18+ messages in thread
From: Richard Stallman @ 2004-09-18 19:07 UTC (permalink / raw)
  Cc: ams, emacs-devel

Thanks for fixing some bugs.

Can someone please install this patch?


Index: rmail.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/rmail.el,v
retrieving revision 1.368.2.5
diff -u -r1.368.2.5 rmail.el
--- rmail.el	23 Feb 2003 00:33:25 -0000	1.368.2.5
+++ rmail.el	26 Nov 2003 22:21:37 -0000
@@ -49,6 +49,7 @@

 (eval-and-compile
   (require 'browse-url)
+  (require 'mail-utils)
   (require 'rmaildesc)
   (require 'rmailhdr))

@@ -172,7 +173,6 @@
          "\\|^x-attribution:\\|^x-disclaimer:\\|^x-trace:"
          "\\|^x-complaints-to:\\|^nntp-posting-date:\\|^user-agent:"
          "\\|^x-importance:\\|^envelope-to:\\|^delivery-date:"
-         "\\|^x-importance:\\|^envelope-to:\\|^delivery-date:"
           "\\|^x-*-priority:\\|x-mimeole:"
          "\\|^x-babyl-v6-attributes:\\|x-babyl-v6-keywords:")
   "*Regexp to match header fields that Rmail should normally hide.
@@ -645,6 +646,7 @@
 If `rmail-display-summary' is non-nil, make a summary for this RMAIL file."
   (interactive (if current-prefix-arg
 		   (list (read-file-name "Run rmail on RMAIL file: "))))
+  (require 'rmail-spam-filter)
   (rmail-require-mime-maybe)
   (let* ((file-name (expand-file-name (or file-name-arg rmail-file-name)))
 	 ;; Use find-buffer-visiting, not get-file-buffer, for those users
@@ -2126,13 +2128,14 @@
         (setq keyword-list (rmail-desc-get-keywords rmail-current-message)))

     ;; Generate the result string.
-    (setq result (mapconcat '(lambda (arg) arg) keyword-list " "))
+    (setq result (mapconcat '(lambda (arg) arg) keyword-list ", "))

     ;; Update the mode line to display the keywords, the current
     ;; message index and the total number of messages.
     (setq mode-line-process
-	  (format " %d/%d %s"
-		  rmail-current-message rmail-total-messages result))
+	  (concat (format " %d/%d" rmail-current-message rmail-total-messages)
+		  (unless (string-equal result "")
+		    (concat "; " result))))

     ;; If rmail-enable-mime is non-nil, we may have to update
     ;; `mode-line-process' of rmail-view-buffer too.
@@ -2458,7 +2461,7 @@
       ;; out of the Rmail file so as not to break other mail agents.
       (progn
         (message "No messages to show.  Add something better soon.")
-        (rmail-display-labels)
+        (setq mode-line-process " no messages")
         (force-mode-line-update))

     ;; There are messages.  Show one.
Index: rmailsum.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/rmailsum.el,v
retrieving revision 1.127.2.2
diff -u -r1.127.2.2 rmailsum.el
--- rmailsum.el	18 Feb 2003 16:47:23 -0000	1.127.2.2
+++ rmailsum.el	26 Nov 2003 22:21:38 -0000
@@ -1081,7 +1081,8 @@
       (if (< n 1)
 	  (progn (message "No preceding message")
 		 (setq n 1)))
-      (if (> n total)
+      (if (and (> n total)
+	       (> total 0))
 	  (progn (message "No following message")
 		 (goto-char (point-max))
 		 (rmail-summary-goto-msg nil nowarn skip-rmail)))

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-18 19:07   ` Richard Stallman
@ 2004-09-18 21:10     ` Stefan
  0 siblings, 0 replies; 18+ messages in thread
From: Stefan @ 2004-09-18 21:10 UTC (permalink / raw)
  Cc: ams, Alexander Pohoyda, emacs-devel

> -    (setq result (mapconcat '(lambda (arg) arg) keyword-list " "))
> +    (setq result (mapconcat '(lambda (arg) arg) keyword-list ", "))

And while you're at ti, replace this '(lambda (arg) arg) with 'identity.


        Stefan

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-17 23:57     ` Alfred M. Szmidt
@ 2004-09-18 22:56       ` Richard Stallman
  2004-09-20  0:06       ` Richard Stallman
  1 sibling, 0 replies; 18+ messages in thread
From: Richard Stallman @ 2004-09-18 22:56 UTC (permalink / raw)
  Cc: emacs-devel

    Note that the mailbox doesn't contain any messages as of yet, which
    probobly why the error happens. That is, it assumes that there is a
    message and tries to edit it.

That sounds like the right explanation.

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-18  0:09       ` Alfred M. Szmidt
@ 2004-09-18 22:56         ` Richard Stallman
  0 siblings, 0 replies; 18+ messages in thread
From: Richard Stallman @ 2004-09-18 22:56 UTC (permalink / raw)
  Cc: alexander.pohoyda, emacs-devel

Your change seems reasonable--would someone please install it?



--- rmail.el	23 Feb 2003 00:33:25 -0000	1.368.2.5
+++ rmail.el	18 Sep 2004 00:08:34 -0000
@@ -684,16 +685,16 @@ If `rmail-display-summary' is non-nil, m
 	 (find-file-noselect file-name))))
     (if (eq major-mode 'rmail-edit-mode)
 	(error "Exit Rmail Edit mode before getting new mail"))
+    ;; If file starts like a Babyl file, reject it.
+    (if (looking-at "BABYL OPTIONS:")
+	(error "This is a BABYL file; use M-x unrmail to convert it"))
     (if (and existed (> (buffer-size) 0))
 	;; Buffer not new and not empty; ensure in proper mode, but that's all.
 	(or (eq major-mode 'rmail-mode)
 	    (progn (rmail-mode-2)
 		   (setq run-mail-hook t)))
       (setq run-mail-hook t)
-      (rmail-mode-2)
-      ;; Convert all or part to Babyl file if possible.
-;;;      (rmail-convert-file)
-      (goto-char (point-max)))
+      (rmail-mode-2))
     ;; As we have read a file by raw-text, the buffer is set to
     ;; unibyte.  We must make it multibyte if necessary.
     (if (and rmail-enable-multibyte

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-17 23:57     ` Alfred M. Szmidt
  2004-09-18 22:56       ` Richard Stallman
@ 2004-09-20  0:06       ` Richard Stallman
  2004-09-20  0:26         ` Alfred M. Szmidt
  2004-09-20  0:42         ` Alfred M. Szmidt
  1 sibling, 2 replies; 18+ messages in thread
From: Richard Stallman @ 2004-09-20  0:06 UTC (permalink / raw)
  Cc: emacs-devel

	   Okie, here is the next problem, trying to do either rmail-reply,
	   rmail-edit-current-message will result in the following error:

	   rmail-desc-get-descriptor: Args out of range: [], 0

It's not legit to reply to no message or to edit no message.
However, they should get a cleaner error than this.

For instance, does this fix it for r?


*** rmail.el	22 Feb 2003 19:33:25 -0500	1.368.2.5
--- rmail.el	19 Sep 2004 16:39:30 -0400	
***************
*** 3162,3167 ****
--- 3163,3170 ----
  prefix argument means ignore them.  While composing the reply,
  use \\[mail-yank-original] to yank the original message into it."
    (interactive "P")
+   (if (= rmail-total-messages 0)
+       (error "No messages in this file"))
    (save-excursion
      (save-restriction
        (let ((msgnum rmail-current-message)

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-20  0:06       ` Richard Stallman
@ 2004-09-20  0:26         ` Alfred M. Szmidt
  2004-09-20  0:42         ` Alfred M. Szmidt
  1 sibling, 0 replies; 18+ messages in thread
From: Alfred M. Szmidt @ 2004-09-20  0:26 UTC (permalink / raw)
  Cc: emacs-devel

   For instance, does this fix it for r?

Yes.  And the following fixes it for e

--- rmailedit.el	15 Sep 2004 01:32:18 +0200	1.26.2.1
+++ rmailedit.el	20 Sep 2004 02:21:58 +0200	
@@ -1,6 +1,6 @@
@@ -85,6 +85,8 @@ This functions runs the normal hook `rma
 (defun rmail-edit-current-message ()
   "Edit the contents of this message."
   (interactive)
+  (if (= rmail-total-messages 0)
+      (error "No messages in this file"))
   (make-local-variable 'rmail-old-pruned)
   (setq rmail-old-pruned (rmail-msg-is-pruned))
   (make-local-variable 'rmail-edit-saved-coding-system)

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-20  0:06       ` Richard Stallman
  2004-09-20  0:26         ` Alfred M. Szmidt
@ 2004-09-20  0:42         ` Alfred M. Szmidt
  1 sibling, 0 replies; 18+ messages in thread
From: Alfred M. Szmidt @ 2004-09-20  0:42 UTC (permalink / raw)
  Cc: emacs-devel

   For instance, does this fix it for r?

Yes.  And the following fixes it for e.

I haven't done any extensive testing other then getting some new mail,
editing a few of them, and saving.  Will beat it a bit, then I will
make it my default rmail, and beat it some more.

Thank you for the help.

--- rmailedit.el	15 Sep 2004 01:32:18 +0200	1.26.2.1
+++ rmailedit.el	20 Sep 2004 02:21:58 +0200	
@@ -1,6 +1,6 @@
@@ -85,6 +85,8 @@ This functions runs the normal hook `rma
 (defun rmail-edit-current-message ()
   "Edit the contents of this message."
   (interactive)
+  (if (= rmail-total-messages 0)
+      (error "No messages in this file"))
   (make-local-variable 'rmail-old-pruned)
   (setq rmail-old-pruned (rmail-msg-is-pruned))
   (make-local-variable 'rmail-edit-saved-coding-system)

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

* Re: [rmail-mbox-branch]: inital problems
  2004-09-17 23:22     ` Richard Stallman
  2004-09-18  0:09       ` Alfred M. Szmidt
@ 2004-10-06 21:50       ` Alexander Pohoyda
  1 sibling, 0 replies; 18+ messages in thread
From: Alexander Pohoyda @ 2004-10-06 21:50 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     It would be nice if the new rmail would report an error if it is
>     trying to open a old mailbox.  Right now it just assumes that it knows
>     what it is doing, and will barf with a babyl formated mailbox.
> 
> How about this?
> 
>         (setq run-mail-hook t)
>         (rmail-mode-2)
> !       (goto-char (point-min))
> !       ;; If file starts like a Babyl file, reject it.
> !       (if (looking-at "BABYL OPTIONS:")
> ! 	  (error "This is a BABYL file; use M-x unrmail to convert it")))
>         (goto-char (point-max)))
>       ;; As we have read a file by raw-text, the buffer is set to
>       ;; unibyte.  We must make it multibyte if necessary.

There's a function `mail-file-babyl-p' in mail-utils.el, shouldn't we
use it?


-- 
Alexander Pohoyda <alexander.pohoyda@gmx.net>
PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72  15 54 5F 62 20 23 C6 44

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

end of thread, other threads:[~2004-10-06 21:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-14 23:28 [rmail-mbox-branch]: inital problems Alfred M. Szmidt
2004-09-16 16:59 ` Alexander Pohoyda
2004-09-16 17:13   ` Alfred M. Szmidt
2004-09-17 23:22     ` Richard Stallman
2004-09-18  0:09       ` Alfred M. Szmidt
2004-09-18 22:56         ` Richard Stallman
2004-10-06 21:50       ` Alexander Pohoyda
2004-09-18 19:07   ` Richard Stallman
2004-09-18 21:10     ` Stefan
2004-09-16 17:21 ` Alfred M. Szmidt
2004-09-17 23:23   ` Richard Stallman
2004-09-17 23:57     ` Alfred M. Szmidt
2004-09-18 22:56       ` Richard Stallman
2004-09-20  0:06       ` Richard Stallman
2004-09-20  0:26         ` Alfred M. Szmidt
2004-09-20  0:42         ` Alfred M. Szmidt
2004-09-17  9:36 ` Richard Stallman
2004-09-18  0:18 ` Alfred M. Szmidt

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).