Commit ce6f1168 authored by David Byers's avatar David Byers
Browse files

Localized dates in various printouts

parent 79afadfe
1999-10-11 David Byers <davby@ida.liu.se>
Replaced all uses of current-time-string with lyskom-client-date
* async.el (lyskom-format-as-personal-message): Print localized
form of date in async messages.
* utilities.el (lyskom-client-date): New function.
* ansaphone.el (kom-toggle-auto-reply): Use
lyskom-client-date-string instead of current-time-string.
(lyskom-ansaphone-record-message): Same here.
* remote-control.el (lyskom-remote-set-message): Use
lyskom-client-date-string instead of current-time-string.
(lyskom-remote-handler): Same here.
(lyskom-remote-autoreply): Same here.
(lyskom-remote-list-messages-1): Same here.
* option-edit.el: Added several missing variables to widget
definitions and buffer format.
......
......@@ -78,7 +78,7 @@
'state-off)))
(if kom-ansaphone-on
(progn
(setq lyskom-ansaphone-when-set (current-time-string))
(setq lyskom-ansaphone-when-set (lyskom-client-date-string))
(lyskom-format-insert (lyskom-get-string-sol 'ansaphone-message)
kom-ansaphone-default-reply))))
......@@ -217,7 +217,7 @@ kom-ansaphone-default-reply and kom-ansaphone-replies."
(if (not (numberp recipient))
(setq recipient (conf-stat->conf-no recipient)))
(setq lyskom-ansaphone-messages (cons (list sender recipient text
(current-time-string))
(lyskom-client-date))
lyskom-ansaphone-messages)))
......
......@@ -430,7 +430,7 @@ Args: SENDER: conf-stat for the person issuing the broadcast message or a
RECIPIENT: 0 if this message is for everybody, otherwise the conf-stat
of the recipient.
MESSAGE: A string containing the message.
WHEN: Optional time of arrival. Same format as (current-time-string)
WHEN: Optional time of arrival. A lyskom time structure.
NOBEEP: True means don't beep. No matter what."
(lyskom-insert-personal-message sender recipient message when nobeep)
(setq lyskom-last-personal-message-sender
......@@ -452,8 +452,8 @@ Arguments: SENDER RECIPIENT MESSAGE.
SENDER is a conf-stat (possibly nil) or a string.
RECIPIENT is 0 if the message is public, otherwise the pers-no of the user.
MESSAGE is a string containing the message.
WHEN, if given, is the time when the message arrived. It must be of the same
format at (current-time-string)
WHEN, if given, is the time when the message arrived. It must be a lyskom
time structure.
Non-nil NOBEEP means don't beep."
(lyskom-handle-as-personal-message
(lyskom-format-as-personal-message sender recipient message when nobeep)
......@@ -469,17 +469,25 @@ Arguments: SENDER RECIPIENT MESSAGE.
SENDER is a conf-stat (possibly nil) or a string.
RECIPIENT is 0 if the message is public, otherwise the pers-no of the user.
MESSAGE is a string containing the message.
WHEN, if given, is the time when the message arrived. It must be of the same
format at (current-time-string)
WHEN, if given, is the time when the message arrived. It must be a lyskom
time structure.
Non-nil NOBEEP means don't beep."
(let ((lyskom-last-text-format-flags nil))
(if (null when)
(setq when (current-time-string)))
(let ((lyskom-last-text-format-flags nil)
(now (lyskom-client-date)))
(when (null when) (setq when (lyskom-client-date)))
(if (or kom-show-personal-message-date
(not (string= (substring when 0 10)
(substring (current-time-string) 0 10))))
(setq when (substring when 4 19))
(setq when (substring when 11 19)))
(not (eq (time->mday when) (time->mday now)))
(not (eq (time->mon when) (time->mon now)))
(not (eq (time->year when) (time->year now))))
(setq when (lyskom-format 'time-yyyy-mm-dd-hh-mm
(time->year when)
(time->mon when)
(1+ (time->mday when))
(time->hour when)
(time->min when)))
(setq when (lyskom-format 'time-hh-mm
(time->hour when)
(time->min when))))
(setq nobeep (or nobeep (and kom-ansaphone-on
kom-silent-ansaphone)))
......
......@@ -778,6 +778,7 @@ Help: \\[describe-mode] ---")
; used by lyskom-print-time
(time-y-m-d-h-m . "%4#1d %02#3d/%02#2d %02#4d:%02#5d ")
(time-hh-mm . "%02#1d:%02#2d")
(today-time-format-string . "%#6s %02#4d:%02#5d")
(yesterday-time-format-string . "%#6s %02#4d:%02#5d")
(today . "today")
......
......@@ -3035,7 +3035,8 @@ If MEMBERSHIPs prioriy is 0, it always returns nil."
(delq proc lyskom-sessions-with-unread))
(set-buffer (process-buffer proc))
(lyskom-start-of-command (lyskom-get-string 'process-signal) t)
(lyskom-format-insert 'closed-connection sentinel (current-time-string))
(lyskom-format-insert 'closed-connection sentinel
(lyskom-client-date-string 'time-format-exact))
(setq mode-line-process (lyskom-get-string 'mode-line-down))
(beep)
(lyskom-scroll))
......
......@@ -51,59 +51,59 @@
(defvar lyskom-customize-buffer-format
'("\n"
(lyskom bold centered)
"\n\n"
lyskom-doc
"\n\n"
[kom-customize-format]
"\n\n"
section
(look-and-feel-misc bold centered)
section
"\n"
[kom-default-language]
[kom-show-namedays]
[kom-show-week-number]
"\n"
[kom-idle-hide]
[kom-show-where-and-what]
[kom-show-since-and-when]
"\n"
[kom-friends]
"\n"
[kom-presence-messages]
[kom-presence-messages-in-buffer]
"\n"
[kom-page-before-command]
[kom-agree-text]
"\n\n"
section
(window-locations bold centered)
section
"\n"
(windows-where bold centered)
"\n"
windows-doc
"\n\n"
[kom-customize-in-window]
[kom-edit-filters-in-window]
[kom-prioritize-in-window]
[kom-list-membership-in-window]
[kom-write-texts-in-window]
[kom-view-commented-in-window]
[kom-personal-messages-in-window]
"\n\n"
section
(audio-cues bold centered)
section
"\n"
[kom-audio-player]
"\n"
(audio-cues-when bold centered)
"\n"
audio-cues-doc
"\n\n"
; (lyskom bold centered)
; "\n\n"
; lyskom-doc
; "\n\n"
; [kom-customize-format]
; "\n\n"
; section
; (look-and-feel-misc bold centered)
; section
; "\n"
; [kom-default-language]
; [kom-show-namedays]
; [kom-show-week-number]
; "\n"
; [kom-idle-hide]
; [kom-show-where-and-what]
; [kom-show-since-and-when]
; "\n"
; [kom-friends]
; "\n"
; [kom-presence-messages]
; [kom-presence-messages-in-buffer]
; "\n"
; [kom-page-before-command]
; [kom-agree-text]
; "\n\n"
; section
; (window-locations bold centered)
; section
; "\n"
; (windows-where bold centered)
; "\n"
; windows-doc
; "\n\n"
; [kom-customize-in-window]
; [kom-edit-filters-in-window]
; [kom-prioritize-in-window]
; [kom-list-membership-in-window]
; [kom-write-texts-in-window]
; [kom-view-commented-in-window]
; [kom-personal-messages-in-window]
;
; "\n\n"
; section
; (audio-cues bold centered)
; section
; "\n"
; [kom-audio-player]
; "\n"
; (audio-cues-when bold centered)
; "\n"
; audio-cues-doc
; "\n\n"
[kom-ding-on-priority-break]
[kom-ding-on-new-letter]
[kom-ding-on-wait-done]
......@@ -111,102 +111,102 @@
[kom-ding-on-common-messages]
[kom-ding-on-group-messages]
[kom-ding-on-personal-messages]
[kom-silent-ansaphone]
"\n\n"
section
(reading bold centered)
section
"\n"
[kom-default-session-priority]
[kom-print-number-of-unread-on-entrance]
[kom-allow-incompleteness]
[kom-created-texts-are-read]
[kom-higher-priority-breaks]
[kom-review-priority]
[kom-show-footnotes-immediately]
[kom-follow-comments-outside-membership]
"\n"
[kom-default-mark]
[kom-membership-default-priority]
[kom-membership-default-placement]
[kom-unsubscribe-makes-passive]
[kom-postpone-default]
"\n"
[kom-autowrap]
[kom-show-author-at-end]
[kom-show-creating-software]
[kom-show-imported-importer]
[kom-show-imported-external-recipients]
[kom-show-imported-envelope-sender]
[kom-smileys]
"\n"
[kom-dashed-lines]
[kom-long-lines]
[kom-text-footer-format]
[kom-text-header-dash-length]
[kom-text-footer-dash-length]
"\n"
[kom-truncate-threshold]
[kom-truncate-show-lines]
"\n"
[kom-ignore-message-senders]
[kom-ignore-message-recipients]
[kom-show-personal-message-date]
"\n\n"
section
(writing bold centered)
section
"\n"
[kom-cite-string]
[kom-ispell-dictionary]
"\n"
sending-doc
"\n\n"
[kom-confirm-multiple-recipients]
[kom-check-commented-author-membership]
[kom-check-for-new-comments]
"\n\n"
section
(urls bold centered)
section
"\n"
[kom-url-viewer-preferences]
[kom-mosaic-command]
[kom-netscape-command]
"\n\n"
section
(personal-messages bold centered)
section
"\n"
[kom-show-personal-messages-in-buffer]
[kom-pop-personal-messages]
[kom-default-message-recipient]
"\n"
(automatic-replies bold centered)
"\n"
[kom-ansaphone-record-messages]
[kom-ansaphone-show-messages]
"\n"
[kom-ansaphone-default-reply]
"\n\n"
section
(remote-control bold centered)
section
"\n"
[kom-remote-control]
[kom-self-control]
"\n"
[kom-remote-controllers]
"\n\n"
section
(hooks bold centered)
section
"\n"
[kom-login-hook]
[kom-do-when-done]
; [kom-silent-ansaphone]
; "\n\n"
; section
; (reading bold centered)
; section
; "\n"
; [kom-default-session-priority]
; [kom-print-number-of-unread-on-entrance]
; [kom-allow-incompleteness]
; [kom-created-texts-are-read]
; [kom-higher-priority-breaks]
; [kom-review-priority]
; [kom-show-footnotes-immediately]
; [kom-follow-comments-outside-membership]
; "\n"
; [kom-default-mark]
; [kom-membership-default-priority]
; [kom-membership-default-placement]
; [kom-unsubscribe-makes-passive]
; [kom-postpone-default]
; "\n"
; [kom-autowrap]
; [kom-show-author-at-end]
; [kom-show-creating-software]
; [kom-show-imported-importer]
; [kom-show-imported-external-recipients]
; [kom-show-imported-envelope-sender]
; [kom-smileys]
; "\n"
; [kom-dashed-lines]
; [kom-long-lines]
; [kom-text-footer-format]
; [kom-text-header-dash-length]
; [kom-text-footer-dash-length]
; "\n"
; [kom-truncate-threshold]
; [kom-truncate-show-lines]
; "\n"
; [kom-ignore-message-senders]
; [kom-ignore-message-recipients]
; [kom-show-personal-message-date]
; "\n\n"
; section
; (writing bold centered)
; section
; "\n"
; [kom-cite-string]
; [kom-ispell-dictionary]
; "\n"
; sending-doc
; "\n\n"
; [kom-confirm-multiple-recipients]
; [kom-check-commented-author-membership]
; [kom-check-for-new-comments]
;
; "\n\n"
; section
; (urls bold centered)
; section
; "\n"
; [kom-url-viewer-preferences]
; [kom-mosaic-command]
; [kom-netscape-command]
;
; "\n\n"
; section
; (personal-messages bold centered)
; section
; "\n"
; [kom-show-personal-messages-in-buffer]
; [kom-pop-personal-messages]
; [kom-default-message-recipient]
; "\n"
; (automatic-replies bold centered)
; "\n"
; [kom-ansaphone-record-messages]
; [kom-ansaphone-show-messages]
; "\n"
; [kom-ansaphone-default-reply]
;
; "\n\n"
; section
; (remote-control bold centered)
; section
; "\n"
; [kom-remote-control]
; [kom-self-control]
; "\n"
; [kom-remote-controllers]
; "\n\n"
; section
; (hooks bold centered)
; section
; "\n"
; [kom-login-hook]
; [kom-do-when-done]
))
;;; ======================================================================
......@@ -877,7 +877,36 @@ customize buffer but do not save them to the server."
(list 'lyskom-string
':tag (lyskom-custom-string 'sound-file)
':help-echo (lyskom-custom-string 'select-audio-file)
':size 0))))
':size 0)
(list 'editable-list
':format "%[%t%]\n%v%i"
':indent 4
':tag (lyskom-custom-string 'specific-spec)
':menu-tag (lyskom-custom-string 'specific-spec)
':args
`((cons number number))
; :value (1 . 1)
; `(lyskom-name :tag ,(lyskom-custom-string 'conf-of-person))
; `(menu-choice
; :case-fold t
; :format "%[%t%] %v"
; :args
; `((item :tag ,(lyskom-custom-string 'turned-off)
; :value nil
; :format "%t"
; :match (lambda (w v) (or (null v) (eq v 0))))
; (lyskom-number :tag ,(lyskom-custom-string 'number-of-times)
; :help-echo ,(lyskom-custom-string 'select-number)
; :value "1"
; :format "%[%t%]: (%v)"
; :size 0
; :min-value 1
; :max-value 255)
; (lyskom-string :tag ,(lyskom-custom-string 'sound-file)
; :help-echo ,(lyskom-custom-string 'select-audio-file)
; :size 0)))))
)
)))
(defun lyskom-toggle-widget-inverse (type &optional args propl)
(list 'menu-choice
......
......@@ -192,7 +192,7 @@ Handler to implement remote control of the ansaphone."
(lyskom-ansaphone-send-message
lyskom-pers-no
(lyskom-format (lyskom-get-string 'illegal-remote)
(current-time-string)
(lyskom-client-date-string)
sender
recipient
text))
......@@ -229,7 +229,7 @@ Handler to implement remote control of the ansaphone."
(if arg
(let ((lyskom-last-text-format-flags nil))
(setq kom-ansaphone-default-reply arg)
(setq lyskom-ansaphone-when-set (current-time-string))
(setq lyskom-ansaphone-when-set (lyskom-client-date-string))
(lyskom-ansaphone-send-message sender
(concat
(lyskom-get-string
......@@ -238,7 +238,7 @@ Handler to implement remote control of the ansaphone."
(lyskom-insert-before-prompt
(lyskom-format (lyskom-get-string-sol 'remote-set-message)
sender
(current-time-string)
(lyskom-client-date-string)
arg))
nil)
'remote-bad-command))
......@@ -263,7 +263,7 @@ Handler to implement remote control of the ansaphone."
(lyskom-insert-before-prompt
(lyskom-format (lyskom-get-string 'remote-set-ansaphone)
sender
(current-time-string)
(lyskom-client-date-string)
(lyskom-get-string (if kom-ansaphone-on
'state-on 'state-off))))
nil)
......@@ -305,7 +305,7 @@ Handler to implement remote control of the ansaphone."
(lyskom-insert-before-prompt
(lyskom-format (lyskom-get-string 'remote-list-messages)
sender
(current-time-string)))))
(lyskom-client-date-string)))))
......@@ -313,11 +313,10 @@ Handler to implement remote control of the ansaphone."
(defun lyskom-remote-erase-messages (arg sender recipient text)
(setq lyskom-ansaphone-messages nil)
(lyskom-insert-before-prompt
(lyskom-format
(lyskom-format-insert-before-prompt
(lyskom-get-string 'remote-erase-messages)
sender
(current-time-string)))
(lyskom-client-date-string))
nil)
......@@ -325,7 +324,7 @@ Handler to implement remote control of the ansaphone."
(lyskom-insert-before-prompt
(lyskom-format (lyskom-get-string 'remote-quit)
sender
(current-time-string)))
(lyskom-client-date-string)))
(lyskom-quit))
......
......@@ -787,6 +787,7 @@ Annat se \\[describe-mode] ---")
;; used by lyskom-print-time
(time-y-m-d-h-m . "%4#1d-%02#2d-%02#3d %02#4d:%02#5d ")
(time-hh-mm . "%02#1d:%02#2d")
(today-time-format-string . "%#6s %02#4d:%02#5d")
(yesterday-time-format-string . "%#6s %02#4d:%02#5d")
(today . "idag")
......@@ -2091,8 +2092,10 @@ Du m
(turned-off . "Avslaget ")
(number-of-times . "Ngra gnger")
(specific-spec . "Per mottager/avsndare")
(sound-file . "Ljudfil")
(selected-mark . "Markering")
(conf-or-person . "Person eller mte")
(ask . "Frga varje gng")
(before . "Fre texten")
(after . "Efter texten")
......
......@@ -564,6 +564,25 @@ name of the day of week."
(elt (lyskom-get-string 'weekdays-short)
(elt now 6)))))
(defun lyskom-client-date ()
"Format the current client time as a string.
The optional format string FMT specifies the format. If no format string
is supplied time-yyyy-mm-dd-hh-mm is used. The arguments to the format
string are the following: the year, the month, the day, the hour, the
minutes, the seconds, the full name of the day of week, the abbreviated
name of the day of week."
(let ((now (decode-time)))
(lyskom-create-time (elt now 0) ;sec
(elt now 1) ;min
(elt now 2) ;hour
(elt now 3) ;mday
(elt now 4) ;mon
(- (elt now 5) 1900) ;year
(elt now 6) ;wday
0 ;yday
(elt now 7)
)))
;;; ============================================================
;;; Keymap utilities
......
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