Commit 32c4deda authored by David Byers's avatar David Byers
Browse files

Display week number in kom-display-time

parent a8b466fa
1999-08-14 David Byers <davby@ida.liu.se>
* vars.el.in (kom-show-week-number): New variable.
* commands1.el (kom-display-time): If calendar and cal-iso are
available we can show the week number.
1999-08-13 David Byers <davby@ida.liu.se>
* commands1.el (lyskom-try-add-member): Added optional message
......
......@@ -7,9 +7,8 @@ Att g
listan, glöm inte att ta bort det från listan!
Se tiden borde kunna visa veckonummer.
ceder sez att vid återse omodifierat borde man visa aux-items
(creating-software) som man normalt skulle skippa.
Kolla strängar där noll är passivt medlemskap.
......
......@@ -1697,21 +1697,39 @@ If MARK-NO is nil, review all marked texts."
(elt (lyskom-get-string 'weekdays)
(time->wday time))))
(lyskom-external-function calendar-iso-from-absolute)
(lyskom-external-function calendar-absolute-from-gregorian)
(def-kom-command kom-display-time ()
"Ask server about time and date."
(interactive)
(let ((time (blocking-do 'get-time))
(lyskom-last-text-format-flags nil))
(lyskom-format-insert 'time-is
(lyskom-format-time time)
;; Kult:
(if (and (= (time->hour time)
(+ (/ (time->sec time) 10)
(* (% (time->sec time) 10) 10)))
(= (/ (time->min time) 10)
(% (time->min time) 10)))
(lyskom-get-string 'palindrome)
""))
(lyskom-last-text-format-flags nil)
(weekno nil))
(lyskom-format-insert
(if kom-show-week-number
(condition-case nil
(progn (require 'calendar)
(require 'cal-iso)
(setq weekno
(car (calendar-iso-from-absolute
(calendar-absolute-from-gregorian
(list (1+ (time->mon time))
(time->mday time)
(+ 1900 (time->year time)))))))
'time-is-week)
(error 'time-is))
'time-is)
(lyskom-format-time time)
;; Kult:
(if (and (= (time->hour time)
(+ (/ (time->sec time) 10)
(* (% (time->sec time) 10) 10)))
(= (/ (time->min time) 10)
(% (time->min time) 10)))
(lyskom-get-string 'palindrome)
"")
weekno)
;; Mera kult
(mapcar (function
(lambda (el)
......
......@@ -330,7 +330,7 @@ du har l
(new-passwd . "Mata in det nya lsenordet: ")
(changing-passwd . "ndrar lsenordet...")
(retype-dont-match . "Lsenorden r inte samma. Gr om.\n")
(palindrome . "(en palindrom!) ")
(palindrome . " (en palindrom!)")
(lyskom-name . "Anvndare")
(is-in-conf . "Nrvarande i mte")
(from-machine . "Kr frn")
......@@ -395,7 +395,8 @@ du har l
(weekdays . ["sndag" "mndag" "tisdag" "onsdag" "torsdag"
"fredag" "lrdag" "sndag"])
(weekdays-short . ["sn" "mn" "tis" "ons" "tor" "fre" "lr" "sn"])
(time-is . "Det r %#1s %#2s(enligt servern).")
(time-is . "Det r %#1s%#2s (enligt servern).")
(time-is-week . "Det r %#1s%#2s, vecka %#3d (enligt servern).")
(time-format-exact . "%#7s %4#1d-%02#2d-%02#3d %02#4d:%02#5d:%02#6d")
(xmaseve . "\nJulafton! Har du ppnat dina julklappar n?")
......
......@@ -182,6 +182,10 @@ enabled mode."
"*Format of the LysKOM prompt when executing a command anonymously."
server)
(def-kom-var kom-show-week-number t
"*If non-nil show the ISO week number when displaying the time."
server)
(def-kom-var kom-cite-string ">"
"*String to insert before each line of a commented text."
......
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