Commit 101a3b8e authored by David Byers's avatar David Byers
Browse files

Changed defaults for lyskom-read-conf.

Detailed changes:
> 2003-08-02  David Byers  <byers@lysator.liu.se>
>
> 	Coherent and useful defaults reading conference names:
> 	* filter.el (kom-filter-subject): Don't set default when reading
> 	conference name (the default default is better). Also cleaned up
> 	the code some (it was downright embarrasing).
> 	(kom-filter-author): Same here (sans the cleaning).
> 	(kom-filter-text): Same here.
>
> 	* edit-text.el (lyskom-edit-add-recipient/copy): Don't set default
> 	when reading conference name (the default default is better).
>
> 	* faqs.el (kom-review-faq): Don't set default when reading
> 	conference name (the default default is better).
> 	(kom-change-conf-faq): Same here.
> 	(kom-list-faqs): Same here.
>
> 	* review.el (lyskom-review-by-to): Don't set default when reading
> 	conference name (the default default is better).
> 	(lyskom-unread-by-to): Same here.
>
> 	* commands2.el (kom-status-person): Don't set default when reading
> 	conference name (the default default is better).
> 	(kom-send-message): Fall back to the default default when reading
> 	recipient name (better than the empty string, I think).
>
> 	* commands1.el (kom-write-text): Don't set default when reading
> 	conference name (the default default is better).
> 	(kom-review-presentation): Pass nil as the initial for
> 	lyskom-read-conf-stat.
> 	(kom-unread-presentation): Same here.
> 	(kom-add-self): Same here.
> 	(kom-change-priority): Same here.
> 	(kom-sub-member): Same here.
> 	(kom-sub-self): Same here.
> 	(kom-go-to-conf): Same here.
> 	(kom-list-created-conferences): Same here.
> 	(kom-change-password): Same here.
> 	(kom-who-is-on-in-conference): Same here.
> 	(kom-who-is-present-in-conference): Same here.
> 	(kom-change-parenthesis): Pass lyskom-pers-no in initial.
> 	(kom-sub-recipient): Use default INITIAL if no better choice is
> 	found.
> 	(lyskom-add-helper): Same here.
> 	(kom-move-text): Same here.
> 	(kom-move-text-tree): Same here.
>
> 	* command.el (def-kom-command): Added binding of
> 	lyskom-command-point.
>
> 	* completing-read.el (lyskom-read-conf): Handle loads of different
> 	types for INITIAL.
> 	(lyskom-read-conf-guess-initial): New function that guesses a
> 	default for conference reading commands. The default is the first
> 	that fits the predicate of the conference under point, the current
> 	conference and the current person.
>
parent 8796ad45
2003-08-02 David Byers <byers@lysator.liu.se>
Coherent and useful defaults reading conference names:
* filter.el (kom-filter-subject): Don't set default when reading
conference name (the default default is better). Also cleaned up
the code some (it was downright embarrasing).
(kom-filter-author): Same here (sans the cleaning).
(kom-filter-text): Same here.
* edit-text.el (lyskom-edit-add-recipient/copy): Don't set default
when reading conference name (the default default is better).
* faqs.el (kom-review-faq): Don't set default when reading
conference name (the default default is better).
(kom-change-conf-faq): Same here.
(kom-list-faqs): Same here.
* review.el (lyskom-review-by-to): Don't set default when reading
conference name (the default default is better).
(lyskom-unread-by-to): Same here.
* commands2.el (kom-status-person): Don't set default when reading
conference name (the default default is better).
(kom-send-message): Fall back to the default default when reading
recipient name (better than the empty string, I think).
* commands1.el (kom-write-text): Don't set default when reading
conference name (the default default is better).
(kom-review-presentation): Pass nil as the initial for
lyskom-read-conf-stat.
(kom-unread-presentation): Same here.
(kom-add-self): Same here.
(kom-change-priority): Same here.
(kom-sub-member): Same here.
(kom-sub-self): Same here.
(kom-go-to-conf): Same here.
(kom-list-created-conferences): Same here.
(kom-change-password): Same here.
(kom-who-is-on-in-conference): Same here.
(kom-who-is-present-in-conference): Same here.
(kom-change-parenthesis): Pass lyskom-pers-no in initial.
(kom-sub-recipient): Use default INITIAL if no better choice is
found.
(lyskom-add-helper): Same here.
(kom-move-text): Same here.
(kom-move-text-tree): Same here.
* command.el (def-kom-command): Added binding of
lyskom-command-point.
* completing-read.el (lyskom-read-conf): Handle loads of different
types for INITIAL.
(lyskom-read-conf-guess-initial): New function that guesses a
default for conference reading commands. The default is the first
that fits the predicate of the conference under point, the current
conference and the current person.
2003-07-31 David Byers <byers@lysator.liu.se>
Make moving memberships work again:
......
......@@ -79,18 +79,19 @@
`(defun ,cmd ,args
,doc
,(lyskom-fix-interactive-decl interactive-decl cmd)
(lyskom-start-of-command ',cmd)
(let ((,bufsym (current-buffer)))
(unwind-protect
(condition-case nil
(progn ,@forms)
(quit (ding)
(lyskom-insert-before-prompt
(lyskom-get-string 'interrupted))))
(lyskom-save-excursion
(when (buffer-live-p ,bufsym)
(set-buffer ,bufsym))
(lyskom-end-of-command)))))))
(let ((lyskom-command-point (point)))
(lyskom-start-of-command ',cmd)
(let ((,bufsym (current-buffer)))
(unwind-protect
(condition-case nil
(progn ,@forms)
(quit (ding)
(lyskom-insert-before-prompt
(lyskom-get-string 'interrupted))))
(lyskom-save-excursion
(when (buffer-live-p ,bufsym)
(set-buffer ,bufsym))
(lyskom-end-of-command))))))))
;;
;; def-kom-emacs-command works like def-kom-command, but the template
......
......@@ -196,7 +196,7 @@ This command accepts text number prefix arguments (see
(lyskom-read-conf-stat
(lyskom-get-string 'presentation-for-whom)
'(all)
nil "" t))))
nil nil t))))
(lyskom-review-presentation conf-stat)))
(def-kom-command kom-unread-presentation (&optional text-or-conf-no)
......@@ -219,8 +219,7 @@ This command accepts text number prefix arguments (see
text-or-conf-no))
(lyskom-read-conf-stat
(lyskom-get-string 'unread-presentation-for-whom)
'(all)
nil "" t))))
'(all) nil nil t))))
(if (zerop (conf-stat->presentation conf-stat))
(lyskom-format-insert 'has-no-presentation conf-stat)
(lyskom-format-insert 'marking-text-unread
......@@ -552,7 +551,7 @@ See `kom-membership-default-priority' and
(let* ((whereto (if conf (blocking-do 'get-conf-stat conf)
(lyskom-read-conf-stat
(lyskom-get-string 'where-to-add-self)
'(all) nil "" t)))
'(all) nil nil t)))
(mship (lyskom-is-member (conf-stat->conf-no whereto)
lyskom-pers-no)))
......@@ -613,7 +612,7 @@ the priority of several memberships, use `kom-prioritize' instead."
(let* ((conf-stat (if conf (blocking-do 'get-conf-stat conf)
(lyskom-read-conf-stat
(lyskom-get-string 'change-priority-for-q)
'(all) nil "" t)))
'(all) nil nil t)))
(mship (lyskom-get-membership (conf-stat->conf-no conf-stat) t))
(kom-membership-default-priority nil))
(blocking-do-multiple ((who (get-conf-stat lyskom-pers-no))
......@@ -884,9 +883,9 @@ supervisor of the conference or of the member being removed."
(interactive)
(lyskom-sub-member
(lyskom-read-conf-stat (lyskom-get-string 'who-to-exclude)
'(pers) nil "" t)
'(pers) nil nil t)
(lyskom-read-conf-stat (lyskom-get-string 'where-from-exclude)
'(all) nil "" t)))
'(all) nil nil t)))
(def-kom-command kom-sub-self (&optional conf)
......@@ -902,17 +901,7 @@ See `kom-unsubscribe-makes-passive'."
(blocking-do 'get-conf-stat lyskom-pers-no)
(if conf (blocking-do 'get-conf-stat conf)
(lyskom-read-conf-stat (lyskom-get-string 'leave-what-conf)
'(membership) nil
(let ((ccn
(if (or (null lyskom-current-conf)
(zerop lyskom-current-conf))
""
(conf-stat->name
(blocking-do 'get-conf-stat
lyskom-current-conf)))))
(if ccn
(cons ccn 0)
"")) t))))
'(membership) nil nil t))))
(defun lyskom-sub-member (pers conf &optional have-message)
"Remove the person indicated by PERS as a member of CONF."
......@@ -1716,7 +1705,7 @@ Changing conferences runs `kom-change-conf-hook' and
(blocking-do 'get-conf-stat conf-no)
(lyskom-read-conf-stat
(lyskom-get-string 'go-to-conf-p)
'(all) nil "" t))))
'(all) nil nil t))))
(when (lyskom-check-go-to-conf conf)
(lyskom-go-to-conf conf))))
......@@ -1846,7 +1835,7 @@ comment; `kom-confirm-multiple-recipients' affects how multiple
recipients are handled."
(interactive "P")
(lyskom-tell-internat 'kom-tell-write-text)
(lyskom-write-text arg 'who-send-text-to lyskom-current-conf))
(lyskom-write-text arg 'who-send-text-to nil))
(defun lyskom-write-text (arg prompt default)
"Start writing a new text."
......@@ -1956,12 +1945,7 @@ See `kom-allow-incompleteness'."
(blocking-do 'get-uconf-stat lyskom-pers-no)
(let ((pers (lyskom-read-conf-stat
(if arg 'list-pers-confs-created-by 'list-confs-created-by)
'(all)
nil
(if (cache-get-uconf-stat lyskom-pers-no)
(cons (uconf-stat->name (cache-get-uconf-stat lyskom-pers-no)) 0)1
nil)
t)))
'(all) nil nil t)))
(lyskom-format-insert 'listing-confs-created-by (conf-stat->conf-no pers))
(lyskom-message (lyskom-get-string (if arg 'getting-all-pers-confs 'getting-all-confs)))
(let ((result (blocking-do 'lookup-z-name "" (if arg 1 0) 1)))
......@@ -2211,12 +2195,7 @@ it easy to change this information."
(interactive)
(let ((conf-stat (lyskom-read-conf-stat
(lyskom-get-string 'name-to-be-changed)
'(all)
nil
(cons
(conf-stat->name (blocking-do 'get-conf-stat lyskom-pers-no))
0)
t)))
'(all) nil lyskom-pers-no t)))
(if (null conf-stat)
(lyskom-insert-string 'no-such-conf-or-pers)
(cond
......@@ -2535,7 +2514,7 @@ person you need either the old password for the person, or have
administrative privileges enabled."
(interactive)
(let ((pers-no (lyskom-read-conf-no (lyskom-get-string 'whos-passwd)
'(pers) t "" t))
'(pers) t nil t))
(old-pw (silent-read (lyskom-get-string 'old-passwd)))
(new-pw1 (silent-read (lyskom-get-string 'new-passwd)))
(new-pw2 (silent-read (lyskom-get-string 'new-passwd-again))))
......@@ -2707,17 +2686,7 @@ Several variables affect display. See `kom-show-where-and-what',
(interactive "P")
(let ((conf-stat
(lyskom-read-conf-stat (lyskom-get-string 'who-is-on-in-what-conference)
'(all) nil
(let ((ccn
(if (or (null lyskom-current-conf)
(zerop lyskom-current-conf))
""
(conf-stat->name
(blocking-do 'get-conf-stat
lyskom-current-conf)))))
(if ccn
(cons ccn 0)
"")) t)))
'(all) nil nil t)))
(condition-case nil
(if (lyskom-have-feature dynamic-session-info)
(lyskom-who-is-on-9 arg conf-stat)
......@@ -2747,17 +2716,7 @@ Several variables affect display. See `kom-show-where-and-what',
(interactive "P")
(let ((conf-stat
(lyskom-read-conf-stat (lyskom-get-string 'who-is-present-in-what-conference)
'(all) nil
(let ((ccn
(if (or (null lyskom-current-conf)
(zerop lyskom-current-conf))
""
(conf-stat->name
(blocking-do 'get-conf-stat
lyskom-current-conf)))))
(if ccn
(cons ccn 0)
"")) t)))
'(all) nil nil t)))
(condition-case nil
(if (lyskom-have-feature dynamic-session-info)
(lyskom-who-is-on-9 arg conf-stat t)
......@@ -3655,13 +3614,15 @@ This command accepts text number prefix arguments (see
'adding-name-as-copy
'BCC-RECPT))
(defun lyskom-add-helper (text-no last-variable who-prompt doing-prompt type)
(let* ((conf (blocking-do 'get-conf-stat (lyskom-default-value last-variable)))
(defun lyskom-add-helper (text-no last-variable who-prompt
doing-prompt type)
(let* ((conf (blocking-do 'get-conf-stat
(lyskom-default-value last-variable)))
(target (lyskom-read-conf-stat
(lyskom-get-string who-prompt)
'(all)
nil
(cons (if conf (conf-stat->name conf) "") 0)
(and conf (cons (conf-stat->name conf) 0))
t)))
(when (and target text-no)
......@@ -3708,7 +3669,7 @@ This command accepts text number prefix arguments (see
(lyskom-get-string 'who-to-sub-q)
(list (cons 'restrict (mapcar 'car recipients)))
nil
(cons (if conf (conf-stat->name conf) "") 0)
(and conf (cons (conf-stat->name conf) 0))
t)))
(when source
(lyskom-format-insert 'remove-name-as-recipient source text-no)
......@@ -3741,23 +3702,21 @@ recipient to remove and target the recipient to add to text-stat."
lyskom-current-conf))))
(if (null default-from)
(lyskom-format-insert 'text-has-no-recipients-r text-no)
(let ((source (lyskom-read-conf-stat 'who-to-move-from-q
(list
(cons 'restrict
(mapcar 'car
recipients)))
nil
(cons (if default-from
(conf-stat->name default-from)
"") 0)
t))
(target (lyskom-read-conf-stat 'who-to-move-to-q
'(all)
nil
(cons (if default-to
(conf-stat->name default-to)
"") 0)
t)))
(let ((source (lyskom-read-conf-stat
'who-to-move-from-q
(list (cons 'restrict
(mapcar 'car
recipients)))
nil
(and default-from
(cons (conf-stat->name default-from) 0))
t))
(target (lyskom-read-conf-stat
'who-to-move-to-q '(all)
nil
(and default-to
(cons (conf-stat->name default-to) 0))
t)))
(when (and source target)
(lyskom-format-insert 'moving-name source target text-stat)
(lyskom-set-default 'lyskom-last-added-rcpt (conf-stat->conf-no target))
......@@ -3797,9 +3756,8 @@ This command accepts text number prefix arguments (see
'who-to-move-from-q
(list (cons 'restrict (mapcar 'car recipients)))
nil
(cons (if default-from
(conf-stat->name default-from)
"") 0)
(and default-from
(cons (conf-stat->name default-from) 0))
t))
(to-do (list (text-stat->text-no root-text-stat)))
(done nil))
......@@ -3878,9 +3836,8 @@ This command accepts text number prefix arguments (see
'who-to-move-to-q)
'(all)
(> (length text-to-move-recipients) 1)
(cons (if default-to
(conf-stat->name default-to)
"") 0)
(and default-to
(cons (conf-stat->name default-to) 0))
t)))
(if target
(progn
......
......@@ -395,7 +395,7 @@ This command accepts text number prefix arguments \(see
(text-stat->author (blocking-do 'get-text-stat text-or-pers-no)))
text-or-pers-no
(lyskom-read-conf-no (lyskom-get-string 'pers-for-status)
'(pers) nil "" t)))
'(pers) nil nil t)))
(kom-print-seconds-in-time-strings nil)
conf-stat
pers-stat)
......@@ -610,7 +610,6 @@ See `kom-default-message-recipient'."
(if kom-permissive-completion
'(all)
'(login conf))
;; Initial string:
t
(cond
((eq kom-default-message-recipient 'everybody) nil)
......@@ -634,7 +633,7 @@ See `kom-default-message-recipient'."
(t
(if lyskom-last-personal-message-sender
(cons lyskom-last-personal-message-sender 0)
"")))
nil)))
t))))
(if (zerop target)
(lyskom-format-insert 'message-use-alarm-instead
......
......@@ -180,6 +180,23 @@ See lyskom-read-conf for a description of the parameters."
((lyskom-uconf-stat-p conf-z-info) (uconf-stat->name conf-z-info))
(t (conf-z-info->name conf-z-info)))))
(defun lyskom-read-conf-guess-initial (predicate)
"Return a guess for the initial value for lyskom-read-conf."
(let* ((pos (or lyskom-command-point (point)))
(type (and pos (get-text-property pos 'lyskom-button-type)))
(conf-nos (delq nil
(list (and (memq type '(conf pers))
(get-text-property pos 'lyskom-button-arg))
lyskom-current-conf
lyskom-pers-no))))
(lyskom-traverse conf-no conf-nos
(let ((uc (blocking-do 'get-uconf-stat conf-no)))
(when (lyskom-read-conf-internal-verify-type
conf-no (uconf-stat->conf-type uc)
predicate nil nil)
(lyskom-traverse-break (uconf-stat->name uc)))))))
(defun lyskom-read-conf (prompt type &optional empty initial mustmatch)
"Completing read a conference or person from the minibuffer.
......@@ -208,8 +225,24 @@ nil: Nothing was entered, or
A string: A name that matched nothing in the database."
(lyskom-completing-clear-cache)
(when (integerp initial)
(setq initial (conf-stat->name (blocking-do 'get-uconf-stat initial))))
(setq initial
(cond ((integerp initial)
(uconf-stat->name (blocking-do 'get-uconf-stat initial)))
((stringp initial) initial)
((lyskom-conf-stat-p initial)
(conf-stat->name initial))
((lyskom-uconf-stat-p initial)
(uconf-stat->name initial))
((lyskom-conf-z-info-p initial)
(conf-z-info->name initial))
((consp initial) initial)
((lyskom-read-conf-guess-initial type))
((and lyskom-current-conf
(not (eq lyskom-current-conf 0)))
(uconf-stat->name
(blocking-do 'get-uconf-stat lyskom-current-conf)))
(t nil)))
(let* ((completion-ignore-case t)
(minibuffer-local-completion-map
lyskom-minibuffer-local-completion-map)
......
......@@ -1284,7 +1284,7 @@ WHAT-TO-DO is a function to call to do the insertion.
RECPT-TYPE is the type of recipient to add."
(let ((edit-buffer (current-buffer))
(insert-at (point-min-marker))
(conf-stat (lyskom-read-conf-stat prompt '(all) nil "" t)))
(conf-stat (lyskom-read-conf-stat prompt '(all) nil nil t)))
(lyskom-save-excursion
(save-excursion
(set-buffer lyskom-buffer)
......
......@@ -83,7 +83,8 @@ a conference that doesn't have one, or change an existing FAQ, use
This command accepts text number prefix arguments \(see
`lyskom-read-text-no-prefix-arg')."
(interactive (list (lyskom-read-conf-no 'conf-to-add-faq '(conf pers) nil nil t)
(interactive (list (lyskom-read-conf-no 'conf-to-add-faq
'(conf pers) nil nil t)
(lyskom-read-text-no-prefix-arg 'text-to-add-as-faq nil 'last-seen-written)))
(lyskom-add-faq conf-no text-no))
......@@ -197,10 +198,7 @@ do this. To add a FAQ, use `kom-add-server-faq'."
(def-kom-command kom-review-faq (&optional conf-no)
"View the FAQs for a particular conference."
(interactive
(list
(let* ((conf-stat (blocking-do 'get-conf-stat lyskom-current-conf))
(initial (and conf-stat (cons (conf-stat->name conf-stat) 0))))
(lyskom-read-conf-no 'view-which-faq '(conf pers) t initial t))))
(list (lyskom-read-conf-no 'view-which-faq '(conf pers) t nil t)))
(if (zerop conf-no)
(lyskom-review-faq nil (server-info->aux-item-list
(blocking-do 'get-server-info)))
......@@ -212,10 +210,7 @@ do this. To add a FAQ, use `kom-add-server-faq'."
(def-kom-command kom-unread-faq (&optional conf-no)
"Marks the FAQs for a particular conference as unread."
(interactive
(list
(let* ((conf-stat (blocking-do 'get-conf-stat lyskom-current-conf))
(initial (and conf-stat (cons (conf-stat->name conf-stat) 0))))
(lyskom-read-conf-no 'unread-which-faq '(conf pers) t initial t))))
(list (lyskom-read-conf-no 'unread-which-faq '(conf pers) t nil t)))
(if (zerop conf-no)
(lyskom-unread-faq nil (server-info->aux-item-list
(blocking-do 'get-server-info)))
......@@ -281,13 +276,7 @@ create a new FAQ."
(interactive)
(let* ((conf-no (lyskom-read-conf-no
(lyskom-get-string 'what-to-change-faq-you)
'(conf pers)
nil
(cons (if lyskom-current-conf
(let ((tmp (blocking-do 'get-uconf-stat lyskom-current-conf)))
(if tmp (uconf-stat->name tmp) ""))
"") 0)
t))
'(conf pers) nil nil t))
(conf-stat (when conf-no ; Need this to make sure the conf-stat is up-to-date!
(cache-del-conf-stat conf-no)
(blocking-do 'get-conf-stat conf-no))))
......@@ -469,10 +458,7 @@ create a new FAQ."
(def-kom-command kom-list-faqs (conf-stat)
"List all FAQs for a conference."
(interactive (list (lyskom-read-conf-stat "Conference: "
'(conf)
nil
lyskom-current-conf
t)))
'(conf) nil nil t)))
(lyskom-do-list-faqs conf-stat
(lyskom-get-aux-item
(conf-stat->aux-items conf-stat)
......
......@@ -455,33 +455,24 @@ An alternative to this is `kom-super-jump'.
To change existing filters, use `kom-filter-edit'."
(interactive)
(if (/= 0 lyskom-current-conf)
(let ((conf-stat (blocking-do 'get-conf-stat lyskom-current-conf)))
(let (conf perm filter action)
(if (null subject)
(setq subject lyskom-current-subject))
(setq subject
(lyskom-read-from-minibuffer
(lyskom-get-string 'filter-subject)
subject))
(setq filter (cons (cons 'subject subject) filter))
(setq conf (lyskom-read-conf-no
(lyskom-get-string 'filter-in-conf)
'(all)
t
(or (and (conf-stat->conf-no conf-stat)
(cons (conf-stat->name conf-stat) 0))
"")
t))
(if (/= conf 0)
(setq filter (cons (cons 'recipient-no conf) filter)))
(setq action (lyskom-filter-read-action))
(setq perm (lyskom-filter-read-permanent))
(when (/= 0 lyskom-current-conf)
(let* (conf perm filter action)
(setq subject (lyskom-read-from-minibuffer
(lyskom-get-string 'filter-subject)
(or subject lyskom-current-subject)))
(setq filter (cons (cons 'subject subject) filter))
(setq conf (lyskom-read-conf-no
(lyskom-get-string 'filter-in-conf)
'(all) t nil t))
(if (/= conf 0)
(setq filter (cons (cons 'recipient-no conf) filter)))
(setq action (lyskom-filter-read-action))
(setq perm (lyskom-filter-read-permanent))
(lyskom-add-filter
(make-filter filter
(list (cons 'action action)
(cons 'expire (not perm)))))))))
(lyskom-add-filter
(make-filter filter
(list (cons 'action action)
(cons 'expire (not perm))))))))
......@@ -498,7 +489,7 @@ conferences.
To change existing filters, use `kom-filter-edit'."
(interactive)
(let (auth-stat author conf filter action permanent)
(blocking-do-multiple ((text-stat (get-text-stat
(blocking-do-multiple ((text-stat (get-text-stat
(or lyskom-current-text 0)))
(conf-stat (get-conf-stat
lyskom-current-conf)))
......@@ -509,9 +500,8 @@ To change existing filters, use `kom-filter-edit'."
(lyskom-read-conf-no (lyskom-get-string 'filter-author)
'(pers)
t
(or (and auth-stat
(cons (conf-stat->name auth-stat) 0))
"")
(and auth-stat
(cons (conf-stat->name auth-stat) 0))
t))
(if (/= author 0)
(setq filter (cons (cons 'author-no author) filter)))
......@@ -519,10 +509,7 @@ To change existing filters, use `kom-filter-edit'."
(lyskom-get-string 'filter-in-conf)
'(all)
t
(or
(and conf-stat
(cons (conf-stat->name conf-stat) 0))
"")
(and conf-stat (cons (conf-stat->name conf-stat) 0))
t))
(if (/= conf 0)
(setq filter (cons (cons 'recipient-no conf) filter)))
......@@ -656,34 +643,27 @@ single conference.
To change existing filters, use `kom-filter-edit'."
(interactive)
(if (/= 0 lyskom-current-conf)
(let ((conf-stat (blocking-do 'get-conf-stat lyskom-current-conf))
(conf nil)
(action nil)
(perm nil)
(filter nil))
(if conf-stat
(progn
(setq text
(lyskom-read-from-minibuffer (lyskom-get-string
'filter-which-text)
(or text "")))
(setq filter (cons (cons 'text text) filter))
(setq conf (lyskom-read-conf-no
(lyskom-get-string 'filter-in-conf)
'(all) t
(or (and (conf-stat->conf-no conf-stat)
(cons (conf-stat->name conf-stat) 0))
"")
t))
(if (/= conf 0)
(setq filter (cons (cons 'recipient-no conf) filter)))
(setq action (lyskom-filter-read-action))
(setq perm (lyskom-filter-read-permanent))
(lyskom-add-filter
(make-filter filter
(list (cons 'action action)
(cons 'expire (not perm))))))))))
(when (/= 0 lyskom-current-conf)
(let ((conf nil)
(action nil)
(perm nil)
(filter nil))
(setq text
(lyskom-read-from-minibuffer (lyskom-get-string
'filter-which-text)
(or text "")))
(setq filter (cons (cons 'text text) filter))
(setq conf (lyskom-read-conf-no
(lyskom-get-string 'filter-in-conf)
'(all) t nil t))
(if (/= conf 0)
(setq filter (cons (cons 'recipient-no conf) filter)))
(setq action (lyskom-filter-read-action))
(setq perm (lyskom-filter-read-permanent))
(lyskom-add-filter
(make-filter filter
(list (cons 'action action)
(cons 'expire (not perm))))))))