Commit f704e6b6 authored by Johan Sundström's avatar Johan Sundström
Browse files

Let's make it comfier to make friends and foes.

parent 62b1a75f
2006-02-16 Johan Sundstrm <>
* commands2.el (kom-moronify, kom-befriend): New commands to add
persons to `kom-morons' and `kom-friends' right in the kom buffer.
* (lyskom-default-conference-strategy): Associated
default strategies.
(lyskom-button-actions): ...and button actions for persons.
* completing-read.el
(lyskom-default-conference-author-of-text-at-point): New strategy
helper function. Should be used with kom-filter-author as well,
but I leave that for a separate commit, to make good change sets.
* english-strings.el, swedish-strings.el (lyskom-message):
Associated texts. Naming of these things could probably improve.
2005-10-26 Pontus Freyhult <>
* prefetch.el (lyskom-setup-prefetch): Set lyskom-inhibit-prefetch to
......@@ -518,6 +518,30 @@ This command accepts text number prefix arguments \(see
(and tmp (list tmp))))
(def-kom-command kom-moronify (&optional whom)
"Add person to `kom-morons' list."
(let ((moron (or whom
(lyskom-read-conf-no 'moronify-whom '(pers) nil nil t))))
(when (not (memq moron kom-morons))
(setq kom-morons (cons moron kom-morons))
(lyskom-save-options (current-buffer)
(lyskom-get-string 'moronify-saving)
(lyskom-get-string 'moronify-saving-done)
(lyskom-get-string 'moronify-saving-error)))))
(def-kom-command kom-befriend (&optional whom)
"Add person to `kom-friends' list."
(let ((friend (or whom
(lyskom-read-conf-no 'befriend-whom '(pers) nil nil t))))
(when (not (memq friend kom-friends))
(setq kom-friends (cons friend kom-friends))
(lyskom-save-options (current-buffer)
(lyskom-get-string 'befriend-saving)
(lyskom-get-string 'befriend-saving-done)
(lyskom-get-string 'befriend-saving-error)))))
(def-kom-command kom-send-message (&optional who message)
"Send a message to another user or all members of a conference.
Messages sent with this command are not texts and are not stored
......@@ -203,6 +203,11 @@ See lyskom-read-conf for a description of the parameters."
(list (text-stat->author
(blocking-do 'get-text-stat (lyskom-get-last-read-text))))))
(defun lyskom-default-conference-author-of-text-at-point (&rest args)
(let ((text (lyskom-text-at-point)))
(and text
(list (text-stat->author (blocking-do 'get-text-stat text))))))
(defun lyskom-default-conference-restriction (predicate &rest args)
(and (assq 'restrict predicate)
(cdr (assq 'restrict predicate))))
......@@ -743,6 +743,14 @@ Read all about it at")
(pers-membership-line . "%#5@%#1s%#2s%#3M %#4s\n")
(pers-membership-line-2 . " Added %#1s by %#2P\n")
(is-supervisor-mark . "O ")
(moronify-saving . "Saving change...")
(moronify-saving-done . "Saving change...done")
(moronify-saving-error . "Couldn't save change!")
(befriend-saving . "Saving change...")
(befriend-saving-done . "Saving change...done")
(befriend-saving-error . "Couldn't save change!")
(moronify-whom . "Add whom to morons list? ")
(befriend-whom . "Add whom to friends list? ")
(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")
......@@ -1817,6 +1825,8 @@ You must become an active member of the conference to enter it.\n")
(lyskom-button-view-session-status-action . "View session status")
(lyskom-button-mail-action . "Send letter")
(lyskom-button-send-message-action . "Send personal message")
(lyskom-button-moronify-action . "Add to morons list")
(lyskom-button-befriend-action . "Add to friend list")
(lyskom-button-open-url-action . "Open")
(lyskom-button-copy-url-action . "Copy")
(lyskom-button-goto-info-node-action . "Open")
......@@ -2173,6 +2183,8 @@ Change privileges for %#1P (%#1p)...")
(kom-help . "Help")
(kom-slow-mode . "Long commands")
(kom-quick-mode . "Short commands")
(kom-moronify . "Add to morons list")
(kom-befriend . "Add to friend list")
(kom-send-message . "Send message")
(kom-send-alarm . "Send alarm")
(kom-create-conf . "Create conference")
......@@ -3227,7 +3239,7 @@ Select whether to execute command or keyboard macro.")
(morons . "Morons and other \"special\" people")
(friends . "Friends and other special people")
(me . "Mig, myself and I")
(me . "Me, myself and I")
(i-am-supervisor . "Conferences i supervise")
(has-no-presentation . "Conferences without presentations")
(highlight-conferences . "Conferences:")
......@@ -754,6 +754,14 @@ i svensk datorhistoria. L
(pers-membership-line . "%#5@%#1s%#2s%#3M %#4s\n")
(pers-membership-line-2 . " Adderad %#1s av %#2P\n")
(is-supervisor-mark . "O ")
(moronify-saving . "Sparar ndringen...")
(moronify-saving-done . "Sparar ndringen...klart")
(moronify-saving-error . "Kunde inte spara ndringen!")
(befriend-saving . "Sparar ndringen...")
(befriend-saving-done . "Sparar ndringen...klart")
(befriend-saving-error . "Kunde inte spara ndringen!")
(moronify-whom . "Lgg vem p minuslistan? ")
(befriend-whom . "Lgg vem p pluslistan? ")
(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")
......@@ -1866,6 +1874,8 @@ Du m
(lyskom-button-view-session-status-action . "Visa sessionsstatus")
(lyskom-button-mail-action . "Skicka brev")
(lyskom-button-send-message-action . "Snd meddelande")
(lyskom-button-moronify-action . "Lgg p idiot/knppskalle-listan")
(lyskom-button-befriend-action . "Lgg p vnner/bekanta-listan")
(lyskom-button-open-url-action . "ppna")
(lyskom-button-copy-url-action . "Kopiera")
(lyskom-button-goto-info-node-action . "ppna")
......@@ -2215,6 +2225,8 @@ Nuvarande r
(kom-help . "Hjlp")
(kom-slow-mode . "Lngsamma kommandon")
(kom-quick-mode . "Snabba kommandon")
(kom-moronify . "Lgg p idiot/knppskalle-listan")
(kom-befriend . "Lgg p vnner/bekanta-listan")
(kom-send-message . "Snda meddelande")
(kom-send-alarm . "Skicka alarmmeddelande")
(kom-create-conf . "Skapa mte")
......@@ -367,6 +367,14 @@ 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-moronify (moronify-whom
(default . (lyskom-default-conference-at-point
(kom-befriend (befriend-whom
(default . (lyskom-default-conference-at-point
(kom-send-alarm (who-to-send-message-to
(default . (lyskom-default-conference-for-send-message))))
......@@ -481,6 +489,9 @@ lyskom-default-conference-self returns the logged-in person.
lyskom-default-conference-last-author returns the author of the most
recently read text.
lyskom-default-conference-author-of-text-at-point returns the author
of the text at point.
lyskom-default-conference-saved returns saved input. This must be
specified as a list in INITAL-VALUES, where the argument (second
element of the list) is the symbol under which the input was saved,
......@@ -3148,7 +3159,9 @@ Values other than `nil' and strings are reserved for future use."
(lyskom-button-goto-conf-action . lyskom-button-goto-conf)
(lyskom-button-view-session-status-action . lyskom-button-view-session-status)
(lyskom-button-mail-action . lyskom-button-mail)
(lyskom-button-send-message-action . lyskom-button-send-message))
(lyskom-button-send-message-action . lyskom-button-send-message)
(lyskom-button-moronify-action . lyskom-button-moronify)
(lyskom-button-befriend-action . lyskom-button-befriend))
; Hints
((kom-list-news . lyskom-button-goto-conf)
(kom-membership . lyskom-button-goto-conf))
......@@ -3455,6 +3468,8 @@ Users are encouraged to use their best sense of humor."
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