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

Diverse fixar.

parent a97fbdfc
No preview for this file type
......@@ -272,14 +272,14 @@ Args: SENDER: conf-stat for the person issuing the broadcast message or a
of the recipient.
MESSAGE: A string containing the message."
(lyskom-insert-personal-message sender recipient message)
(setq lyskom-last-personal-message-sender
(if (stringp sender) sender (conf-stat->name sender)))
(setq lyskom-last-group-message-recipient
(if (and recipient
(not (eq (conf-stat->conf-no recipient)
lyskom-pers-no)))
(conf-stat->name recipient)
nil))
(setq lyskom-last-personal-message-sender
(if (stringp sender) sender (conf-stat->name sender)))
(setq lyskom-last-group-message-recipient
(if (and recipient
(/= recipient
lyskom-pers-no))
(conf-stat->name recipient)
nil))
(run-hooks 'lyskom-personal-message-hook))
......
......@@ -1591,7 +1591,7 @@ If optional arg TEXT-NO is present then jump all comments to that text instead."
(lyskom-end-of-command)))
(defun lyskom-jump (text-stat mark-as-read)
(defun lyskom-jump (text-stat mark-as-read &optional sync)
"Jump past TEXT-STAT and all comments to it.
Remove TEXT-STAT from all internal tables in the client.
If MARK-AS-READ is non-nil, also mark TEXT-STAT and all comments (and
......@@ -1614,13 +1614,17 @@ footnotes) to it as read in the server."
(misc-info->comm-in misc)
(misc-info->footn-in misc))
(text-stat->text-no text-stat)))
(initiate-get-text-stat 'main
'lyskom-jump
(if (eq (misc-info->type misc)
'COMM-IN)
(misc-info->comm-in misc)
(misc-info->footn-in misc))
mark-as-read)))))))
(let ((comment (if (eq (misc-info->type misc)
'COMM-IN)
(misc-info->comm-in misc)
(misc-info->footn-in misc))))
(if sync
(lyskom-jump (blocking-do 'get-text-stat comment)
mark-as-read sync)
(initiate-get-text-stat 'main
'lyskom-jump
comment
mark-as-read)))))))))
;;; ================================================================
......
......@@ -548,26 +548,19 @@ means send the message to everybody."
;;; Rehacked: Inge Wallin
(defun kom-list-news (&optional num)
"Runs lyskom-start-of-command and then gets all conferences using
lyskom-prefetch-all-confs."
(interactive "P")
(lyskom-start-of-command 'kom-list-news)
(lyskom-prefetch-all-confs)
(lyskom-list-news (cond
((numberp num) num)
((and (listp num)
(numberp (car num))) (car num))
(t nil))))
(defvar lyskom-special-conf-name "\\`Inl.gg .t mig\\'"
"Regexp to match conf names that are special.")
(defun lyskom-list-news (num-arg)
(def-kom-command kom-list-news (&optional num)
"Print the number of unread articles to the user."
(interactive)
(let ((sum 0))
(interactive "P")
(lyskom-prefetch-all-confs)
(let ((num-arg (cond
((numberp num) num)
((and (listp num)
(numberp (car num))) (car num))
(t nil)))
(sum 0))
(mapcar
(function
(lambda (info)
......@@ -595,10 +588,8 @@ lyskom-prefetch-all-confs."
(lyskom-insert
(if (/= sum 1)
(lyskom-format 'total-unreads
sum
)
(format (lyskom-get-string 'total-unread))))))
(lyskom-end-of-command))
sum)
(format (lyskom-get-string 'total-unread)))))))
;;; ================================================================
......
......@@ -160,7 +160,7 @@ Email-address:\n\nOther:\t")
; No entries.
; From services.el:
(interrupted . "Interrupted")
(interrupted . "Interrupted\n")
; From cache.el:
; No entries.
......
No preview for this file type
......@@ -56,6 +56,10 @@ Value returned is always nil."
(list '(setq __i__ (1+ __i__)))))))
(put 'lyskom-traverse 'edebug-form-spec
'(sexp form body))
;;;; lyskom-save-excursion Does not save point and mark.
(defmacro lyskom-save-excursion (&rest forms)
......@@ -177,6 +181,8 @@ All the forms in BIND-LIST are evaluated before and symbols are bound."
bind-list)))
(,@ body))))))
(put 'blocking-do-multiple 'edebug-form-spec
'(sexp body))
;;; Local Variables:
;;; eval: (put 'lyskom-traverse 'lisp-indent-hook 2)
......
......@@ -712,16 +712,18 @@ i.e creates the buffer, sets all markers and pointers."
(defun lyskom-parse-success (ref-no buffer)
"Parse the results of a successful call and call the handler."
(lyskom-save-excursion
(set-buffer buffer)
(let* ((kom-queue (cdr (assoc ref-no lyskom-pending-calls)))
(call-info (lyskom-locate-ref-no kom-queue ref-no)))
(set-buffer lyskom-unparsed-buffer)
(apply-parser call-info)
(set-buffer buffer)
(lyskom-decrease-pending-calls)
(setq lyskom-pending-calls
(lyskom-assoc-dremove ref-no lyskom-pending-calls))
(lyskom-check-call kom-queue))))
(set-buffer buffer)
(let* ((kom-queue (cdr (assoc ref-no lyskom-pending-calls)))
(call-info (lyskom-locate-ref-no kom-queue ref-no)))
(if (null call-info)
nil ; This call has probably been cancelled
(set-buffer lyskom-unparsed-buffer)
(apply-parser call-info)
(set-buffer buffer)
(lyskom-decrease-pending-calls)
(setq lyskom-pending-calls
(lyskom-assoc-dremove ref-no lyskom-pending-calls))
(lyskom-check-call kom-queue)))))
(defun lyskom-locate-ref-no (kom-queue ref-no)
......
......@@ -681,6 +681,8 @@ COMMAND is one lyskom-command (like the initiate-* but the initiate- is
stripped.
The cache is consulted when command is get-conf-stat, get-pers-stat
or get-text-stat."
;; Here we could check if lyskom-blocking-return is non-nil, in
;; which case there is a bug in the code
(save-excursion
(set-buffer (process-buffer (or lyskom-proc
lyskom-blocking-process)))
......@@ -692,8 +694,27 @@ or get-text-stat."
(while (and (eq lyskom-blocking-return 'not-yet-gotten)
(not lyskom-quit-flag))
(accept-process-output))
(if lyskom-quit-flag (error (lyskom-get-string 'interrupted)))
(if lyskom-quit-flag
(progn
(lyskom-insert-before-prompt (lyskom-get-string 'interrupted))
(signal 'quit nil)))
(setq lyskom-quit-flag nil)
lyskom-blocking-return)))
(defun lyskom-wait-queue (queue)
"Waits until all data on QUEUE has been processed"
(save-excursion
(set-buffer (process-buffer (or lyskom-proc
lyskom-blocking-process)))
(let ((lyskom-blocking-return 'not-yet-gotten))
(lyskom-run queue 'blocking-return (list t))
(while (and (eq lyskom-blocking-return 'not-yet-gotten)
(not lyskom-quit-flag))
(accept-process-output))
(if lyskom-quit-flag
(progn
(lyskom-insert-before-prompt (lyskom-get-string 'interrupted))
(signal 'quit nil)))
(setq lyskom-quit-flag nil)
lyskom-blocking-return)))
......@@ -126,9 +126,9 @@ See lyskom-mode for details."
;;; B|rja
(kom-start-anew t)
(setq init-done t))
;; Something went wrong. Lets cleanup everything. :->
(if init-done
nil
;; Something went wrong. Lets cleanup everything. :->
(if proc (delete-process proc))
(kill-buffer buffer))))))
......
......@@ -166,7 +166,7 @@ Email-adress:\n\nAnnat:\t")
; No entries.
; From services.el:
(interrupted . "Kommandot avbrutet")
(interrupted . "Kommandot avbrutet\n")
; From cache.el:
; No entries.
......
......@@ -58,7 +58,12 @@ lyskom-reading-list to read the comments to this."
'next-text)
((eq filter 'skip-tree)
(lyskom-filter-prompt text-no 'filter-tree)
(initiate-get-text-stat 'main 'lyskom-jump text-no t)
;;(initiate-get-text-stat 'main 'lyskom-jump text-no t)
;; Let's try something else:
(lyskom-jump (blocking-do 'get-text-stat text-no) t)
(lyskom-wait-queue 'main)
(setq todo 'next-text)
'next-text)
(t
......
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