Commit e9f65494 authored by David Byers's avatar David Byers
Browse files

Some changes to kom-send-alarm.

Detailed changes:
> 2004-02-23  David Byers  <byers@lysator.liu.se>
>
> 	Further reduce the likelihood of sending alarm messages
> 	unintentionally:
> 	* commands2.el (lyskom-interactive-send-message): New function.
> 	(kom-send-alarm): Use it.
> 	(kom-send-message): Use it.
>
1a10,11
>
> 	* NEWS-0.48: Updated to here.
parent 23f2c3df
2004-02-23 David Byers <byers@lysator.liu.se>
Further reduce the likelihood of sending alarm messages
unintentionally:
* commands2.el (lyskom-interactive-send-message): New function.
(kom-send-alarm): Use it.
(kom-send-message): Use it.
2004-02-22 David Byers <byers@lysator.liu.se>
* NEWS-0.48: Updated to here.
Clean up for XEmacs:
* lyskom-rest.el (lyskom-startup-check-recommended-memberships):
Don't bind pers-stat. It's not used.
......
......@@ -633,17 +633,7 @@ Runs `kom-send-message-setup-hook' when entering the minibuffer.
See `kom-default-message-recipient'."
(interactive)
(let* ((target (or who
(lyskom-read-conf-no
`(who-to-send-message-to ,(lyskom-get-string 'nobody))
(if kom-permissive-completion '(all) '(login conf))
t nil t))))
(if (zerop target)
(lyskom-format-insert 'message-use-alarm-instead
(lyskom-command-name 'kom-send-alarm))
(setq lyskom-last-message-recipient target)
(lyskom-format-insert 'message-recipient-info target)
(lyskom-send-message target message))))
(lyskom-interactive-send-message who message nil))
(def-kom-command kom-send-alarm (&optional message)
......@@ -653,8 +643,32 @@ everyone who is logged on.
Runs `kom-send-message-setup-hook' when entering the minibuffer."
(interactive)
(lyskom-insert (lyskom-get-string 'message-all-info))
(lyskom-send-message 0 message))
(lyskom-interactive-send-message nil message t))
(defun lyskom-interactive-send-message (who message alarm-ok)
"Implementation of kom-send-message and kom-send-alarm."
(let* ((target (or who
(lyskom-read-conf-no
(list 'who-to-send-message-to
(lyskom-get-string (if alarm-ok 'everybody 'nobody)))
(if kom-permissive-completion '(all) '(login conf))
t nil t))))
(cond ((and (zerop target)
(not alarm-ok))
(lyskom-format-insert 'message-use-alarm-instead
(lyskom-command-name 'kom-send-alarm)))
((not (zerop target))
(setq lyskom-last-message-recipient target)
(lyskom-format-insert 'message-recipient-info target)
(lyskom-send-message target message))
(t (lyskom-format-insert 'message-all-info
`(face ,kom-warning-face)
'kom-send-message
(max 20 (- (window-width) 8)))
(lyskom-beep t)
(lyskom-send-message target message)))))
(defvar lyskom-message-recipient)
......@@ -693,7 +707,7 @@ send. If DONTSHOW is non-nil, don't display the sent message."
'lyskom-send-message-minibuffer-exit-hook)
(setq lyskom-message-string
(or message
(lyskom-read-string (lyskom-get-string 'message-prompt)
(lyskom-read-string (lyskom-format 'message-prompt pers-no)
nil
'lyskom-message-history)))
(setq lyskom-message-recipient (if (zerop pers-no)
......
......@@ -718,7 +718,7 @@ Read all about it at http://www.lysator.liu.se/history/")
(who-to-send-message-to . "Send message to whom? (%#1s) ")
(send-empty-message-p . "The message is empty. Send it anyway? ")
(his-total-unread . "\n%#1M has %#2d unread texts (plus %#3d in passive memberships).\n")
(message-prompt . "Message: ")
(message-prompt . "Message%#1?z%[%]%[ (till alla inloggade)%]: ")
(message-sent-to-user . "\
%[%#3$================================================================
%]%[%#4$Your message for %#2M:
......@@ -752,7 +752,12 @@ Read all about it at http://www.lysator.liu.se/history/")
-------------------------------------------------------------------------------
%]")
(message-use-alarm-instead . "Use %#1s to send alarm messages.\n")
(message-all-info . "Send alarm\n")
(message-all-info . "\
%#1@Send alarm message to all users.
%[%#3FConsider using \"%#2C\" to send your message to a specific
conference or user.%]
")
(message-recipient-info . "Send message to %#1M\n")
(message-nope .
"Unable to send message. %#3s\
......
;;;;; -*-coding: iso-8859-1;-*-
;;;; -*-coding: iso-8859-1;-*-
;;;;;
;;;;; $Id$
;;;;; Copyright (C) 1991-2002 Lysator Academic Computer Association.
......@@ -715,7 +715,7 @@ i svensk datorhistoria. L
(who-to-send-message-to . "Vem vill du skicka meddelandet till? (%#1s) ")
(send-empty-message-p . "Meddelandet r tomt. Vill du nd skicka det? ")
(his-total-unread . "\n%#1M har totalt %#2d olsta (plus %#3d i passiva medlemskap).\n")
(message-prompt . "Meddelande: ")
(message-prompt . "Meddelande%#1?z%[%]%[ (till alla inloggade)%]: ")
(message-sent-to-user . "\
%[%#3$\
================================================================
......@@ -757,7 +757,12 @@ Ditt alarmmeddelande l
-------------------------------------------------------------------------------
%]")
(message-use-alarm-instead . "Anvnd kommandot %#1s fr att skicka alarmmeddelanden.\n")
(message-all-info . "Snd alarmmeddelande\n")
(message-all-info . "\
%#1@Snd alarmmeddelande till alla inloggade.
%[%#3Fvervg att anvnda \"%#2C\" fr att skicka meddelandet till ett
specifikt mte eller en enskild anvndare.%]
")
(message-recipient-info . "Snd meddelande till %#1M\n")
(message-nope
. "Det gick inte. %#3s\
......
......@@ -356,6 +356,9 @@ the priority among links that match the same text is undefined."
(kom-send-message (who-to-send-message-to
(default . (lyskom-default-conference-for-send-message))))
(kom-send-alarm (who-to-send-message-to
(default . (lyskom-default-conference-for-send-message))))
(kom-is-person-member-of-conference (pers-to-check-mship-for)
(conf-to-check-mship-of))
......
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