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

Lite kod från Bellman och ett par småfixar

parent 9b67c115
Mon May 20 11:29:39 1996 David Kgedal <davidk@lysator.liu.se>
* commands2.el: En bunt ndringar frn Bellman.
(lyskom-buffer-p): Ny funktion.
(lyskom-update-lyskom-buffer-list): Dito.
(kom-next-kom): Ny implementation.
(kom-previous-kom): Ny funktion.
(kom-next-unread-kom): Ny funktion
* vars.el.in (lyskom-buffer-list): Ny variabel.
* lyskom-rest.el (backward-text): La till ett anrop till
beginning-of-line fr att det inte ska bli fel i gamla Emacsar.
Thu May 9 11:50:39 1996 David Byers <davby@sen2.ida.liu.se>
* commands1.el (kom-list-clients): Lade till en kommentar.
......@@ -15,6 +29,13 @@ Thu May 9 11:50:39 1996 David Byers <davby@sen2.ida.liu.se>
Wed May 8 01:10:11 1996 David Kgedal <davidk@lysator.liu.se>
* commands2.el (kom-status-conf): Uppskjut utskrifen av
medlemmarnas namn.
* macros.el (lyskom-blocking-do-multiple): Kolla process-status.
* services.el (blocking-do): Kolla process-status.
* deferred-insert.el (lyskom-deferred-insert-conf): Gissa om det
r en person p ett bttre stt.
......
......@@ -218,14 +218,12 @@ otherwise: the conference is read with lyskom-completing-read."
(lyskom-insert-string 'member-list-header)
(lyskom-traverse
member (conf-no-list->conf-nos member-list)
(let ((member-conf-stat (blocking-do 'get-conf-stat member))
(membership (blocking-do 'query-read-texts
(let ((membership (blocking-do 'query-read-texts
member
(conf-stat->conf-no conf-stat))))
;; Print a row describing the membership of MEMBER-CONF-STAT
;; Print a row describing the membership of MEMBER
;; (described by MEMBERSHIP) in CONF-STAT.
(if (or (null member-conf-stat)
(null membership))
(if (or (null membership))
(lyskom-insert-string 'secret-membership)
(lyskom-insert
(format "%17s"
......@@ -241,7 +239,7 @@ otherwise: the conference is read with lyskom-completing-read."
(if (zerop unread)
" "
(format "%7d " unread))
member-conf-stat))))))))))
member))))))))))
;;; ================================================================
......@@ -1263,29 +1261,82 @@ membership info."
(bury-buffer))))
(defun lyskom-buffer-p (buf)
;; Returns non-nil if BUF is an active LysKOM buffer
(if (and buf (bufferp buf) (buffer-name buf))
(save-excursion
(set-buffer buf)
(and (eq major-mode 'lyskom-mode)
(boundp 'lyskom-proc)
lyskom-proc
(processp lyskom-proc)
(memq (process-status lyskom-proc) '(run open))))))
(defun lyskom-update-lyskom-buffer-list ()
(mapcar (function
(lambda (buf)
(if (and (lyskom-buffer-p buf)
(not (memq buf lyskom-buffer-list)))
;; This is a LysKOM buffer that we haven't seen yet --
;; add it to the end of lyskom-buffer-list.
(setq lyskom-buffer-list
(nconc lyskom-buffer-list (list buf))))))
(buffer-list))
(mapcar (function
(lambda (buf)
(if buf
(setq lyskom-buffer-list
(delete buf lyskom-buffer-list)))))
(mapcar (function
(lambda (buf)
(if (lyskom-buffer-p buf) nil buf)))
lyskom-buffer-list)))
(defun kom-next-kom ()
"Pop up the next lyskom-session."
(interactive)
(and (boundp 'lyskom-proc)
lyskom-proc
(processp lyskom-proc)
(lyskom-tell-internat 'kom-tell-next-lyskom))
(let ((buffers (buffer-list)))
(while (and buffers
(or (eq (car buffers) (current-buffer))
(not (save-excursion
(set-buffer (car buffers))
(and (boundp 'lyskom-proc)
lyskom-proc
(processp lyskom-proc)
(memq (process-status lyskom-proc) '(run open))
(eq (current-buffer)
(process-buffer lyskom-proc)))))))
(setq buffers (cdr buffers)))
(if buffers
(progn
(kom-bury)
(switch-to-buffer (car buffers))))))
(lyskom-tell-internat 'kom-tell-next-lyskom)
(lyskom-update-lyskom-buffer-list)
;; Now we are ready to select the next LysKOM buffer
(if lyskom-buffer-list
(progn
;;(kom-bury)
(setq lyskom-buffer-list (nconc (cdr lyskom-buffer-list)
(list (car lyskom-buffer-list))))
(switch-to-buffer (car lyskom-buffer-list)))
(error "No active LysKOM buffers")))
(defun kom-previous-kom ()
"Pop up the previous lyskom-session."
(interactive)
(lyskom-tell-internat 'kom-tell-next-lyskom)
(lyskom-update-lyskom-buffer-list)
;; Now we are ready to select the previous LysKOM buffer
(if lyskom-buffer-list
(let (lastbuf
(last-but-one lyskom-buffer-list))
;;(kom-bury)
(while (cdr (cdr last-but-one))
(setq last-but-one (cdr last-but-one)))
(if (setq lastbuf (car (cdr last-but-one)))
(progn
(setq lyskom-buffer-list (cons lastbuf lyskom-buffer-list))
(rplacd last-but-one nil)
(switch-to-buffer lastbuf))))
(error "No active LysKOM buffers")))
(defun kom-next-unread-kom ()
"Pop up the next LysKOM session with unread texts in."
(interactive)
(let ((thisbuf (current-buffer)))
(kom-next-kom)
(while (and (not (eq thisbuf (current-buffer)))
(not (memq lyskom-proc lyskom-sessions-with-unread)))
(kom-next-kom))))
;;;============================================================
;;; Visa user-arean (kom-show-user-area)
......
......@@ -1120,6 +1120,9 @@ Cf. paragraph-start.")
(define-key lyskom-mode-map "na" 'kom-view-next-new-text)
(define-key lyskom-mode-map "nc" 'kom-go-to-next-conf)
(define-key lyskom-mode-map "nl" 'kom-next-kom)
(define-key lyskom-mode-map "nu" 'kom-next-unread-kom)
;; What key should this be on?
;;(define-key lyskom-mode-map "fl" 'kom-previous-kom)
(define-key lyskom-mode-map "q" 'kom-quit)
(define-key lyskom-mode-map "z" 'kom-bury)
(define-key lyskom-mode-map "R" 'kom-recover)
......
No preview for this file type
......@@ -161,6 +161,7 @@ Value returned is always nil."
(setq call-list (cdr call-list)))
(lyskom-use 'blocking 'lyskom-blocking-do-multiple-1)
(while (and (eq lyskom-multiple-blocking-return 'not-yet-gotten)
(memq (process-status lyskom-proc) '(open run))
(not lyskom-quit-flag))
(accept-process-output nil lyskom-apo-timeout-s lyskom-apo-timeout-ms))
(if lyskom-quit-flag
......
......@@ -734,6 +734,7 @@ or get-text-stat."
'blocking 'blocking-return
data)
(while (and (eq lyskom-blocking-return 'not-yet-gotten)
(memq (process-status lyskom-proc) '(open run))
(not lyskom-quit-flag))
;; (if (input-pending-p)
;; (execute-kbd-macro (read-key-sequence ""))
......
......@@ -1177,6 +1177,8 @@ Cf. paragraph-start.")
(define-key lyskom-mode-map "ni" 'kom-view-next-new-text)
(define-key lyskom-mode-map "nm" 'kom-go-to-next-conf)
(define-key lyskom-mode-map "nl" 'kom-next-kom)
(define-key lyskom-mode-map "no" 'kom-next-unread-kom)
(define-key lyskom-mode-map "fl" 'kom-previous-kom)
(define-key lyskom-mode-map "S" 'kom-quit)
(define-key lyskom-mode-map "q" 'kom-quit)
(define-key lyskom-mode-map "z" 'kom-bury)
......
......@@ -719,6 +719,9 @@ This variable is not saved in the LysKOM server.")
(defvar lyskom-server-name ""
"The name of the server")
(defvar lyskom-buffer-list nil
"List of all LysKOM buffers.")
(defvar lyskom-who-info-cache nil
"Cache of who info.")
......
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