Commit 2a2dc622 authored by David Byers's avatar David Byers

Print external author and actual date of imported e-mails in kom-list-summary

parent ce6f1168
1999-10-13 David Byers <davby@ida.liu.se>
* view-text.el (lyskom-view-text): Use lyskom-mx-date-to-time.
* komtypes.el (lyskom-create-time): Added tzhr and tzmin to time.
* view-text.el (lyskom-mx-date-to-time): New function.
(lyskom-view-text): Handle missing cal-iso.
1999-10-11 David Byers <davby@ida.liu.se>
Replaced all uses of current-time-string with lyskom-client-date
......
......@@ -36,7 +36,7 @@
# makefile too!
#
CLIENTVERSION = 0.46-BETA-8
CLIENTVERSION = 0.46-BETA-9
DOCFILES=NEWS-0.46
FTPDIR=/home/davby/www-pub
......
......@@ -264,6 +264,13 @@ otherwise: the conference is read with lyskom-completing-read."
(conf-stat->aux-items conf-stat)
(lyskom-aux-item-definition-call item 'status-print item conf-stat))
(let ((mship (lyskom-try-get-membership (conf-stat->conf-no conf-stat) t)))
(when mship
(lyskom-format-insert 'conf-mship-priority
(membership->priority mship)
(lyskom-return-membership-type
(membership->type mship)))))
;; Show all members of CONF-STAT if the user so wishes."
(lyskom-scroll)
(if (lyskom-j-or-n-p
......@@ -887,11 +894,13 @@ on one line."
;; We really don't need the whole text.
)
(lyskom-print-summary-line text-stat text text-no
(time->year time) (time->yday time))
(time->year time)
(time->mon time)
(time->mday time))
(sit-for 0)))))
(defun lyskom-print-summary-line (text-stat text text-no year day)
(defun lyskom-print-summary-line (text-stat text text-no year mon mday)
"Handle the info, fetch the author and print it.
Args: TEXT-STAT TEXT TEXT-NO YEAR DAY.
The year and day is there to be able to choose format on the day.
......@@ -902,11 +911,16 @@ Format is 23:29 if the text is written today. Otherwise 04-01."
(txt (text->text-mass text))
(eos (string-match (regexp-quote "\n") txt))
(subject (substring txt 0 eos))
(mx-date (car (lyskom-get-aux-item (text-stat->aux-items text-stat) 21)))
(mx-from (car (lyskom-get-aux-item (text-stat->aux-items text-stat) 17)))
(mx-author (car (lyskom-get-aux-item (text-stat->aux-items text-stat) 16)))
;; length of the number %%%%%% :8
;; length for time is: 6
(time (text-stat->creation-time text-stat))
(time (or (lyskom-mx-date-to-time mx-date)
(text-stat->creation-time text-stat)))
(time (if (and (= year (time->year time))
(= day (time->yday time)))
(= mon (time->mon time))
(= mday (time->mday time)))
(format "%02d:%02d" (time->hour time)
(time->min time))
(format "%02d-%02d" (1+ (time->mon time))
......@@ -924,7 +938,9 @@ Format is 23:29 if the text is written today. Otherwise 04-01."
text-no
time
lines
(text-stat->author text-stat)
(if mx-from
(lyskom-format-mx-author mx-from mx-author)
(text-stat->author text-stat))
(lyskom-default-button 'text
text-no)
subject))))
......
......@@ -1036,6 +1036,9 @@ text is a member of some recipient of this text."
;;; ============================================================
;;; Info node stuff
(defvar Info-current-node)
(defvar Info-current-file)
(defun kom-yank-info-nodename ()
"Put the current Info-node on the kill-ring."
(interactive)
......
......@@ -848,11 +848,12 @@ FOOTN-TO or FOOTN-IN."
year
wday
yday
isdst)
isdst
&optional tzhr tzmin)
"Create a time from all parameters."
(cons
'TIME
(vector sec min hour mday mon year wday yday isdst )))
(vector sec min hour mday mon year wday yday isdst tzhr tzmin)))
;;; Selectors:
......@@ -893,6 +894,14 @@ FOOTN-TO or FOOTN-IN."
"Get isdst from time."
(elt (cdr time) 8))
(defsubst time->tzhr (time)
"Get isdst from time."
(elt (cdr time) 9))
(defsubst time->tzmin (time)
"Get isdst from time."
(elt (cdr time) 10))
;;; Predicate:
......
......@@ -503,6 +503,7 @@ i svensk datorhistoria. L
(permitted-submitters-no-name . "Tilltna frfattare:%22#1m %#3s(%#2M)\n")
(supervisor-is-no-name . "Organisatr: %25#1p %#3s(%#2P)\n")
(presentation-no . "Presentation: %25#1n\n")
(conf-mship-priority . "Prioritet: %25#1n%#2?b%[ %#2s%]%[%]\n")
(conf-has-motd . "\n%#1M har en lapp p drren:\n")
(status-conf-generic . "%-40#1s %#2s\n")
......
......@@ -105,32 +105,15 @@ Note that this function must not be called asynchronously."
;; Insert date
(if mx-date
(if (and
(condition-case nil
(progn (require 'calendar)
(require 'cal-iso)
t)
nil)
(string-match "\\([0-9][0-9][0-9][0-9]\\)-\\([0-9][0-9]\\)-\\([0-9][0-9]\\) \\([0-9][0-9]\\):\\([0-9][0-9]\\):\\([0-9][0-9]\\) \\([-+][0-9][0-9]\\)?\\([0-9][0-9]\\)?"
(aux-item->data mx-date)))
(let* ((secs (string-to-number (match-string 6 (aux-item->data mx-date))))
(mins (string-to-number (match-string 5 (aux-item->data mx-date))))
(hour (string-to-number (match-string 4 (aux-item->data mx-date))))
(mday (string-to-number (match-string 3 (aux-item->data mx-date))))
(mon (string-to-number (match-string 2 (aux-item->data mx-date))))
(year (string-to-number (match-string 1 (aux-item->data mx-date))))
(tzhr (match-string 7 (aux-item->data mx-date)))
(tzmin (or (match-string 8 (aux-item->data mx-date)) ""))
(wday (elt
(calendar-iso-from-absolute
(calendar-absolute-from-gregorian
(list mon mday year)))
1)))
(lyskom-print-date-and-time
(lyskom-create-time secs mins hour mday mon (- year 1900) wday 0 nil))
(when tzhr
(lyskom-format-insert " %#1s%#2s " tzhr tzmin)))
(lyskom-format-insert (aux-item->data mx-date)))
(let ((date (lyskom-mx-date-to-time mx-date)))
(if date
(progn
(lyskom-print-date-and-time date)
(when (time->tzhr date)
(lyskom-format-insert " %#1s%#2s "
(time->tzhr date)
(time->tzmin date))))
(lyskom-format-insert (aux-item->data mx-date))))
(lyskom-print-date-and-time (text-stat->creation-time
text-stat)
'time-y-m-d-h-m))
......@@ -1018,7 +1001,31 @@ Args: TEXT-STAT of the text being read."
)
author))
(defun lyskom-mx-date-to-time (mx-date)
"Attempt to convert MX-DATE to a lyskom time structure.
Returns the time structure if successful, otherwise nil."
(if (and mx-date
(condition-case nil
(progn (require 'calendar)
(require 'cal-iso)
t)
(error nil))
(string-match "\\([0-9][0-9][0-9][0-9]\\)-\\([0-9][0-9]\\)-\\([0-9][0-9]\\) \\([0-9][0-9]\\):\\([0-9][0-9]\\):\\([0-9][0-9]\\) \\([-+][0-9][0-9]\\)?\\([0-9][0-9]\\)?"
(aux-item->data mx-date)))
(let* ((secs (string-to-number (match-string 6 (aux-item->data mx-date))))
(mins (string-to-number (match-string 5 (aux-item->data mx-date))))
(hour (string-to-number (match-string 4 (aux-item->data mx-date))))
(mday (string-to-number (match-string 3 (aux-item->data mx-date))))
(mon (string-to-number (match-string 2 (aux-item->data mx-date))))
(year (string-to-number (match-string 1 (aux-item->data mx-date))))
(tzhr (match-string 7 (aux-item->data mx-date)))
(tzmin (or (match-string 8 (aux-item->data mx-date)) ""))
(wday (elt
(calendar-iso-from-absolute
(calendar-absolute-from-gregorian
(list mon mday year)))
1)))
(lyskom-create-time secs mins hour mday (1- mon) (- year 1900) wday 0 nil tzhr tzmin))))
;;; Local Variables:
;;; eval: (put 'lyskom-traverse 'lisp-indent-hook 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment