Commit 3d737363 authored by David Byers's avatar David Byers
Browse files

Nag about missing presentation.

Detailed changes:
>
> 	* utilities.el (lyskom-nag-about-presentation): New function.
>
> 	* startup.el (kom-start-anew): Use new function to nag about
> 	presentation.
>
> 	* commands1.el (lyskom-write-text): Nag about presentation.
> 	(kom-write-comment): Here too.
>
> 	* lyskom-rest.el (lyskom-format-aux-help): Added support for F
> 	format letter (fill paragraph).
> 	(lyskom-do-insert): Ditto.
parent 101a3b8e
2003-08-03 David Byers <byers@lysator.liu.se>
* vars.el.in (kom-dont-complain-about-missing-presentation): New
variable.
2003-08-02 David Byers <byers@lysator.liu.se>
* utilities.el (lyskom-nag-about-presentation): New function.
* startup.el (kom-start-anew): Use new function to nag about
presentation.
* commands1.el (lyskom-write-text): Nag about presentation.
(kom-write-comment): Here too.
* lyskom-rest.el (lyskom-format-aux-help): Added support for F
format letter (fill paragraph).
(lyskom-do-insert): Ditto.
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
......
......@@ -503,7 +503,7 @@ comment; `kom-confirm-multiple-recipients' affects how multiple
recipients are handled."
(interactive)
(lyskom-tell-internat 'kom-tell-write-letter)
(lyskom-write-text pers-no 'who-letter-to nil))
(lyskom-write-text pers-no 'who-letter-to))
;;; ================================================================
......@@ -1088,22 +1088,24 @@ This command accepts text number prefix arguments (see
"")))
(unwind-protect
(if text-no
(blocking-do-multiple ((text (get-text text-no))
(text-stat (get-text-stat text-no)))
(when (or (null (text-stat-find-aux text-stat 4))
(lyskom-j-or-n-p
(lyskom-get-string 'no-comments-q)))
(if (and (text-stat-find-aux text-stat 5)
(lyskom-j-or-n-p
(lyskom-get-string 'private-answer-q)))
(lyskom-private-answer-soon
text-stat
text
text-no)
(lyskom-write-comment-soon text-stat
text
text-no
'comment))))
(progn
(lyskom-nag-about-presentation)
(blocking-do-multiple ((text (get-text text-no))
(text-stat (get-text-stat text-no)))
(when (or (null (text-stat-find-aux text-stat 4))
(lyskom-j-or-n-p
(lyskom-get-string 'no-comments-q)))
(if (and (text-stat-find-aux text-stat 5)
(lyskom-j-or-n-p
(lyskom-get-string 'private-answer-q)))
(lyskom-private-answer-soon
text-stat
text
text-no)
(lyskom-write-comment-soon text-stat
text
text-no
'comment)))))
(lyskom-insert-string 'confusion-who-to-reply-to))
(lyskom-end-of-command)))
......@@ -1835,19 +1837,15 @@ 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 nil))
(lyskom-write-text arg 'who-send-text-to))
(defun lyskom-write-text (arg prompt default)
(defun lyskom-write-text (arg prompt)
"Start writing a new text."
(when default
(setq default (uconf-stat->name (blocking-do 'get-uconf-stat default))))
(lyskom-nag-about-presentation)
(let* ((tono (if (and arg lyskom-current-conf (not (zerop lyskom-current-conf)))
lyskom-current-conf
(lyskom-read-conf-no (lyskom-get-string prompt)
'(pers conf)
nil
(and default (cons default 0))
t)))
'(pers conf) nil nil t)))
(conf-stat (blocking-do 'get-conf-stat tono)))
(cache-del-conf-stat tono)
(if (if (zerop (conf-stat->msg-of-day conf-stat))
......
......@@ -165,9 +165,6 @@ below:\n")
(lyskom-motd-was-garbed . "\nThe login message does not exist!
The message that was supposed to be shown after login has disappeared.
Please contact the LysKOM administrator.\n")
(presentation-encouragement .
"You have not written a presentation. Please write a presentation by using
the command Ap. If you do not want to write a presentations, please type fk.\n")
(first-greeting . "%#1s
This appears to be the first time you use LysKOM. Welcome!
......@@ -1933,7 +1930,25 @@ environment to one that uses \"%#2s\" to encode text.
(text-has-no-comments . "Text %#1n has no comments\n")
(text-has-no-footnotes . "Text %#1n has no footnotes\n")
(set-message-flag-q . "Accept group messages to %#1M? ")
))
(why-you-got-no-presentation . "\
%#1@\
========================================================================
You do not have a presentation%#2?z%[ but you've written %#2d texts%]%[%]
Use the command \"Change presentation\" to write or change your
presentation.
%[%#4F\
Your presentations serves to give other users of %#3s some information
about who you are, and this contributes to the sense of community in
%#3s. This message will be repeated at random intervals until you have
written a presentation.%]
========================================================================
") ))
(lyskom-language-var local lyskom-month-names en
......
......@@ -1142,6 +1142,7 @@ back, and works even if from has the property."
(defun lyskom-do-insert (string)
(let ((start (point)))
(insert string)
(lyskom-do-special-inserts start (point) 'lyskom-fill)
(lyskom-do-special-inserts start (point) 'lyskom-overlay)
(lyskom-do-special-inserts start (point) 'special-insert)
))
......@@ -1707,12 +1708,14 @@ Deferred insertions are not supported."
)))
((= format-letter ?F)
(setq result
(if (lyskom-conf-stat-p arg)
(let ((face (conf-stat-find-aux arg 9))
(string (copy-sequence "X")))
(lyskom-maybe-add-face-to-string face string))
" ")))
(set-format-state->delayed-propl
format-state
(cons (vector (length (format-state->result format-state))
`(lyskom-fill ((lambda (start end width)
(let ((fill-column (or width (- (window-width 8)))))
(fill-region start end))) . ,arg))
(format-state->depth format-state))
(format-state->delayed-propl format-state))))
;;
;; Format a conference or person name by retrieving information
......
......@@ -666,10 +666,7 @@ shown to other users."
(progn
(lyskom-insert-string 'you-have-motd)
(lyskom-view-text (conf-stat->msg-of-day conf-stat))))
(if (and conf-stat
(zerop (conf-stat->presentation conf-stat))
(not (zerop (conf-stat->no-of-texts conf-stat))))
(lyskom-insert-string 'presentation-encouragement)))
(lyskom-nag-about-presentation t))
(setq lyskom-is-new-user nil)
......
......@@ -168,10 +168,6 @@ kan skapa en ny:\n")
(lyskom-motd-was-garbed . "\nLoginmeddelandet finns inte!
Det meddelande som ska visas efter inloggning har frsvunnit.
Kontakta LysKOM-administratren.\n")
(presentation-encouragement .
"Du har ingen presentation. Det skulle vara trevligt om du skrev en.
Anvnd kommandot p. Om du inte vill skriva ngon presentation tryck fs.\n")
(first-greeting . "%#1s
Det tycks vara frsta gngen du anvnder LysKOM. Vlkommen!
Kontrollera att du stavat ditt namn rtt. Anvnd grna ditt fullstndiga
......@@ -1967,7 +1963,23 @@ teckenkodning.
(text-has-no-comments . "Inlgg %#1n har inga kommentarer\n")
(text-has-no-footnotes . "Inlgg %#1n har inga fotnoter\n")
(set-message-flag-q . "Ta emot gruppmeddelanden till %#1M? ")
))
(why-you-got-no-presentation . "\
%#1@\
========================================================================
Du har ingen presentation%#2?z%[ men har skrivit %#2d inlgg%]%[%]
Anvnd kommandot \"ndra presentation\" fr att skriva eller ndra din
presentation.
%[%#4F\
Din presentation lter andra i %#3s veta lite om vem du r, och det
bidrar till knslan av samhrighet i %#3s. Det hr meddelandet kommer
att upprepas d och d tills du har skrivit en presentation.%]
========================================================================
")
))
(lyskom-language-var local lyskom-month-names sv
'(("januari" . 1) ("jan" . 1)
......
......@@ -1952,3 +1952,37 @@ Any whitespace and newlines in TEXT will be ignored."
(let ((text (replace-in-string text "\\s-+" "")))
(or (string-match "^\\(file://\\|ftp://\\|gopher://\\|http://\\|https://\\|news:\\|wais://\\|mailto:\\|telnet:\\)[^\t \012\014\"<>|\\]*[^][\t \012\014\"<>|.,!(){}?'`:;]$" text)
(string-match "^\\(www\\|ftp\\|home\\)\\.[^\t \012\014\"<>|\\]*[^][\t \012\014\"<>|.,!(){}?'`:;]$" text)))))
(defun lyskom-get-server-alias (&optional name)
"Return the alias for server NAME."
(let ((lyskom-both-server-aliases (append kom-server-aliases
kom-builtin-server-aliases)))
(or (cdr (lyskom-string-assoc (or name lyskom-server-name)
lyskom-both-server-aliases))
name
lyskom-server-name)))
(defun lyskom-nag-about-presentation (&optional harder)
(unless kom-dont-complain-about-missing-presentation
(blocking-do-multiple
((pers-stat (get-pers-stat (or lyskom-pers-no 0)))
(conf-stat (get-conf-stat (or lyskom-pers-no 0))))
(when (and pers-stat conf-stat
(or harder
(eq (random
(max 3 (- 20
(pers-stat->no-of-created-texts pers-stat)
(* 5 (pers-stat->created-confs pers-stat))
(* 2 (pers-stat->created-persons pers-stat)))))
1))
(null (blocking-do 'get-text-stat
(conf-stat->presentation conf-stat))))
(lyskom-beep 2)
(lyskom-format-insert 'why-you-got-no-presentation
`(face ,kom-warning-face)
(pers-stat->no-of-created-texts pers-stat)
(lyskom-get-server-alias)
72)
(sit-for (if harder 0 1))))))
......@@ -122,6 +122,15 @@ if the variable is in kom-dont-read-saved-variables."
;;; User flags
(def-kom-var kom-dont-complain-about-missing-presentation nil
"*Controls whether the client complains when you don't have
a presentation. When set to non-nil, the client will never
complain.
This variable should not be documented. Anybody asocial enough
to want this feature ought to have to work to find it."
server)
(def-kom-var kom-show-sync-messages nil
"**Controls display of database saving message.
......
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