Commit 808aedf7 authored by David Byers's avatar David Byers
Browse files

Fixed bug 950.

Detailed changes:
> 	Fix bug 950:
> 	* names.el (lyskom-nameday): Allow a list of nameday lists.
> 	(lyskom-nameday-2): Added parameter show-list-name.
>
> 	* option-edit.el (lyskom-custom-variables): Support lists for
> 	kom-show-namedays.
>
parent b285f3da
2003-04-05 David Byers <david.byers@swipnet.se>
Fix bug 950:
* names.el (lyskom-nameday): Allow a list of nameday lists.
(lyskom-nameday-2): Added parameter show-list-name.
* option-edit.el (lyskom-custom-variables): Support lists for
kom-show-namedays.
Fix bug 1003:
* lyskom-rest.el (lyskom-beep): Handle conf-stat and uconf-stat
type optargs, or kom-ding-on-group-messages and stuff won't work.
......
......@@ -1873,8 +1873,8 @@ environment to one that uses \"%#2s\" to encode text.
")
(has-nameday-1 . "Today's name is %#1s.")
(has-nameday-2 . "Today's names are %#1s and %#2s.")
(has-nameday-1 . "Today's name is %#1s%#2?b%[ (%#2s)%]%[%].")
(has-nameday-2 . "Today's names are %#1s and %#2s%#3?b%[ (%#3s)%]%[%].")
(invalid-date-entry . "Invalid date")
(number-out-of-range . "Invalid number")
......@@ -2875,7 +2875,8 @@ Select whether to execute command or keyboard macro.")
(url-transform-newtext . " To:")
(default-namedays . "Namedays for current language")
(specific-namedays . "Specific name list:")
(specific-namedays . "Specific name list")
(several-name-lists . "Several name lists")
(link-pattern-for . "Link patterns for")
(all-conferences . "All recipients")
......
......@@ -59,23 +59,33 @@ DATA is nameday data"
(defun lyskom-nameday (&optional now)
(cond ((eq kom-show-namedays t) (lyskom-nameday-2 lyskom-language now))
((symbolp kom-show-namedays) (lyskom-nameday-2 kom-show-namedays now))
((listp kom-show-namedays)
(mapconcat (lambda (x) (lyskom-nameday-2 x now t))
kom-show-namedays "\n"))
(t nil)))
(defun lyskom-nameday-2 (sym now)
(defun lyskom-nameday-2 (sym now &optional show-list-name)
(let* ((time (or now (lyskom-current-server-time)))
(data (cdr (assq sym lyskom-namedays)))
(alist (and data (nameday-data->data data)))
(mlist (cdr (assq (time->mon time) alist)))
(dlist (cdr (assq (time->mday time) mlist))))
(cond ((null dlist) nil)
((eq 1 (length dlist))
(lyskom-format 'has-nameday-1 (car dlist)))
((eq 2 (length dlist))
(lyskom-format 'has-nameday-2
(elt dlist 0) (elt dlist 1)))
(t (lyskom-format 'has-nameday-2
(mapconcat 'identity (lyskom-butlast dlist 1) ", ")
(elt dlist (1- (length dlist))))))))
(if data
(cond ((null dlist) nil)
((eq 1 (length dlist))
(lyskom-format 'has-nameday-1
(car dlist)
(and show-list-name (nameday-data->name data))))
((eq 2 (length dlist))
(lyskom-format 'has-nameday-2
(elt dlist 0)
(elt dlist 1)
(and show-list-name (nameday-data->name data))))
(t (lyskom-format 'has-nameday-2
(mapconcat 'identity (lyskom-butlast dlist 1) ", ")
(elt dlist (1- (length dlist)))
(and show-list-name (nameday-data->name data)))))
"")))
......
......@@ -741,6 +741,10 @@ customize buffer but do not save them to the server."
(kom-ispell-dictionary (ispell-dictionary))
(kom-show-namedays (choice ((const (off nil))
(const (default-namedays t))
(repeat (nameday nil :format "%[%t%]: `%v'\n" :tag specific-namedays)
:tag several-name-lists
:menu-tag several-name-lists
:indent 4)
(nameday nil :tag specific-namedays))))
(kom-show-week-number (toggle (on off)))
......
......@@ -1907,8 +1907,8 @@ teckenkodning.
")
(has-nameday-1 . "%#1s har namnsdag i dag.")
(has-nameday-2 . "%#1s och %#2s har namnsdag i dag.")
(has-nameday-1 . "%#1s har namnsdag i dag%#2?b%[ (%#2s)%]%[%].")
(has-nameday-2 . "%#1s och %#2s har namnsdag i dag%#3?b%[ (%#3s)%]%[%].")
(invalid-date-entry . "Ogiltigt datum")
(number-out-of-range . "Otilltet tal")
......@@ -2991,7 +2991,8 @@ teckenkodning.
(url-transform-newtext . " Till:")
(default-namedays . "Namnsdagar fr aktuellt sprk")
(specific-namedays . "Specifik namnlngd:")
(specific-namedays . "Specifik namnlngd")
(several-name-lists . "Flera namnlngder")
(link-pattern-for . "Mnster fr")
(all-conferences . "Alla mottagare")
......
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