Commit 1ff95867 authored by David Byers's avatar David Byers
Browse files

Ny completing-read, småfel i filter.el, ansaphone.el, vars.el

parent ca8d65ca
Mon Jul 8 10:37:48 1996 David Byers <davby@sen2.ida.liu.se>
* filter.el (kom-super-jump): Vljer mottagare att filtrera som
aktuellt mte om inlgget har aktuellt mte som mottagare, annars
inlggets frsta mottagare.
* english-strings.el, swedish-strings.el (lyskom-strings): Lade
till no-recipient.
Thu Jul 4 14:10:36 1996 David Byers <davby@sen2.ida.liu.se>
* completing-read.el: Totalt omskriven. Strre, kanske
lngsammare, men jag vet hur den fungerar nu.
(lyskom-read-conf-no): Ny betydelse av PREDICATE-parametern.
(lyskom-read-conf-stat): Ny parameterlista (nytt PREDICATE,
MUSTMATCH tillagt.)
(lyskom-read-conf-name): Nu parameterlista. Ny ordning, lagt till
EMPTY-parametern.
(lyskom-read-conf-internal): Ny funktion som gr allt jobb.
(lyskom-read-conf-name-internal): Utbytt mot
lyskom-read-conf-internal.
(lyskom-read-conf-get-logins, lyskom-read-conf-expand-specials,
lyskom-read-conf-lookup-specials, lyskom-lookup-conf-by-name,
lyskom-complete-collect, lyskom-read-conf-internal-verify-type,
lyskom-complete-string, lyskom-complete-string-up-level,
lyskom-complete-string-skip-parens-backup-others,
lyskom-complete-string-skip-parens-2,
lyskom-complete-string-next-word,
lyskom-complete-string-reset-position): Nya funktioner.
* startup.el (kom-start-anew): ndrade predicate-parametern till
lyskom-read-conf-nnting. Anvnd lyskom-lookup-conf-by-name.
* review.el (lyskom-review-by-to): ndrade predicate-parametern
till lyskom-read-conf-nnting.
* commands2.el (kom-status-conf, kom-status-person,
kom-send-message, kom-set-garb-nice, kom-set-permitted-submitters,
kom-set-super-conf, kom-change-conf-type): ndrade
predicate-parametern till lyskom-read-conf-nnting.
* edit-text.el (lyskom-edit-add-recipient/copy): ndrade
predicate-parametern till lyskom-read-conf-nnting.
* filter.el (kom-filter-subject, kom-filter-author,
kom-filter-text): ndrade predicate-parametern till
lyskom-read-conf-nnting.
* commands1.el (kom-delete-conf, kom-review-presentation,
kom-send-letter, kom-add-member, kom-add-self, kom-sub-member,
kom-sub-self, kom-change-presentation, kom-change-conf-motd,
kom-unset-conf-motd, kom-go-to-conf, kom-change-name,
kom-change-supervisor, kom-change-password,
lyskom-add-sub-recipient): ndrade predicate-parametern till
lyskom-read-conf-nnting.
* startup.el (kom-start-anew): Anropa lyskom-login-hook oxo. Den
sparas *inte* i servern.
* vars.el.in (lyskom-text-buttons): Ny definition av regexpen fr
textnummer.
Tue Jul 2 09:14:53 1996 David Kgedal <davidk@lysator.liu.se>
* lyskom-rest.el (lyskom-prefetch-comment-stats): Ny funktion.
......@@ -11,6 +74,18 @@ Sun Jun 23 02:16:23 1996 David K
* edit-text.el (lyskom-edit-parse-headers): Kr
lyskom-swascii-header-subject genom regexp-quote innan matchning.
Sat Jun 22 17:15:53 1996 David Byers <davby@sen2.ida.liu.se>
* ansaphone.el (lyskom-ansaphone-message-handler): Spara
meddelanden enbart om kom-ansaphone-record-messages r icke-nil
(request frn Tommy Persson). Visa inte alltid meddelanden som
spelas in.
* vars.el.in (lyskom-elisp-variables): Lade till
kom-ansaphone-record-messages och kom-ansaphone-show-messages.
(kom-ansaphone-record-messages): Ny variabel.
(kom-ansaphone-show-messages): Nu variabel.
Thu Jun 20 01:08:00 1996 David Kgedal <davidk@lysator.liu.se>
* async.el (lyskom-show-logged-in-person): Hantera hemliga
......
......@@ -3,7 +3,14 @@ Att g
Buggar
Completion-koden är ivägen när man vill skapa nya personer.
Completion bryr sig inte om MUSTMATCH-parametern.
Om KOMNAME är satt till "" så kommer completionkoden att försöka
komplettera det till alla personer. Det vill man *inte*.
Completion-koden är ivägen när man vill skapa nya personer. [Nåja,
inte så mycket. Det är bara att man inte får skapa namn som är
prefix till existerande namn]
Om man läser ett inlägg som har en fotnot (t ex 1449843) och vill
spara det på fil, så blir det bara fotnoten som sparas. Man vill
......@@ -22,11 +29,12 @@ Buggar
till nil. (FIXAT)
LysKOMs completing-read är skit. Den gör fel. Den borde skrivas om.
(FIXAT)
lyskom-try-complete-partials borde returnera exakta matchar före
längsta match. Nu blir (lyskom-try-complete-partials "link"
'(("(foo) link (bar)" . 1) ("linkfoobar" . 2))) "linkfoobar", inte
"(foo) link (bar)".
"(foo) link (bar)". (FUNKTIONEN ERSATT; FIXAT)
Om ett namn som fylls i i efterhand gör att raden blir för lång,
så scrollar klienten ibland trots att den inte borde.
......
......@@ -125,6 +125,11 @@ See kom-ansaphone-on"
(lyskom-set-current-message-text (substring text
(match-beginning 1)
(match-end 1)))))
;;
;; See if we want to reply to this message
;;
(if (and kom-ansaphone-on
sender
recipient
......@@ -144,11 +149,25 @@ See kom-ansaphone-on"
lyskom-ansaphone-when-set)
(elt reply 4)))
(lyskom-ansaphone-send-message sender reply)))))
(if (and kom-ansaphone-on sender)
;;
;; See if we want to record this message
;;
(if (and kom-ansaphone-on
kom-ansaphone-record-messages
sender)
(lyskom-ansaphone-record-message sender
recipient
lyskom-message-current-text)))
nil)
;;
;; Perhaps we want to show the message, perhaps not
;;
(if kom-ansaphone-on
(not kom-ansaphone-show-messages)
nil))
......
......@@ -70,7 +70,7 @@
(interactive)
(let ((conf-stat
(lyskom-read-conf-stat (lyskom-get-string 'what-conf-to-delete)
'all)))
'(all))))
(if conf-stat
(if (lyskom-ja-or-nej-p
(lyskom-format 'confirm-delete-pers-or-conf
......@@ -128,7 +128,7 @@
(blocking-do 'get-conf-stat who)
(lyskom-read-conf-stat
(lyskom-get-string 'presentation-for-whom)
'all))))
'(all)))))
(if (null conf-stat)
(lyskom-insert-string 'somebody-deleted-that-conf)
(lyskom-format-insert 'review-presentation-of
......@@ -236,7 +236,7 @@ as TYPE. If no such misc-info, return NIL"
(let* ((tono (or pers-no
(lyskom-read-conf-no
(lyskom-get-string 'who-letter-to)
'all nil nil t)))
'(all) nil nil t)))
(conf-stat (blocking-do 'get-conf-stat tono)))
(if (if (zerop (conf-stat->msg-of-day conf-stat))
t
......@@ -274,9 +274,9 @@ as TYPE. If no such misc-info, return NIL"
Ask for the name of the person, the conference to add him/her to."
(interactive)
(let* ((who (lyskom-read-conf-stat (lyskom-get-string 'who-to-add)
'pers))
'(pers)))
(whereto (lyskom-read-conf-stat (lyskom-get-string 'where-to-add)
'all))
'(all)))
(pers-stat (blocking-do 'get-pers-stat (conf-stat->conf-no who))))
(lyskom-add-member-answer (lyskom-try-add-member whereto who pers-stat)
whereto who)))
......@@ -291,7 +291,7 @@ Ask for the name of the person, the conference to add him/her to."
(let ((whereto (if conf (blocking-do 'get-conf-stat conf)
(lyskom-read-conf-stat
(lyskom-get-string 'where-to-add-self)
'all)))
'(all) nil "" t)))
(who (blocking-do 'get-conf-stat lyskom-pers-no))
(pers-stat (blocking-do 'get-pers-stat lyskom-pers-no)))
(lyskom-add-member-answer (lyskom-try-add-member whereto who pers-stat)
......@@ -455,9 +455,10 @@ Also adds to lyskom-to-do-list."
of the person."
(interactive)
(lyskom-sub-member
(lyskom-read-conf-stat (lyskom-get-string 'who-to-exclude) 'pers nil "")
(lyskom-read-conf-stat (lyskom-get-string 'who-to-exclude)
'(pers) nil "")
(lyskom-read-conf-stat (lyskom-get-string 'where-from-exclude)
'all nil "")))
'(all) nil "")))
(def-kom-command kom-sub-self (&optional conf)
......@@ -467,7 +468,7 @@ of the person."
(blocking-do 'get-conf-stat lyskom-pers-no)
(if conf (blocking-do 'get-conf-stat conf)
(lyskom-read-conf-stat (lyskom-get-string 'leave-what-conf)
'all nil
'(all) nil
(let ((ccn
(if (or (zerop lyskom-current-conf))
""
......@@ -913,7 +914,7 @@ Don't ask for confirmation."
(lyskom-change-pres-or-motd-2
(let ((no (lyskom-read-conf-no
(lyskom-get-string 'what-to-change-pres-you)
'all t nil t)))
'(all) t nil t)))
(if (zerop no)
(setq no lyskom-pers-no))
(blocking-do 'get-conf-stat no))
......@@ -925,7 +926,7 @@ Don't ask for confirmation."
(interactive)
(lyskom-change-pres-or-motd-2
(let ((no (lyskom-read-conf-no (lyskom-get-string 'who-to-put-motd-for)
'all t nil t)))
'(all) t nil t)))
(if (zerop no)
(setq no lyskom-pers-no))
(blocking-do 'get-conf-stat no))
......@@ -990,7 +991,7 @@ TYPE is either 'pres or 'motd, depending on what should be changed."
(interactive)
(let ((conf-stat (or (lyskom-read-conf-stat
(lyskom-get-string 'who-to-remove-motd-for)
'all 'empty)
'(all) t)
(blocking-do 'get-conf-stat lyskom-pers-no))))
(cond
((null conf-stat)
......@@ -1019,7 +1020,7 @@ back on lyskom-to-do-list."
(blocking-do 'get-conf-stat conf-no)
(lyskom-read-conf-stat
(lyskom-get-string 'go-to-conf-p)
'all ""))))
'(all) nil "" t))))
(lyskom-go-to-conf conf)))
......@@ -1224,7 +1225,7 @@ If you are not member in the conference it will be flagged with an asterisk."
(interactive)
(let ((conf-stat (lyskom-read-conf-stat
(lyskom-get-string 'name-to-be-changed)
'all)))
'(all))))
(if (null conf-stat)
(lyskom-insert-string 'no-such-conf-or-pers)
(let (name)
......@@ -1254,13 +1255,13 @@ If you are not member in the conference it will be flagged with an asterisk."
(interactive)
(let ((supervisee (lyskom-read-conf-stat
(lyskom-get-string 'who-to-change-supervisor-for)
'all)))
'(all))))
(if (null supervisee)
(lyskom-insert-string 'no-such-conf-or-pers)
(lyskom-tell-internat 'kom-tell-change-supervisor)
(let ((supervisor (lyskom-read-conf-stat
(lyskom-get-string 'new-supervisor)
'all)))
'(all))))
(lyskom-format-insert 'change-supervisor-from-to
supervisee
supervisor)
......@@ -1385,7 +1386,7 @@ If MARK-NO == 0, review all marked texts."
"Change the password for a person."
(interactive)
(let ((pers-no (lyskom-read-conf-no (lyskom-get-string 'whos-passwd)
'pers 'empty "" t))
'(pers) t "" t))
(old-pw (silent-read (lyskom-get-string 'old-passwd)))
(new-pw1 (silent-read (lyskom-get-string 'new-passwd)))
(new-pw2 (silent-read (lyskom-get-string 'new-passwd-again))))
......@@ -1789,7 +1790,7 @@ the user has used a prefix command argument."
((eq action 'add-copy) 'who-to-add-copy-q)
((eq action 'sub) 'who-to-sub-q)
(t (lyskom-error "internal error"))))
'all
'(all)
nil
(if conf (conf-stat->name conf) "")))
(result nil))
......
......@@ -119,7 +119,7 @@ otherwise: the conference is read with lyskom-completing-read."
(let ((conf-no
(or conf-no
(lyskom-read-conf-no (lyskom-get-string 'conf-for-status)
'all nil nil t)))
'(all) nil nil t)))
conf-stat)
(cache-del-conf-stat conf-no)
(setq conf-stat (blocking-do 'get-conf-stat conf-no))
......@@ -266,7 +266,7 @@ otherwise: the conference is read with lyskom-completing-read."
(let ((pers-no
(or pers-no
(lyskom-read-conf-no (lyskom-get-string 'pers-for-status)
'pers "" nil t)))
'(pers) nil "" t)))
conf-stat
pers-stat)
(cache-del-conf-stat pers-no)
......@@ -422,7 +422,7 @@ otherwise: the conference is read with lyskom-completing-read."
(lyskom-read-conf-no
(format (lyskom-get-string 'who-to-send-message-to)
(lyskom-get-string 'everybody))
'all t
'(all) t
;; Initial string:
(cond
((eq kom-default-message-recipient 'everybody) nil)
......@@ -961,7 +961,7 @@ Format is 23:29 if the text is written today. Otherwise 04-01."
(interactive)
(let ((conf-stat (lyskom-read-conf-stat
(lyskom-get-string 'conf-to-set-garb-nice-q)
'all)))
'(all))))
(if (not conf-stat)
(lyskom-insert-string 'somebody-deleted-that-conf)
(let ((garb-nice (lyskom-read-number
......@@ -987,15 +987,15 @@ Format is 23:29 if the text is written today. Otherwise 04-01."
(interactive)
(let ((conf-stat (lyskom-read-conf-stat
(lyskom-get-string 'conf-to-set-permitted-submitters-q)
'all)))
'(all))))
(if (not conf-stat)
(lyskom-insert-string 'somebody-deleted-that-conf)
(let ((new-conf (lyskom-read-conf-stat
(lyskom-format 'new-permitted-submitters-q
(conf-stat->name conf-stat))
'all
'empty)))
'(all)
t)))
(if (eq new-conf nil)
(lyskom-format-insert 'permitted-submitters-removed-for-conf
conf-stat)
......@@ -1023,13 +1023,13 @@ Format is 23:29 if the text is written today. Otherwise 04-01."
(interactive)
(let ((conf-stat (lyskom-read-conf-stat
(lyskom-get-string 'conf-to-set-super-conf-q)
'all)))
'(all))))
(if (not conf-stat)
(lyskom-insert-string 'somebody-deleted-that-conf)
(let ((new-conf (lyskom-read-conf-stat
(lyskom-format 'new-super-conf-q
(conf-stat->name conf-stat))
'all)))
'(all))))
;; Set the super conference for conf-stat to new-conf.
(lyskom-format-insert 'super-conf-for-is
......@@ -1378,7 +1378,7 @@ membership info."
(interactive)
(let* ((conf-no (lyskom-read-conf-no
(lyskom-get-string 'what-conf-to-change)
'confs nil "" t))
'(conf) nil "" t))
(open (j-or-n-p (lyskom-get-string 'anyone-member)))
(secret (if (not open)
(j-or-n-p (lyskom-get-string 'secret-conf))))
......
This diff is collapsed.
......@@ -548,7 +548,7 @@ Entry to this mode runs lyskom-edit-mode-hook."
(let ((marker (point-min-marker))
(edit-buffer (current-buffer))
(insert-at (point-min-marker))
(conf-stat (lyskom-read-conf-stat prompt 'all nil "")))
(conf-stat (lyskom-read-conf-stat prompt '(all) nil "")))
(lyskom-save-excursion
;;(save-excursion
(set-buffer (process-buffer lyskom-proc))
......
......@@ -808,6 +808,7 @@ Error message: %#1s**************************************************")
(starting-program . "Starting %#1s...")
(super-jump . "Filtering subject \"%#1r\" in conference \"%#2M\"\n")
(no-recipient . "There are no recipients for this article.\n")
(filtered . "[Filtered]")
(filter-error-specification . "Error in the filter specification")
(filter-error-bad-not . "Error in the filter specification after 'not'")
......
......@@ -458,7 +458,7 @@ Otherwise return nil."
(setq filter (cons (cons 'subject subject) filter))
(setq conf (lyskom-read-conf-no
(lyskom-get-string 'filter-in-conf)
'all
'(all)
t
(or (and (conf-stat->conf-no conf-stat)
(conf-stat->name conf-stat))
......@@ -494,7 +494,7 @@ Otherwise return nil."
(text-stat->author text-stat))))
(setq author
(lyskom-read-conf-no (lyskom-get-string 'filter-author)
'pers
'(pers)
t
(or (and auth-stat
(conf-stat->name auth-stat))
......@@ -504,7 +504,7 @@ Otherwise return nil."
(setq filter (cons (cons 'author-no author) filter)))
(setq conf (lyskom-read-conf-no
(lyskom-get-string 'filter-in-conf)
'all
'(all)
t
(or
(and conf-stat
......@@ -532,25 +532,45 @@ Otherwise return nil."
"Skip all texts and comments that share the subject and recipient of
the current text"
(interactive)
(if (zerop lyskom-current-conf)
(progn (lyskom-insert-string 'no-in-conf)
(lyskom-end-of-command))
(if (or (null lyskom-current-text)
(null lyskom-current-subject))
(progn (lyskom-insert-string 'have-to-read)
(lyskom-end-of-command))
(let ((conf-stat (blocking-do 'get-conf-stat lyskom-current-conf)))
(if conf-stat
(progn
(lyskom-add-filter
(make-filter
(list (cons 'subject lyskom-current-subject)
(cons 'recipient-no (conf-stat->conf-no conf-stat)))
(list (cons 'action 'skip-tree)
(cons 'expire t))))
(lyskom-format-insert 'super-jump
(copy-sequence lyskom-current-subject)
conf-stat)))))))
(if (or (null lyskom-current-text)
(zerop lyskom-current-text))
(lyskom-insert-string 'have-to-read)
(let ((text-stat (blocking-do 'get-text-stat lyskom-current-text))
(recipients nil)
(cc-recipients nil)
(filter-recipient nil)
(conf-stat (if (and lyskom-current-conf
(not (zerop lyskom-current-conf)))
(blocking-do 'get-conf-stat lyskom-current-conf))))
(lyskom-traverse misc
(text-stat->misc-info-list text-stat)
(cond ((eq (misc-info->type misc) 'RECPT)
(setq recipients (cons (misc-info->recipient-no misc)
recipients)))
((eq (misc-info->type misc) 'CC-RECPT)
(setq cc-recipients (cons (misc-info->recipient-no misc)
cc-recipients)))))
(setq filter-recipient (or
(and conf-stat
(or
(memq lyskom-current-conf recipients)
(memq lyskom-current-conf cc-recipients))
lyskom-current-conf)
(car (nreverse recipients))
(car (nreverse cc-recipients))))
(if (null filter-recipient)
(lyskom-insert-string 'no-recipient)
(lyskom-add-filter
(make-filter (list (cons 'subject lyskom-current-subject)
(cons 'recipient-no filter-recipient))
(list (cons 'action 'skip-tree)
(cons 'expire t))))
(lyskom-format-insert 'super-jump
(copy-sequence lyskom-current-subject)
filter-recipient)))))
......@@ -578,7 +598,7 @@ the current text"
(setq filter (cons (cons 'text text) filter))
(setq conf (lyskom-read-conf-no
(lyskom-get-string 'filter-in-conf)
'all t
'(all) t
(or (and (conf-stat->conf-no conf-stat)
(conf-stat->name conf-stat))
"")
......
......@@ -125,11 +125,11 @@ The defaults for this command is the conference that you are in."
(- count))))))
(by (lyskom-read-conf-no
(lyskom-format 'review-info (lyskom-format 'info-by-whom info))
'pers 'empty nil t))
'(pers) t nil t))
(to (lyskom-read-conf-no
(lyskom-format 'review-info
(lyskom-format 'info-to-conf info))
'all
'(all)
t
;; If person is not given we must give
;; conf -- Not anymore!
......
......@@ -178,15 +178,17 @@ See lyskom-mode for details."
lyskom-default-user-name)
;; This is nil if we can't find a unique match.
(setq lyskom-pers-no
(lyskom-read-conf-name-internal lyskom-default-user-name
'pers 'conf-no)))
(conf-stat->conf-no
(lyskom-lookup-conf-by-name lyskom-default-user-name
'(pers)))))
(if lyskom-pers-no
nil
(let ((name (lyskom-read-conf-name
(lyskom-get-string 'what-is-your-name)
'persnone t "")))
'(pers none) t "" t)))
(setq lyskom-pers-no
(or (lyskom-read-conf-name-internal name 'pers 'conf-no)
(or (conf-stat->conf-no
(lyskom-lookup-conf-by-name name '(pers)))
(lyskom-create-new-person name)))))
;; Now lyskom-pers-no contains a number of a person.
;; Lets log him in.
......@@ -250,7 +252,9 @@ See lyskom-mode for details."
;; Run the hook kom-login-hook. We don't want to hang the
;; login, just because something crashed here.
(condition-case err
(run-hooks 'kom-login-hook)
(progn
(run-hooks 'kom-login-hook)
(run-hooks 'lyskom-login-hook))
(error (lyskom-format-insert-before-prompt
'error-in-login-hook (format "%s" err)))))
......
......@@ -832,6 +832,7 @@ Felmeddelande: %#1s**************************************************")
(starting-program . "Startar %#1s...")
(super-jump . "Filtrerar \344rende \"%#1r\" i m\366te \"%#2M\"\n")
(no-recipient . "Inl\344gget har ingen mottagare.\n")
(filtered . "[Filtrerad]")
(filter-error-specification . "Fel i filterspecifikationen")
(filter-error-bad-not . "Fel i filterspecifikation efter 'not'")
......
......@@ -355,16 +355,19 @@ This variable is not saved in the LysKOM server.")
(defvar lyskom-text-buttons
'(
;; Text numbers
("\\(\\<[0-9][0-9][0-9][0-9][0-9]*\\>\\)" ; Match
text ; Button type
0 ; Portion that's a button
1 ; Portion that's the arg
nil ; Face or nil (=default)
("\\(\\<[0-9][0-9][0-9][0-9]\\([0-9]\\)?\\([0-9]\\)?\\([0-9]\\)?\\>\\)"
; Match
text ; Button type
0 ; Portion that's a button
1 ; Portion that's the arg
nil ; Face or nil (=default)
)
;; URLs
("\\(file://\\|ftp://\\|gopher://\\|http://\\|https://\\|news:\\|wais://\\|mailto:\\|telnet:\\)[^\t \012 \"<>|\\]*[^\t \012 \"<>|.,!(){}?'`]"
("\\(file://\\|ftp://\\|gopher://\\|http://\\|https://\\|news:\\|wais://\\|mailto:\\|telnet:\\)[^\t \012
\"<>|\\]*[^\t \012
\"<>|.,!(){}?'`]"
url 0 nil kom-url-face)
;; JySKom enhancements
......@@ -497,6 +500,16 @@ This variable is not saved in the LysKOM server.")
(defvar kom-ansaphone-on nil
"t if automatic replies to personal messages are in effect.")
(defvar kom-ansaphone-record-messages t
"*t if messages are recorded while the ansaphone is on.
This variable is stored in the lyskom server.")
(defvar kom-ansaphone-show-messages t
"*t if messages are to be shown when they are recorded.
This variable is stored in the LysKOM server.")
(defvar lyskom-ansaphone-messages nil
"Messages collected by the automatic reply facility.
The most recent message is the first message in the list.")
......@@ -579,6 +592,8 @@ This variable is not saved in the LysKOM server.")
kom-self-control
kom-ansaphone-default-reply
kom-ansaphone-replies
kom-ansaphone-record-messages
kom-ansaphone-show-messages
kom-show-footnotes-immediately
kom-friends
lyskom-fetch-map-nos
......
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