From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alexander Pohoyda Newsgroups: gmane.emacs.devel Subject: Re: RMAIL, rmail-mbox-branch Date: 26 Nov 2003 23:44:40 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87brqyoilj.fsf@oak.pohoyda.family> References: <87ad7tow7y.fsf_-_@oak.pohoyda.family> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1069887623 31415 80.91.224.253 (26 Nov 2003 23:00:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 26 Nov 2003 23:00:23 +0000 (UTC) Cc: eliz@elta.co.il, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Nov 27 00:00:19 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AP8dv-0006Wg-00 for ; Thu, 27 Nov 2003 00:00:19 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AP8dv-0006Ra-00 for ; Thu, 27 Nov 2003 00:00:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AP9UF-0004xt-H0 for emacs-devel@quimby.gnus.org; Wed, 26 Nov 2003 18:54:23 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AP9TM-0004hP-Jd for emacs-devel@gnu.org; Wed, 26 Nov 2003 18:53:28 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AP9Sk-0004Wj-Vw for emacs-devel@gnu.org; Wed, 26 Nov 2003 18:53:22 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.24) id 1AP9Sk-0004WQ-6v for emacs-devel@gnu.org; Wed, 26 Nov 2003 18:52:50 -0500 Original-Received: (qmail 9169 invoked by uid 65534); 26 Nov 2003 22:44:44 -0000 Original-Received: from p50842205.dip0.t-ipconnect.de (EHLO oak.pohoyda.family) (80.132.34.5) by mail.gmx.net (mp021) with SMTP; 26 Nov 2003 23:44:44 +0100 X-Authenticated: #14602519 Original-Received: from oak.pohoyda.family (oak.pohoyda.family [127.0.0.1]) by oak.pohoyda.family (8.12.9/8.12.9) with ESMTP id hAQMigev002010; Wed, 26 Nov 2003 23:44:42 +0100 (CET) (envelope-from alexander.pohoyda@gmx.net) Original-Received: (from apog@localhost) by oak.pohoyda.family (8.12.9/8.12.9/Submit) id hAQMievq002007; Wed, 26 Nov 2003 23:44:40 +0100 (CET) (envelope-from alexander.pohoyda@gmx.net) X-Authentication-Warning: oak.pohoyda.family: apog set sender to alexander.pohoyda@gmx.net using -f Original-To: rms@gnu.org In-Reply-To: Original-Lines: 118 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18150 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18150 Richard Stallman writes: > 1) If RMAIL file does not exist, rmail-display-labels function > fails deep inside rmaildesc.el and I dont see a reason to > display labels if there are no messages. > > If nothing is done, will the labels from the previously displayed > message hang around in the modeline? If so, we should fix > rmail-display-labels so it does the right thing when there is no > message. If not, your fix seems right. Which one is it? You were right: we need to clean the modeline after deleting the last message. Fixed. > 2) rmail-use-spam-filter is void variable, used in > rmail-get-new-mail function. It is defined in > rmail-spam-filter.el, but we cannot (require > 'rmail-spam-filter) before the rmail-mode-map variable is > defined further in rmail.el file. > > How about doing the require at a place such as the function `rmail' > so that we know rmail-mode-map is already set up? This approach worked. Fixed. Other notes: 1) mail-utils is required for mail-strip-quoted-names function; 2) I changed the label separator in the modeline from " " (just space) to ", " (comma followed by space), which looks better, I believe; 3) if a message has no labels (the result variable is an empty string), there is no need to append a space in the end: orig (RMAIL 1/1 ) vs. new (RMAIL 1/1) 4) if there are labels, separate them with a semicolon: orig (RMAIL 1/1 deleted label2) vs. new new (RMAIL 1/1; deleted, label2) 5) if the last message is deleted or the RMAIL file is empty, display (RMAIL no messages) in the modeline; 6) the change in rmailsum.el should have been applied already, but is, obviously, not. Please consider the following 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)) @@ -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 PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72 15 54 5F 62 20 23 C6 44