Commit a6e6b2e1 authored by David Kågedal's avatar David Kågedal
Browse files

Hantera trasig kom-do-when-done.

Snabbare vilkalista.
Flytta inlägg.
parent c9b70898
Sat Aug 10 04:30:43 1996 David Kgedal <davidk@lysator.liu.se>
* swedish-strings.el (lyskom-commands): La till "Flytta text".
* lyskom-rest.el (lyskom-what-to-do-when-done): Hantera en trasig
kom-when-do-when-done en aning snyggare.
* commands1.el (kom-sub-recipient): Anvnd def-kom-command.
(lyskom-add-sub-recipient): Skrev om fr att skta flyttning
ocks.
(kom-move-text): Nytt kommando.
Fri Aug 9 01:18:34 1996 David Kgedal <davidk@lysator.liu.se>
* commands1.el (kom-who-is-on): Skriv ut felmeddelande om det inte
fanns ngra inloggade.
(lyskom-who-is-on-9): Signalera om det inte fanns ngra inloggade.
* swedish-strings.el,english-strings (lyskom-strings): La till
null-who-info.
* vars.el.in (kom-idle-hide): Ny variabel.
* commands1.el (lyskom-combine-username): Hantera username utan
......
......@@ -1487,12 +1487,18 @@ If MARK-NO == 0, review all marked texts."
;;; Rewritten by: David K}gedal
(put 'lyskom-no-users 'error-conditions
'(error lyskom-error lyskom-no-users))
(def-kom-command kom-who-is-on (&optional arg)
"Display a list of all connected users."
(interactive "P")
(if (>= (car (cdr (assq 'protocol-version lyskom-server-supports))) 9)
(lyskom-who-is-on-9 arg)
(lyskom-who-is-on-8)))
(condition-case err
(if (>= (car (cdr (assq 'protocol-version lyskom-server-supports))) 9)
(lyskom-who-is-on-9 arg)
(lyskom-who-is-on-8))
(lyskom-no-users
(lyskom-insert (lyskom-get-string 'null-who-info)))))
(defun lyskom-who-is-on-8 ()
......@@ -1564,9 +1570,11 @@ Uses Protocol A version 9 calls"
(< (dynamic-session-info->session who1)
(dynamic-session-info->session who2))))))
(total-users (length who-list))
(session-width (1+ (length (int-to-string
(dynamic-session-info->session
(nth (1- total-users) who-list))))))
(session-width (if (null who-list)
(signal 'lyskom-no-users nil)
(1+ (length (int-to-string
(dynamic-session-info->session
(nth (1- total-users) who-list)))))))
(format-string-1 (lyskom-info-line-format-string
session-width "P" "M"))
(format-string-2 (lyskom-info-line-format-string
......@@ -1979,7 +1987,7 @@ footnotes) to it as read in the server."
;;; Addera mottagare - Add recipient
;;; Subtrahera mottagare - Subtract recipient
;;; Author: David Byers
;;; Author: David Byers & David K}gedal
;;; Based on code by Inge Wallin
......@@ -2003,69 +2011,110 @@ the user has used a prefix command argument."
'add-copy
conf)))
(defun kom-sub-recipient (text-no-arg)
(def-kom-command kom-sub-recipient (text-no-arg)
"Subtract a recipient from a text. If the argument TEXT-NO-ARG is non-nil,
the user has used a prefix command argument."
(interactive "P")
(lyskom-start-of-command 'kom-sub-recipient)
(unwind-protect
(let ((conf (blocking-do 'get-conf-stat lyskom-current-conf)))
(lyskom-add-sub-recipient text-no-arg
(lyskom-get-string 'text-to-delete-recipient)
'sub
conf))
(lyskom-end-of-command)))
(let ((conf (blocking-do 'get-conf-stat lyskom-current-conf)))
(lyskom-add-sub-recipient text-no-arg
(lyskom-get-string 'text-to-delete-recipient)
'sub
conf)))
(def-kom-command kom-move-text (text-no-arg)
"Subtract a recipient from a text and add another.
If the argument TEXT-NO-ARG is non-nil, the user has used a prefix
command argument."
(interactive "P")
(blocking-do-multiple ((default-from (get-conf-stat lyskom-current-conf))
(default-to (get-conf-stat lyskom-last-added-rcpt)))
(lyskom-add-sub-recipient text-no-arg
(lyskom-get-string 'text-to-move)
'move
default-to
default-from)))
(defun lyskom-add-sub-recipient (text-no-arg
prompt
action
conf)
(let ((text-no (lyskom-read-number prompt
(or text-no-arg lyskom-current-text)))
(conf-to-add-to (lyskom-read-conf-stat
(lyskom-get-string
(cond ((eq action 'add-rcpt) 'who-to-add-q)
((eq action 'add-copy) 'who-to-add-copy-q)
((eq action 'sub) 'who-to-sub-q)
(t (lyskom-error "internal error"))))
'(all)
nil
(if conf (conf-stat->name conf) "")))
(result nil))
conf
&optional conf2)
(let* ((text-no (lyskom-read-number prompt
(or text-no-arg lyskom-current-text)))
(text-stat (blocking-do 'get-text-stat text-no))
(was-read (lyskom-text-read-p text-stat))
;; Only for moving
(conf-to-move-from (if (eq action 'move)
(lyskom-read-conf-stat
(lyskom-get-string 'who-to-move-from-q)
'(all)
nil
(if conf2 (conf-stat->name conf2) ""))))
(conf-to-add-to (lyskom-read-conf-stat
(lyskom-get-string
(cond ((eq action 'add-rcpt) 'who-to-add-q)
((eq action 'add-copy) 'who-to-add-copy-q)
((eq action 'sub) 'who-to-sub-q)
((eq action 'move) 'who-to-move-to-q)
(t (lyskom-error "internal error"))))
'(all)
nil
(if conf (conf-stat->name conf) "")))
(result nil))
(setq result
(cond ((eq action 'add-rcpt)
(lyskom-format-insert 'adding-name-as-recipient
conf-to-add-to
text-no)
text-stat)
(setq lyskom-last-added-rcpt
(conf-stat->conf-no conf-to-add-to))
(blocking-do 'add-recipient
text-no
(conf-stat->conf-no conf-to-add-to)
'recpt)
(setq lyskom-last-added-rcpt
(conf-stat->conf-no conf-to-add-to)))
'recpt))
((eq action 'add-copy)
(lyskom-format-insert 'adding-name-as-copy
conf-to-add-to
text-no)
text-stat)
(setq lyskom-last-added-ccrcpt
(conf-stat->conf-no conf-to-add-to))
(blocking-do 'add-recipient
text-no
(conf-stat->conf-no conf-to-add-to)
'cc-recpt)
(setq lyskom-last-added-ccrcpt
(conf-stat->conf-no conf-to-add-to)))
'cc-recpt))
((eq action 'sub)
(lyskom-format-insert 'remove-name-as-recipient
(conf-stat->conf-no conf-to-add-to)
text-no)
conf-to-add-to
text-stat)
(blocking-do 'sub-recipient
text-no
(conf-stat->conf-no conf-to-add-to)))
((eq action 'move)
(lyskom-format-insert 'moving-name
conf-to-move-from
conf-to-add-to
text-stat)
(setq lyskom-last-added-rcpt
(conf-stat->conf-no conf-to-add-to))
(blocking-do-multiple
((add (add-recipient
text-no
(conf-stat->conf-no conf-to-add-to)
'recpt))
(sub (sub-recipient
text-no
(conf-stat->conf-no conf-to-move-from))))
(and add sub)))
(t (lyskom-error "internal error"))))
(cache-del-text-stat text-no)
(if was-read (lyskom-mark-as-read (blocking-do 'get-text-stat text-no)))
(lyskom-report-command-answer result)))
......
......@@ -302,6 +302,7 @@ and you have finished reading. Please come back later.
(text-to-add-recipient . "Add recipient to which article:")
(text-to-add-copy . "Add recipient of carbon copy of which article:")
(text-to-delete-recipient . "Remove recipient from which article:")
(text-to-move . "Which text do you want to move: ")
(text-to-add-comment-to . "Add comment to which article:")
(text-to-delete-comment-from . "Remove comment from which article:")
......@@ -352,11 +353,14 @@ Read all about it at http://www.lysator.liu.se/history/")
(who-to-add-q . "Add who/what as a recipient: ")
(who-to-add-copy-q . "Add which conference/user as recipient of a carbon copy: ")
(who-to-sub-q . "Remove who/what as a recipient: ")
(who-to-move-from-q . "Move from where: ")
(who-to-move-to-q . "Move to where: ")
(adding-name-as-recipient . "Adding %#1M as recipient of article %#2n...")
(adding-name-as-copy . "%#1M will receive a carbon copy of article %#2n...")
(remove-name-as-recipient .
"Removing %#1M as recipient of article %#2n...")
(moving-name . "Moving text %#3n from %#1M to %#2M...")
(text-to-add-q . "Add which article as a comment: ")
(text-to-remove-q . "Remove which article as a comment: ")
(add-comment-to . "Adding article %#1n as a comment to text %#2n...")
......@@ -373,6 +377,7 @@ Read all about it at http://www.lysator.liu.se/history/")
(who-is-active-all . "Showing all sessions.\n")
(who-is-active-last-minnutes . "Showing all sessions active tha last %#1d minutes.\n")
(showing-invisibles . "Showing invisible sessions.\n")
(null-who-info . "No one (active) is logged in.\n")
; From commands2.el:
......@@ -746,6 +751,8 @@ Send a bug report.\n")
(mode-line-letters . "letters ")
(error-code . "Error code %#2d: %#1s.\n")
(error-in-kom-do-when-done . "The variable kom-do-when-done has an erroneous value.
You should set it to a better value.\n")
(extended-command . "LysKOM: ")
(wait-for-server . "LysKOM is waiting for a response from the server. Wait for the prompt.\n")
(review-text-q . "Review article: ")
......@@ -1009,6 +1016,7 @@ Using %#6D from %#3s\n")
(kom-add-recipient "Add recipient")
(kom-add-copy "Add (recipient of) carbon copy")
(kom-sub-recipient "Remove recipient")
(kom-move-text "Move text")
(kom-add-comment "Add comment")
(kom-sub-comment "Remove comment")
(kom-add-member "Add (a) member")
......
No preview for this file type
......@@ -301,6 +301,7 @@ du har l\344st klart allting. Kom tillbaks senare.
(text-to-add-recipient . "Vilket inl\344gg vill du addera mottagare till:")
(text-to-add-copy . "Vilket inl\344gg vill du addera en extra kopia till:")
(text-to-delete-recipient . "Vilket inl\344gg vill du subtrahera mottagare fr\345n:")
(text-to-move . "Vilket inl\344gg vill du flytta: ")
(text-to-add-comment-to . "Vilket inl\344gg vill du addera en kommentar till:")
(text-to-delete-comment-from . "Vilket inl\344gg vill du subtrahera en kommentar fr\345n:")
......@@ -366,11 +367,14 @@ i svensk datorhistoria. L\344s mer p\345 http://www.lysator.liu.se/history/")
(who-to-add-q . "Vilket m\366te/person vill du addera som mottagare? ")
(who-to-add-copy-q . "Vilket m\366te/person vill du addera som kopiemottagare? ")
(who-to-sub-q . "Vilket m\366te/person vill du subtrahera som mottagare? ")
(who-to-move-from-q . "Fr\345n vilket m\366te vill du flytta texten: ")
(who-to-move-to-q . "Vart vill du flytta texten: ")
(adding-name-as-recipient . "Adderar %#1M som mottagare till text %#2n...")
(adding-name-as-copy . "Adderar %#1M som kopiemottagare till text %#2n...")
(remove-name-as-recipient .
"Subtraherar %#1M som mottagare fr\345n text %#2n...")
(moving-name . "Flyttar text %#3n fr\345n %#1M till %#2M...")
(text-to-add-q . "Vilket inl\344gg vill du addera som kommentar? ")
(text-to-remove-q . "Vilket inl\344gg vill du subtrahera som kommentar? ")
(add-comment-to . "Adderar text %#1n som kommentar till text %#2n...")
......@@ -386,6 +390,7 @@ i svensk datorhistoria. L\344s mer p\345 http://www.lysator.liu.se/history/")
(who-is-active-all . "Visar alla sessioner.\n")
(who-is-active-last-minutes . "Visar alla sessioner som har varit aktiva de senaste %#1d minuterna.\n")
(showing-invisibles . "Visar osynliga sessioner.\n")
(null-who-info . "Det finns inga (aktiva) inloggade.\n")
; From commands2.el:
......@@ -779,6 +784,8 @@ Skicka en bugrapport.\n")
(mode-line-letters . "brev ")
(error-code . "Felkod %#2d: %#1s.\n")
(error-in-kom-do-when-done . "Variabeln kom-do-when-done har ett felaktigt v\344.
Du b\366r s\344tta den till ett b\344ttre v\344rde.\n")
(extended-command . "LysKOM: ")
(wait-for-server . "LysKOM v\344ntar p\345 svar fr\345n servern. V\344nta tills du f\345r en prompt.\n")
(review-text-q . "\305terse text nummer: ")
......@@ -1053,6 +1060,7 @@ och har inte varit aktiv p\345 %#9d minuter\n")
(kom-add-recipient "Addera mottagare")
(kom-add-copy "Addera extra kopiemottagare")
(kom-sub-recipient "Subtrahera mottagare")
(kom-move-text "Flytta inl\344gg")
(kom-add-comment "Addera kommentar")
(kom-sub-comment "Subtrahera kommentar")
(kom-add-member "Addera medlem")
......@@ -1244,6 +1252,7 @@ Cf. paragraph-start.")
(define-key lyskom-mode-map "t" 'kom-display-time)
(define-key lyskom-mode-map "fu" 'kom-get-appreciation)
(define-key lyskom-mode-map "fs" 'kom-get-abuse)
(define-key lyskom-mode-map "ft" 'kom-move-text)
(define-key lyskom-mode-map "f{" 'kom-filter-subject)
(define-key lyskom-mode-map "f[" 'kom-filter-subject)
;; (define-key lyskom-mode-map "f\344" 'kom-filter-subject)
......
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