Commit dac95cae authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Force the lazy luser to confirm that all recipients really shall

remain recipients when he comments a text.
parent 0f2c9235
No preview for this file type
...@@ -698,15 +698,19 @@ If optional arg TEXT-NO is present write a footnote to that text instead." ...@@ -698,15 +698,19 @@ If optional arg TEXT-NO is present write a footnote to that text instead."
(defun lyskom-write-comment-soon (text-stat text text-no type) (defun lyskom-write-comment-soon (text-stat text text-no type)
"Write a comment to the text with TEXT-STAT, TEXT and, TEXT-NO. "Write a comment to the text with TEXT-STAT, TEXT and, TEXT-NO.
TYPE is either 'comment or 'footnote." TYPE is either 'comment or 'footnote."
(cond ((or (null text-stat) (cond
;; Text not found?
((or (null text-stat)
(null text)) (null text))
(lyskom-format-insert 'cant-read-textno text-no) (lyskom-format-insert 'cant-read-textno text-no)
(lyskom-end-of-command)) (lyskom-end-of-command))
;; Give header.
((string-match "\n" (text->text-mass text)) ((string-match "\n" (text->text-mass text))
(lyskom-write-comment text-stat (lyskom-write-comment text-stat
(substring (text->text-mass text) (substring (text->text-mass text)
0 (match-beginning 0)) 0 (match-beginning 0))
type)) type))
;; The commented text had no header.
(t (lyskom-write-comment text-stat "" type)))) (t (lyskom-write-comment text-stat "" type))))
...@@ -735,7 +739,24 @@ The default subject is SUBJECT. TYPE is either 'comment or 'footnote." ...@@ -735,7 +739,24 @@ The default subject is SUBJECT. TYPE is either 'comment or 'footnote."
(defun lyskom-comment-recipients (data lyskom-proc text-stat subject type) (defun lyskom-comment-recipients (data lyskom-proc text-stat subject type)
"Compute recipients to a comment to a text. "Compute recipients to a comment to a text.
Args: DATA, LYSKOM-PROC TEXT-STAT SUBJECT TYPE. Args: DATA, LYSKOM-PROC TEXT-STAT SUBJECT TYPE.
DATA is a list of all the recipients that should receive this text.
If DATA contains more than one conference the user is asked (using y-or-n-p)
if all conferences really should receive the text.
The call is continued to the lyskom-edit-text." The call is continued to the lyskom-edit-text."
;; Filter multiple recipients through y-or-n-p.
(if (and kom-confirm-multiple-recipients (> (length data) 1)
(not (and (= (length data) 2)
(or (= lyskom-pers-no (conf-stat->conf-no (car data)))
(= lyskom-pers-no (conf-stat->conf-no
(car (cdr data))))))))
(let ((new-data nil))
(while data
(if (j-or-n-p (lyskom-format 'comment-keep-recpt-p
(conf-stat->name (car data))))
(setq new-data (cons (car data) new-data)))
(setq data (cdr data)))
(setq data (nreverse new-data))))
(let* ((member nil) (let* ((member nil)
(recver (lyskom-create-misc-list (recver (lyskom-create-misc-list
(cond (cond
...@@ -757,6 +778,8 @@ The call is continued to the lyskom-edit-text." ...@@ -757,6 +778,8 @@ The call is continued to the lyskom-edit-text."
(setq member t)) (setq member t))
(setq recpts (cons (conf-stat->comm-conf conf-stat) recpts)))) (setq recpts (cons (conf-stat->comm-conf conf-stat) recpts))))
(setq data (cdr data))) (setq data (cdr data)))
;; Add the user to the list of recipients if he isn't a member in
;; any of the recipients.
(if (not member) (if (not member)
(setq recver (append recver (list (cons 'recpt lyskom-pers-no))))) (setq recver (append recver (list (cons 'recpt lyskom-pers-no)))))
(lyskom-edit-text lyskom-proc (lyskom-edit-text lyskom-proc
......
...@@ -300,6 +300,7 @@ Email-address:\n\nOther:\t") ...@@ -300,6 +300,7 @@ Email-address:\n\nOther:\t")
(text-to-remove-q . "Remove which article as a comment: ") (text-to-remove-q . "Remove which article as a comment: ")
(add-comment-to . "Adding article %#1d as a comment to text %#2d...") (add-comment-to . "Adding article %#1d as a comment to text %#2d...")
(sub-comment-to . "Removing article %#1d as a comment to article %#2d...") (sub-comment-to . "Removing article %#1d as a comment to article %#2d...")
(comment-keep-recpt-p ."Shall %#1s remain a recipient? ")
; From commands2.el: ; From commands2.el:
......
...@@ -307,6 +307,7 @@ Lyskom-sessionen ...@@ -307,6 +307,7 @@ Lyskom-sessionen
(text-to-remove-q . "Vilket inlgg vill du subtrahera som kommentar? ") (text-to-remove-q . "Vilket inlgg vill du subtrahera som kommentar? ")
(add-comment-to . "Adderar text %#1d som kommentar till text %#2d...") (add-comment-to . "Adderar text %#1d som kommentar till text %#2d...")
(sub-comment-to . "Subtraherar text %#1d som kommentar till text %#2d...") (sub-comment-to . "Subtraherar text %#1d som kommentar till text %#2d...")
(comment-keep-recpt-p ."Ska %#1s vara mottagare? ")
; From commands2.el: ; From commands2.el:
......
...@@ -166,6 +166,11 @@ kom-show-personal-messages-in-buffer decides which buffer to pop.") ...@@ -166,6 +166,11 @@ kom-show-personal-messages-in-buffer decides which buffer to pop.")
"*Non-nil means ding as personal messages arrive. "*Non-nil means ding as personal messages arrive.
Non-nil and non-t means only ding when they really are personal.") Non-nil and non-t means only ding when they really are personal.")
(defvar kom-confirm-multiple-recipients t
"*Non-nil means ask the user for confirmation about recipients.
When the user writes a comment to a text with more than one recipient
he gets a y-or-n-p question for all recipients.")
(defconst lyskom-elisp-variables '( (defconst lyskom-elisp-variables '(
kom-do-when-done kom-do-when-done
kom-do-when-starting kom-do-when-starting
......
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