Commit 6e07c5fc authored by David Byers's avatar David Byers
Browse files

Fixed bugs 383, 311, 445, 408.

The client can deal with FAQs on persons now
parent 8eb5d46d
2002-04-10 David Byers <david.byers@swipnet.se>
We can usually have FAQs on persons too:
* commands1.el (kom-change-conf-faq): Can apply to persons too.
* commands2.el (kom-add-faq): Can apply to persons too.
(kom-del-faq): Same here.
(kom-review-faq): Same here.
Print subject line of FAQ when showing a list of FAQs in status
conf and review presentation:
* commands1.el (lyskom-insert-deferred-comment-like-aux-2): Print
subject line of FAQ.
(lyskom-insert-deferred-comment-like-aux): Split into two
functions (this one and
lyskom-insert-deferred-comment-like-aux-2).
(lyskom-insert-comment-like-aux): Print subject line of FAQ.
(lyskom-print-comment-like-aux): Get text mass when not doing
deferred printing.
* aux-items.el (lyskom-status-print-faq-text): Print the subject
of each FAQ.
* komtypes.el (text->decoded-text-mass): Do save-match-data so we
don't clobber match data.
Fix bug 408:
* commands2.el (kom-change-conf-type): Removed redunant argument
from change-type-prompt.
(kom-status-conf): Removed redundant argument from status-record.
(kom-status-person): Removed redundant argument from
pers-status-record.
(kom-change-conf-type): Place nope or done string after the
prompt.
Fix that some strings are not changed when language changes:
* vars.el.in (lyskom-month-names): Set language-force.
(lyskom-onoff-table): Same.
(lyskom-language-codes): Same.
(lyskom-filter-predicate-list): Same.
(lyskom-filter-what): Same.
(lyskom-filter-actions): Same.
(lyskom-prioritize-header-lines): Same.
(lyskom-prioritize-header): Same.
* defvar.el (def-kom-var): Added property language-force.
Fix problem where personal answer to own texts have no subject:
* commands1.el (lyskom-private-answer): Don't delete subject when
doing personal reply to my own texts.
New filter command:
* filter.el (kom-filter-recipient): Nytt kommando.
Update aliases:
* vars.el.in (kom-server-aliases): Changed sno.pp.se to
kom.sno.pp.se.
Completion on kom-sub-comment and kom-sub-footnote:
* commands1.el (kom-add-footnote): Read prefix arg here and not in
lyskom-add-sub-footnote.
(kom-sub-footnote): Same here.
......@@ -19,6 +73,7 @@
2002-04-09 David Byers <david.byers@swipnet.se>
Completion on kom-sub-comment and kom-sub-footnote:
* commands1.el (lyskom-add-sub-footnote): Show text number we are
removing from or adding to in the prompt (important when using
prefix args to this command).
......
......@@ -547,12 +547,48 @@ return non-nil if the item is to be included in the list."
(concat "[" (aux-item->data item) "] "
(lyskom-aux-item-terminating-button item obj)))
(defun lyskom-print-faq-format-subject (text text-stat text-no)
(let ((subject ""))
(if (and text text-stat)
(concat "\""
(cond ((string-match "\n" (text->decoded-text-mass text text-stat))
(substring (text->decoded-text-mass text text-stat) 0 (match-beginning 0)))
(t ""))
"\"")
(lyskom-format 'no-such-text-no text-no))))
(defun lyskom-deferred-print-faq (text-stat defer-info)
(if text-stat
(initiate-get-text
'deferred
(lambda (text text-stat defer-info)
(lyskom-replace-deferred defer-info
(lyskom-format "%#1r"
(lyskom-print-faq-format-subject text
text-stat
(defer-info->data defer-info)))))
(text-stat->text-no text-stat)
text-stat
defer-info)
(lyskom-replace-deferred defer-info
(lyskom-print-faq-format-subject nil nil (defer-info->data defer-info)))))
(defun lyskom-status-print-faq-text (item &optional obj)
(lyskom-insert
(concat
(lyskom-format 'faq-in-text-aux (string-to-int (aux-item->data item)))
(lyskom-aux-item-terminating-button item obj)
"\n")))
(let* ((text-no (string-to-int (aux-item->data item)))
(subject (if kom-deferred-printing
(lyskom-create-defer-info 'get-text-stat
text-no
'lyskom-deferred-print-faq
nil nil nil
text-no)
(blocking-do-multiple ((text (get-text text-no))
(text-stat (get-text-stat text-no)))
(lyskom-print-faq-format-subject text text-stat text-no)))))
(lyskom-format-insert 'faq-in-text-aux
text-no
subject)
(lyskom-insert (lyskom-aux-item-terminating-button item obj))
(lyskom-insert "\n")))
(defun lyskom-print-faq-for-conf (item &optional obj)
(concat
......
......@@ -177,11 +177,15 @@
(defun lyskom-print-comment-like-aux (item object)
(let* ((text-no (string-to-int (aux-item->data item)))
(text-stat (if kom-deferred-printing
(cache-get-text-stat text-no)
(blocking-do 'get-text-stat text-no))))
(text-stat nil)
(text nil))
(unless kom-deferred-printing
(blocking-do-multiple ((x-text (get-text text-no))
(x-text-stat (get-text-stat text-no)))
(setq text-stat x-text-stat text x-text)))
(cond ((or text-stat (not kom-deferred-printing))
(lyskom-insert-comment-like-aux item text-no text-stat object))
(lyskom-insert-comment-like-aux item text-no text-stat text object))
(t (let ((defer-info (lyskom-create-defer-info
'get-text-stat
text-no
......@@ -193,13 +197,14 @@
(lyskom-format-insert "%#1s\n" lyskom-defer-indicator)
(lyskom-defer-insertion defer-info))))))
(defun lyskom-insert-comment-like-aux (item text-no text-stat object)
(defun lyskom-insert-comment-like-aux (item text-no text-stat text object)
(let* ((author (if text-stat (text-stat->author text-stat) nil))
(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)))
(formats (lyskom-aux-item-definition-field item 'text-header-line))
(subject (lyskom-print-faq-format-subject text text-stat text-no))
content-type
)
(if (and mx-from
......@@ -220,13 +225,21 @@
author
content-type
(lyskom-aux-item-terminating-button item
object))
object)
subject)
(lyskom-insert "\n")))
;;; FIXME: This contains code that duplicates the code in
;;; lyskom-insert-deferred-header-comm. That's a BAD THING.
(defun lyskom-insert-deferred-comment-like-aux (text-stat defer-info)
(initiate-get-text 'deferred
'lyskom-insert-deferred-comment-like-aux-2
(elt (defer-info->data defer-info) 2)
text-stat
defer-info))
(defun lyskom-insert-deferred-comment-like-aux-2 (text text-stat defer-info)
(let* ((author (if text-stat (text-stat->author text-stat) nil))
(item (elt (defer-info->data defer-info) 0))
(object (elt (defer-info->data defer-info) 1))
......@@ -236,6 +249,7 @@
(mx-author (car (lyskom-get-aux-item (text-stat->aux-items text-stat)
16)))
(formats (lyskom-aux-item-definition-field item 'text-header-line))
(subject (lyskom-print-faq-format-subject text text-stat text-no))
content-type
)
(if (and mx-from
......@@ -258,7 +272,8 @@
author
content-type
(lyskom-aux-item-terminating-button item
object))))
object)
subject)))
......@@ -1120,18 +1135,17 @@ that text instead."
(if (lyskom-j-or-n-p (lyskom-get-string 'motd-persist-q))
t
nil)))
(if (= (text-stat->author text-stat) lyskom-pers-no)
(lyskom-edit-text lyskom-proc
(lyskom-edit-text lyskom-proc
(if (= (text-stat->author text-stat) lyskom-pers-no)
(lyskom-create-misc-list
'recpt
(text-stat->author text-stat))
"" "")
(lyskom-edit-text lyskom-proc
(lyskom-create-misc-list
'comm-to (text-stat->text-no text-stat)
'recpt (text-stat->author text-stat)
'recpt lyskom-pers-no)
subject "")))))))
'recpt lyskom-pers-no))
subject ""))))))
;;; ================================================================
......@@ -1219,7 +1233,7 @@ Don't ask for confirmation."
(interactive)
(let* ((conf-no (lyskom-read-conf-no
(lyskom-get-string 'what-to-change-faq-you)
'(conf)
'(conf pers)
nil
(cons (if lyskom-current-conf
(let ((tmp (blocking-do 'get-uconf-stat lyskom-current-conf)))
......
......@@ -174,7 +174,6 @@ otherwise: the conference is read with lyskom-completing-read."
(pro (conf-type->rd_prot type))
(sec (conf-type->secret type)))
(lyskom-format-insert 'status-record
conf-stat
conf-stat
(cond
((or box ori pro sec)
......@@ -364,7 +363,6 @@ otherwise: the conference is read with lyskom-completing-read."
(null conf-stat))
(lyskom-insert-string 'no-such-pers)
(lyskom-format-insert 'pers-status-record
conf-stat
conf-stat)
(lyskom-format-insert 'created-time
(lyskom-format-time
......@@ -1961,7 +1959,6 @@ Return-value: 'no-session if there is no suitable session to switch to
(lyskom-format-insert
'change-type-prompt
uconf-stat
uconf-stat
(mapconcat 'identity
(delq nil
(list (and box (lyskom-get-string 'Mailbox))
......@@ -1998,7 +1995,8 @@ Return-value: 'no-session if there is no suitable session to switch to
(conf-type->rsv3
(uconf-stat->conf-type uconf-stat)))))
(progn (lyskom-insert-string 'nope)
(lyskom-insert-error))))))
(lyskom-insert-error))
(lyskom-insert-string 'done)))))
;;; ============================================================
......@@ -2200,7 +2198,7 @@ Return-value: 'no-session if there is no suitable session to switch to
(def-kom-command kom-add-faq (&optional conf-no text-no)
"Add a FAQ to a conference"
(interactive (list (lyskom-read-conf-no 'conf-to-add-faq '(conf) 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)))
(let ((text (blocking-do 'get-text-stat text-no)))
(if (null text)
......@@ -2224,7 +2222,7 @@ Return-value: 'no-session if there is no suitable session to switch to
(interactive)
(let* ((conf-stat (if conf-no
(blocking-do 'get-conf-stat conf-no)
(lyskom-read-conf-stat 'conf-to-del-faq '(conf) nil nil t)))
(lyskom-read-conf-stat 'conf-to-del-faq '(conf pers) nil nil t)))
(faq-list (when conf-stat
(let ((tmp nil))
(lyskom-traverse-aux item
......@@ -2260,7 +2258,7 @@ Return-value: 'no-session if there is no suitable session to switch to
(def-kom-command kom-review-faq (&optional conf-no)
"View the FAQs for a conference"
(interactive (list (lyskom-read-conf-no 'view-which-faq '(conf) nil nil t)))
(interactive (list (lyskom-read-conf-no 'view-which-faq '(conf pers) nil nil t)))
(let* ((conf-stat (blocking-do 'get-conf-stat conf-no))
(faq-list (when conf-stat
(let ((tmp nil))
......
......@@ -130,14 +130,15 @@ A string Used as the documentation string for the variable
A symbol A predefined property of the variable
A list A widget specification for the variable
Predefined properties are the following
Predefined (and tested) properties are the following
server Save the variable in the elisp block. Implies local.
local Make the variable buffer-local.
inherited The variable is inherited from parent buffer. Implies protected
protected The variable is marked as permanent local. Implies local.
minibuffer Inherit the variable as a local variable in the minibuffer.
server-hook A hook stored in the server.
local-hook A hook variable that is made local in LysKOM buffers."
local-hook A hook variable that is made local in LysKOM buffers.
language-force A language-variable whose value is to be forced."
(let ((inherited nil)
(protected nil)
......@@ -149,6 +150,7 @@ local-hook A hook variable that is made local in LysKOM buffers."
(local-hook-doc nil)
(local-var-doc nil)
(server-doc nil)
(language-force nil)
(arglist args))
(while arglist
(cond ((stringp (car arglist)) (setq doc-string (car arglist)))
......@@ -216,6 +218,10 @@ local-hook A hook variable that is made local in LysKOM buffers."
(` ((add-to-list 'lyskom-minibuffer-variables
(quote (, name)))))))
((eq (car arglist) 'language-force)
(setq language-force
`((put ',name 'lyskom-language-force t))))
(t (error "LysKOM: Unknown variable property: %S"
(car arglist)))))
(t (error "LysKOM: Strange variable argument type: %S"
......@@ -255,6 +261,7 @@ it using setq or defvar.")))
buffer-local
minibuffer
widget-spec
language-force
)))))))
......
......@@ -565,8 +565,8 @@ Read all about it at http://www.lysator.liu.se/history/")
(conf-for-status . "Get status of which conference? ")
(no-such-conf . "The conference doesn't exist.\n")
(status-record . "Status of conference %#1M (%#2m) %#3s\n\n")
(change-type-prompt . "Change conference type for %#1M (%#2m) %#3s\n")
(status-record . "Status of conference %#1M (%#1m) %#2s\n\n")
(change-type-prompt . "Change conference type for %#1M (%#1m) (%#2s)...")
(Mailbox . "Mailbox")
(Protected . "Protected")
(no-comments . "No comments")
......@@ -608,7 +608,7 @@ Read all about it at http://www.lysator.liu.se/history/")
(conf-membership-line-2 . " Added %#1s by %#2P\n")
(pers-for-status . "Get status of which user? ")
(no-such-pers . "The user doesn't exist.\n")
(pers-status-record . "Status of user %#1P (%#2p)\n")
(pers-status-record . "Status of user %#1P (%#1p)\n")
(created-time . "Created:%34#1s\n\n")
(created-confs . "Conferences created:%22#1d\n")
(created-persons . "Users created:%28#1d\n")
......@@ -1192,6 +1192,7 @@ before reading it.\n")
(filter-action . "Filter how? ")
(filter-in-conf . "In which conference? (all) ")
(filter-subject . "Filter which subject? ")
(filter-recipient . "Filter which recipient? ")
(filter-which-text . "Filter texts containing: ")
(filter-author . "Filter which author? ")
(permanent . "(permanent)")
......@@ -1374,7 +1375,7 @@ On since %#8s%#9s")
(other-fast-reply-aux . " \"%#1t\" /%#2P/")
(faq-for-conf-aux . "FAQ for %#1M <%#1m>")
(faq-in-text-aux . "FAQ in text: %10#1n")
(faq-in-text-aux . "FAQ in text: %10#1n %#2D")
(conf-to-add-faq . "Which conference do you want to add an FAQ for? ")
(text-to-add-as-faq . "Which text is the new FAQ? ")
(text-to-change-as-faq . "Which FAQ do you want to change? ")
......@@ -1390,7 +1391,7 @@ On since %#8s%#9s")
%#2?b%[Text %#2n is still the FAQ.
%]%[%]%#4s")
(faq-in-text . "FAQ in text %#1n %#3s%#4s")
(faq-in-text-by . "FAQ in text %#1n %#3sby %#2P %#4s")
(faq-in-text-by . "FAQ in text %#1n %#5s %#3sby %#2P %#4s")
(too-many-languages . "Cannot code that many character sets. Send uncoded? ")
(too-many-content-types . "Cannot figure out what content type you want. Simplify the text.")
......@@ -1756,6 +1757,7 @@ You must become an active member of the conference to enter it.\n")
(kom-force-logout . "Kill session")
(kom-filter-author . "Filter author")
(kom-filter-subject . "Filter subject")
(kom-filter-recipient . "Filter recipient")
(kom-super-jump . "Super jump")
(kom-filter-edit . "Edit filters")
(kom-filter-text . "Filter contents")
......
......@@ -525,6 +525,23 @@ Otherwise return nil."
(list (cons 'action action)
(cons 'expire (not permanent))))))))
(def-kom-command kom-filter-recipient ()
"Interactively filter a recipient."
(interactive)
(let ((conf-no (lyskom-read-conf-no 'filter-recipient
'(all)
nil
nil
t))
(action (lyskom-filter-read-action))
(permanent (lyskom-filter-read-permanent)))
(cond ((and conf-no (not (zerop conf-no)))
(lyskom-add-filter
(make-filter (list (cons 'recipient-no conf-no))
(list (cons 'action action)
(cons 'expire (not permanent)))))
))))
......
......@@ -731,15 +731,16 @@ Both vectors should be of the same length."
(defun text->decoded-text-mass (text text-stat)
"Get the text mass of a text after decoding according to its content type"
(let* ((str (text->text-mass text))
(item (lyskom-get-aux-item
(text-stat->aux-items text-stat) 1))
(content-type (and (car item)
(lyskom-mime-decode-content-type
(aux-item->data (car item))))))
(if (cdr content-type)
(lyskom-mime-decode-string str (cdr content-type))
str)))
(save-match-data
(let* ((str (text->text-mass text))
(item (lyskom-get-aux-item
(text-stat->aux-items text-stat) 1))
(content-type (and (car item)
(lyskom-mime-decode-content-type
(aux-item->data (car item))))))
(if (cdr content-type)
(lyskom-mime-decode-string str (cdr content-type))
str))))
......
......@@ -545,8 +545,8 @@ i svensk datorhistoria. L
(memberships-line . "%16#1s %#2d\t%#3d\t%#4M\n")
(conf-for-status . "Vilket mte vill du se statusen fr? ")
(no-such-conf . "Mtet finns ej.\n")
(status-record . "Status fr mte %#1M (%#2m) %#3s\n\n")
(change-type-prompt . "ndra mtestyp fr mte %#1M (%#2m) %#3s\n")
(status-record . "Status fr mte %#1M (%#1m) %#2s\n\n")
(change-type-prompt . "ndra mtestyp fr mte %#1M (%#1m) (%#2s)...")
(Mailbox . "Brevlda")
(Protected . "Hemligt")
(no-comments . "original")
......@@ -588,7 +588,7 @@ i svensk datorhistoria. L
(conf-membership-line-2 . " Adderad %#1s av %#2P\n")
(pers-for-status . "Vem vill du se statusen fr? ")
(no-such-pers . "Det finns ingen sdan person.\n")
(pers-status-record . "Status fr person %#1P (%#2p)\n")
(pers-status-record . "Status fr person %#1P (%#1p)\n")
(created-time . "Skapad:%34#1s\n\n")
(created-confs . "Skapade mten:%27#1d\n")
(created-persons . "Skapade personer:%24#1d\n")
......@@ -1193,6 +1193,7 @@ att l
(filter-subject . "Filtrera vilket rende? ")
(filter-which-text . "Filtrera inlgg som innehller: ")
(filter-author . "Filtrera vilken frfattare? ")
(filter-recipient . "Vilken mottagare vill du filtrera? ")
(permanent . "(permanent)")
(temporary . "(tillfllig)")
(filter-edit-buffer-name . "*LysKOM Filter Edit*")
......@@ -1372,7 +1373,7 @@ Uppkopplad sedan %#8s%#9s")
(other-fast-reply-aux . " \"%#1t\" /%#2P/")
(faq-for-conf-aux . "Texten r FAQ fr %#1M <%#1m>")
(faq-in-text-aux . "FAQ i inlgg: %10#1n")
(faq-in-text-aux . "FAQ i inlgg: %10#1n %#2D")
(conf-to-add-faq . "Vilket mte vill du lgga till en FAQ fr? ")
(text-to-add-as-faq . "Vilken text vill du lgga till som FAQ? ")
(text-to-change-as-faq . "Vilken FAQ vill du ndra? ")
......@@ -1388,7 +1389,7 @@ Uppkopplad sedan %#8s%#9s")
%#2?b%[Text %#2n r fortfarande FAQ.
%]%[%]%#4s")
(faq-in-text . "FAQ i text %#1n %#3s%#4s")
(faq-in-text-by . "FAQ i text %#1n %#3sav %#2P %#4s")
(faq-in-text-by . "FAQ i text %#1n %#5s %#3sav %#2P %#4s")
(too-many-languages . "Fr mnga teckenuppsttningar fr att koda. Skicka in okodat? ")
(too-many-content-types . "Kan inte avgra innehllstyp. Frenkla inlgget.")
......@@ -1755,6 +1756,7 @@ Du m
(kom-filter-author . "Filtrera frfattare")
(kom-filter-subject . "Filtrera rende")
(kom-filter-text . "Filtrera innehll")
(kom-filter-recipient . "Filtrera mottagare")
(kom-super-jump . "Superhoppa")
(kom-filter-edit . "ndra filter")
(kom-list-filters . "Lista filter")
......
......@@ -1129,29 +1129,33 @@ Each element is a cons cell consisting of the name of the month
\(a symbol) and the number of the month (1-12). Each month may
appear more than once"
local
inherited)
(put 'lyskom-month-names 'lyskom-language-force t)
inherited
language-force)
(def-kom-var lyskom-onoff-table nil
"A completion table for on and off selections."
local)
local
language-force)
(def-kom-var lyskom-language-codes nil
"A list of ISO 639 language codes"
local)
(put 'lyskom-language-codes 'lyskom-language-force t)
local
language-force)
(def-kom-var lyskom-filter-predicate-list nil
"A list of legal filter comparison predicates."
local)
local
language-force)
(def-kom-var lyskom-filter-what nil
"A list of legal filter conditions and their textual representation."
local)
local
language-force)
(def-kom-var lyskom-filter-actions nil
"A list of legal filter actions an their textual representation."
local)
local
language-force)
(def-kom-var lyskom-filter-edit-map nil
"Keymap for LysKOM filter edit."
......@@ -1163,11 +1167,13 @@ appear more than once"
(def-kom-var lyskom-prioritize-header-lines nil
"Number of lines in the header of the prioritization buffer."
local)
local
language-force)
(def-kom-var lyskom-prioritize-header nil
"Header for the reprioritization buffer."
inherited)
inherited
language-force)
(def-kom-var kom-ansaphone-default-reply nil
"*Default message to send when the ansaphone is on."
......@@ -1725,6 +1731,7 @@ is a list of vectors, where each vector specifies an item.
kom-filter-author
kom-filter-subject
kom-filter-text
kom-filter-recipient
kom-super-jump
kom-filter-edit
kom-list-filters
......
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