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,16 +698,20 @@ 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)
"Write a comment to the text with TEXT-STAT, TEXT and, TEXT-NO.
TYPE is either 'comment or 'footnote."
(cond ((or (null text-stat)
(null text))
(lyskom-format-insert 'cant-read-textno text-no)
((string-match "\n" (text->text-mass text))
(lyskom-write-comment text-stat
(substring (text->text-mass text)
0 (match-beginning 0))
(t (lyskom-write-comment text-stat "" type))))
;; Text not found?
((or (null text-stat)
(null text))
(lyskom-format-insert 'cant-read-textno text-no)
;; Give header.
((string-match "\n" (text->text-mass text))
(lyskom-write-comment text-stat
(substring (text->text-mass text)
0 (match-beginning 0))
;; The commented text had no header.
(t (lyskom-write-comment text-stat "" type))))
(defun lyskom-write-comment (text-stat subject type)
......@@ -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)
"Compute recipients to a comment to a text.
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."
;; 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)
(recver (lyskom-create-misc-list
......@@ -757,6 +778,8 @@ The call is continued to the lyskom-edit-text."
(setq member t))
(setq recpts (cons (conf-stat->comm-conf conf-stat) recpts))))
(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)
(setq recver (append recver (list (cons 'recpt lyskom-pers-no)))))
(lyskom-edit-text lyskom-proc
......@@ -300,6 +300,7 @@ Email-address:\n\nOther:\t")
(text-to-remove-q . "Remove which article as a comment: ")
(add-comment-to . "Adding article %#1d as a comment to text %#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:
......@@ -307,6 +307,7 @@ Lyskom-sessionen
(text-to-remove-q . "Vilket inlgg vill du subtrahera som kommentar? ")
(add-comment-to . "Adderar 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:
......@@ -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 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 '(
Supports Markdown
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