[mew-int 01043] Re: "To" field in scan listing?

Tatsuya Kinoshita tats at example.com
Sat Aug 3 07:49:47 JST 2002


In message [mew-int 01042], on August 2, 2002,
d.gonzalez at example.com wrote:

>     2 Fri 2002/08/02 15:28   1K   d.gonzalez   my-friend   imls output

>       Day of the week             To           From        Subject

> So the differences are that I can't get the day of the week, nor who the
> message is from, and I can't clean up the To and From addresses.

I'm using `my-just-to', `my-just-from', and `my-dayofweek' in my
mew-scan-form-list as follows (I modified mew-scan-form-list for
this sample.):

---- 
;; A sample ~/.mew.el for the mew-scan-form feature.
;; This file is written by Tatsuya Kinoshita.  Copyright is disclaimed.

(setq mew-scan-form-mark-delete nil)
(setq mew-scan-form-mark-review nil)
;;(setq mew-scan-form-size-unit '("" "k")) ;; '("" "k" "M" "G" "T")
(setq mew-scan-form-size-0k t) ;; nil
(setq mew-scan-form-size-huge nil) ;; t
(setq mew-scan-form-list-string-type 'regex)
(setq mew-scan-form-list-list-type 'regex) ;; 'recursive

(setq mew-scan-form-list
      '(
	(("inbox$" "^+queue$" "^+postq$") ;; see mew-scan-form-list-list-type
	 (-4 type " " (3 my-dayofweek) " " (5 date) " " (5 time) " "
	     (-4 size) "  " (11 my-just-to) "  " (11 my-just-from) "  "
	     t (0 subj)))
	("^+draft$"
	 (-4 type " " (3 my-dayofweek) " " (5 date) " "
	     (-4 size) "  " (17 my-just-to) "  "
	     t (0 subj)))
	(t
	 (-5 type " " (3 my-dayofweek) " " (4 year) "/" (5 date) " "
	     (-4 size) "  " (11 my-just-to) "  "(11 my-just-from) "  "
	     t (0 subj)))
	;;(t (type (5 date) " " (14 from) " " t (0 subj)))
	))

(defun mew-scan-form-my-just-from ()
  (mew-replace-white-space (mew-scan-form-extract-addr (MEW-FROM))))

(defun mew-scan-form-my-just-to ()
  (mew-replace-white-space (mew-scan-form-extract-addr (MEW-TO))))

(defun mew-scan-form-my-dayofweek ()
  (let* ((mew-header-max-depth nil)
	 (s (my-mew-scan-get-date)) year mon day dw)
    (if (or (string= s "")
	    (not (string-match mew-time-rfc-regex s)))
	"???"
      (setq year (mew-time-rfc-year))
      (cond
       ((< year 50)
	(setq year (+ year 2000)))
       ((< year 100)
	(setq year (+ year 1900))))
      (setq mon (mew-time-mon-str-to-int (mew-time-rfc-mon)))
      (setq day (mew-time-rfc-day))
      (condition-case nil
	  (if (and (> mon 0) (> day 0))
	      (setq dw (format-time-string
			"%a" (encode-time 0 0 0 day mon year))))
	(error nil))
      (or dw "???"))))

(defun my-mew-scan-get-date ()
  (let ((s (MEW-DATE)))
    (if (or (string= s "")
	    (not (string-match mew-time-rfc-regex s)))
	(mew-time-ctz-to-rfc
	 (mew-file-get-time (mew-expand-folder (MEW-FLD) (MEW-NUM))))
      s)))
---- 

For more information, read the Mew manual (`M-x info RET d m Mew
RET s scan-form RET') and `mew-scan.el'.

-- 
Tatsuya Kinoshita



More information about the Mew-int mailing list