Commit 746032c7 authored by David Byers's avatar David Byers
Browse files

Bugfixes

parent f05775c5
Tue Feb 18 13:30:34 1997 David Byers <davby@sen22.ida.liu.se>
* completing-read.el (lyskom-complete-string-close-parens-2):
Skrev om.
Mon Feb 17 09:18:07 1997 David Byers <davby@sen22.ida.liu.se>
* lyskom-rest.el (lyskom-scroll): Stt inte point bortom fnstrets
sisa kolumn. Det r inte s himla skoj om man har automatisk
horisontell scrollning.
Fri Feb 14 18:35:39 1997 David Byers <davby@sen22.ida.liu.se>
* edit-text.el (lyskom-edit-send-check-recipients): Fixade bug re
multipla mottagare och kommenterad-frfattare-kontroll.
Thu Feb 13 14:25:51 1997 David Byers <davby@sen22.ida.liu.se>
* clienttypes.el (lyskom-queue-isempty): Gjorde till defsubst
eftersom den ibland anropas *mycket*.
(lyskom-queue->first): Dito.
(lyskom-queue-p): Dito.
(lyskom-stack-isempty): Dito.
(lyskom-queue->all-entries): Dito.
(lyskom-queue-enter): Dito.
(lyskom-queue->last): Dito.
(lyskom-queue-make-empty): Dito.
(lyskom-queue-delete-first): Dito.
* parse.el (lyskom-parse-unparsed): Tog bort while-loopen fr att
radera whitespace. Anvnd match-data itsllet.
Thu Feb 13 12:28:55 1997 David Kgedal <davidk@lysator.liu.se> Thu Feb 13 12:28:55 1997 David Kgedal <davidk@lysator.liu.se>
* komtypes.el (text-list->empty): Ny funktion. * komtypes.el (text-list->empty): Ny funktion.
...@@ -15,8 +47,29 @@ Thu Feb 13 12:28:55 1997 David K ...@@ -15,8 +47,29 @@ Thu Feb 13 12:28:55 1997 David K
text-list->append. text-list->append.
(read-list-delete-text): Anvnd text-list->delq. (read-list-delete-text): Anvnd text-list->delq.
Thu Feb 13 09:41:52 1997 David Byers <davby@sen22.ida.liu.se>
* view-text.el (lyskom-print-text): Tog bort utkommenterad kod.
Lade till dashed lines fre rendelsa inlgg.
* parse.el (lyskom-parse-num): Skrivit om helt, utan read,
condition-case och specialhack fr strngar som nd inte anvnds.
* services.el (blocking-do): Signalera quit om lyskom-quit-flag r
t fr att undvika att returnera not-yet-gotten.
* parse.el (lyskom-parse-unparsed): Defensivt hack om
lyskom-parse-pos blir fr stor.
Wed Feb 12 14:43:31 1997 David Byers <davby@sen22.ida.liu.se> Wed Feb 12 14:43:31 1997 David Byers <davby@sen22.ida.liu.se>
* parse.el (lyskom-fill-vector): Anvnd funcall istf apply.
(lyskom-parse-char): Flytta grenar i cond
(lyskom-parse-num): Flyttade grenar i cond
(lyskom-parse-nonwhite-char): Gjorde iterativ
(lyskom-parse-num): Tog bort while-loopar med looking-at.
(lyskom-parse-num): Strunta i \t och \r i regexparna
* defvar.el (lyskom-save-variables): Fixade buggen med lokala * defvar.el (lyskom-save-variables): Fixade buggen med lokala
variabler. variabler.
......
...@@ -334,7 +334,7 @@ element will be the new first element." ...@@ -334,7 +334,7 @@ element will be the new first element."
(cons 'QUEUE (cons nil nil))) (cons 'QUEUE (cons nil nil)))
(defun lyskom-queue-enter (queue element) (defsubst lyskom-queue-enter (queue element)
"Enter last into the queue QUEUE the ELEMENT." "Enter last into the queue QUEUE the ELEMENT."
(let ((elementcell (cons element nil))) (let ((elementcell (cons element nil)))
(if (null (car (cdr queue))) (if (null (car (cdr queue)))
...@@ -348,37 +348,37 @@ element will be the new first element." ...@@ -348,37 +348,37 @@ element will be the new first element."
elementcell)))) elementcell))))
(defun lyskom-queue-p (queue) (defsubst lyskom-queue-p (queue)
"Return t if QUEUE is a queue, otherwise return nil." "Return t if QUEUE is a queue, otherwise return nil."
(eq (car-safe queue) 'QUEUE)) (eq (car-safe queue) 'QUEUE))
(defun lyskom-queue-isempty (queue) (defsubst lyskom-queue-isempty (queue)
"Return t if QUEUE is empty, otherwise return nil." "Return t if QUEUE is empty, otherwise return nil."
(null (car (cdr queue)))) (null (car (cdr queue))))
(defun lyskom-queue->first (queue) (defsubst lyskom-queue->first (queue)
"Return the first element of QUEUE or nil if it is empty." "Return the first element of QUEUE or nil if it is empty."
(car-safe (car (cdr queue)))) (car-safe (car (cdr queue))))
(defun lyskom-queue->all-entries (queue) (defsubst lyskom-queue->all-entries (queue)
"Return all elements of QUEUE (nil if it is empty)." "Return all elements of QUEUE (nil if it is empty)."
(car-safe (cdr queue))) (car-safe (cdr queue)))
(defun lyskom-queue->last (queue) (defsubst lyskom-queue->last (queue)
"Return the lastelement of QUEUE or nil if it is empty." "Return the lastelement of QUEUE or nil if it is empty."
(car-safe (cdr (cdr queue)))) (car-safe (cdr (cdr queue))))
(defun lyskom-queue-make-empty (queue) (defsubst lyskom-queue-make-empty (queue)
"Make the queue QUEUE empty." "Make the queue QUEUE empty."
(setcdr queue (cons nil nil))) (setcdr queue (cons nil nil)))
(defun lyskom-queue-delete-first (queue) (defsubst lyskom-queue-delete-first (queue)
"Delete the first element of QUEUE and return it. If QUEUE is empty "Delete the first element of QUEUE and return it. If QUEUE is empty
return nil and do nothing." return nil and do nothing."
(if (lyskom-queue-isempty queue) (if (lyskom-queue-isempty queue)
...@@ -446,7 +446,7 @@ The element last pushed is first in the list." ...@@ -446,7 +446,7 @@ The element last pushed is first in the list."
(cdr stack)) (cdr stack))
(defun lyskom-stack-isempty (stack) (defsubst lyskom-stack-isempty (stack)
"Returns non-nil if the STACK is empty." "Returns non-nil if the STACK is empty."
(not (cdr stack))) (not (cdr stack)))
......
...@@ -512,20 +512,20 @@ function work as a name-to-conf-stat translator." ...@@ -512,20 +512,20 @@ function work as a name-to-conf-stat translator."
(null x-list))))) (null x-list)))))
;(defun lyskom-complete-show-data-list (state data) (defun lyskom-complete-show-data-list (state data)
; (save-excursion (save-excursion
; (pop-to-buffer (get-buffer-create "*kom*-complete")) (pop-to-buffer (get-buffer-create "*kom*-complete"))
; (erase-buffer) (erase-buffer)
; (while data (while data
; (insert (insert
; (format "%s\n" (substring (aref (car data) 2) (format "%s\n" (substring (aref (car data) 2)
; (aref (car data) 0) (aref (car data) 0)
; (aref (car data) 1)))) (aref (car data) 1))))
; (setq data (cdr data))) (setq data (cdr data)))
; (insert (format "%S %S: %S" (symbol-value current-state) (insert (format "%S %S: %S" (symbol-value current-state)
; (elt state 0) (elt state 0)
; (elt state 1))) (elt state 1)))
; (sit-for 1))) (sit-for 1)))
(defun lyskom-complete-string (string-list) (defun lyskom-complete-string (string-list)
...@@ -771,25 +771,19 @@ the LysKOM rules of string matching." ...@@ -771,25 +771,19 @@ the LysKOM rules of string matching."
(lyskom-complete-string-close-parens-2 el depth))) (lyskom-complete-string-close-parens-2 el depth)))
(defun lyskom-complete-string-close-parens-2 (el depth) (defun lyskom-complete-string-close-parens-2 (el depth)
(let ((tmp nil)) (let ((tmp nil)
(string (aref el 2))
(pos (aref el 0)))
(while (> depth 0) (while (> depth 0)
(setq tmp (string-match "[^(]*)" (cond ((>= pos (length string))
(aref el 2) (setq depth 0))
(aref el 0))) ((= (aref string pos) ?\))
(if tmp
(progn
(aset el 0 (match-end 0))
(setq depth (1- depth))) (setq depth (1- depth)))
(progn ((= (aref string pos) ?\()
(setq tmp (string-match "[^)]*(" (setq depth (1+ depth))))
(aref el 2) (setq pos (1+ pos)))
(aref el 0))) (aset el 0 pos)))
(if tmp
(progn
(aset el 0 (match-end 0))
(setq depth (1+ depth)))
(aset el 0 (aref el 1))
(setq depth 0)))))))
;;; ;;;
;;; Check what's happenin' next ;;; Check what's happenin' next
......
...@@ -507,7 +507,7 @@ text is a member of some recipient of this text." ...@@ -507,7 +507,7 @@ text is a member of some recipient of this text."
(lyskom-wait-queue 'sending) (lyskom-wait-queue 'sending)
(setq author-is-member (collector->value collector)) (setq author-is-member (collector->value collector))
(if (and (null (apply 'append author-is-member)) (if (and (null (delq nil author-is-member))
(not (zerop author-number)) (not (zerop author-number))
(lyskom-j-or-n-p (lyskom-j-or-n-p
(let ((kom-deferred-printing nil)) (let ((kom-deferred-printing nil))
......
...@@ -654,8 +654,14 @@ The position lyskom-last-viewed will always remain visible." ...@@ -654,8 +654,14 @@ The position lyskom-last-viewed will always remain visible."
(set-window-start win lyskom-last-viewed) (set-window-start win lyskom-last-viewed)
(move-to-window-line -1) (move-to-window-line -1)
(vertical-motion 1) (vertical-motion 1)
(if (not (pos-visible-in-window-p)) (when (not (pos-visible-in-window-p))
(forward-char -1)))))))) (forward-char -1)
(when (> (current-column)
(window-width))
(backward-char (+ (- (current-column)
(window-width))
2)))
)))))))
(defun lyskom-insert (string) (defun lyskom-insert (string)
......
...@@ -68,11 +68,10 @@ ...@@ -68,11 +68,10 @@
increase lyskom-parse-pos. Signal lyskom-parse-incomplete if increase lyskom-parse-pos. Signal lyskom-parse-incomplete if
the buffer lyskom-unparsed-buffer is exhausted." the buffer lyskom-unparsed-buffer is exhausted."
(let ((char (lyskom-parse-char))) (let ((char (lyskom-parse-char)))
(cond (while (or (= char ?\ )
((or (= char ? )
(= char ?\n)) (= char ?\n))
(lyskom-parse-nonwhite-char)) (setq char (lyskom-parse-char)))
(t char)))) char))
(defun lyskom-parse-char () (defun lyskom-parse-char ()
...@@ -80,11 +79,10 @@ the buffer lyskom-unparsed-buffer is exhausted." ...@@ -80,11 +79,10 @@ the buffer lyskom-unparsed-buffer is exhausted."
lyskom-parse-pos. Signal lyskom-parse-incomplete if the buffer lyskom-parse-pos. Signal lyskom-parse-incomplete if the buffer
lyskom-unparsed-buffer is exhausted." lyskom-unparsed-buffer is exhausted."
(cond (cond
((>= lyskom-parse-pos (point-max)) ((< lyskom-parse-pos (point-max))
(signal 'lyskom-parse-incomplete nil)) (prog1 (char-after lyskom-parse-pos)
(t (prog1 (++ lyskom-parse-pos)))
(char-after lyskom-parse-pos) (t (signal 'lyskom-parse-incomplete nil))))
(++ lyskom-parse-pos)))))
(defun lyskom-expect-char (char) (defun lyskom-expect-char (char)
...@@ -114,35 +112,16 @@ first non-white character was not equal to CHAR." ...@@ -114,35 +112,16 @@ first non-white character was not equal to CHAR."
Signal lyskom-parse-incomplete if the number is not followed by whitespace. Signal lyskom-parse-incomplete if the number is not followed by whitespace.
Signal lyskom-protocol-error if the next token is not a number." Signal lyskom-protocol-error if the next token is not a number."
(goto-char lyskom-parse-pos) (goto-char lyskom-parse-pos)
(let* ((max (point-max))
(result (condition-case nil
;; Eval it to prevent malfunction when
;; edebug-all-defs or edebug-all-forms is non-nil.
(read (current-buffer))
(end-of-file (signal 'lyskom-parse-incomplete nil))))
(pos (point)))
(cond (cond
((and (= max (point)) ((looking-at "[ \n]*[0-9]+")
(prog2 (setq lyskom-parse-pos (goto-char (match-end 0)))
(backward-char 1) (string-to-int (match-string 0)))
(not (looking-at "[ \t\n\r]"))
(forward-char 1))) ((looking-at "[ \n]*\\'")
(goto-char (point-max))
(signal 'lyskom-parse-incomplete nil)) (signal 'lyskom-parse-incomplete nil))
((numberp result) (t (signal 'lyskom-protocol-error
(setq lyskom-parse-pos (point)))
(t
(goto-char lyskom-parse-pos)
(while (looking-at "[ \t\n\r]")
(forward-char 1))
(if (looking-at "[0-9]+H")
(progn
(setq result (string-to-int (buffer-substring (point) pos)))
(while (looking-at "[0-9]+H")
(forward-char 1))
(setq lyskom-parse-pos (point)))
(signal 'lyskom-protocol-error
(list "Expected number, got " (lyskom-string-to-parse)))))) (list "Expected number, got " (lyskom-string-to-parse))))))
result))
(defun lyskom-parse-string () (defun lyskom-parse-string ()
...@@ -295,7 +274,7 @@ result is assigned to the element." ...@@ -295,7 +274,7 @@ result is assigned to the element."
(let ((index 0) (let ((index 0)
(len (length vector))) (len (length vector)))
(while (< index len) (while (< index len)
(aset vector index (apply parser nil)) (aset vector index (funcall parser))
(setq index (1+ index)))) (setq index (1+ index))))
vector) vector)
...@@ -920,11 +899,11 @@ functions and variables that are connected with the lyskom-buffer." ...@@ -920,11 +899,11 @@ functions and variables that are connected with the lyskom-buffer."
(delete-region (point-min) lyskom-parse-pos)) (delete-region (point-min) lyskom-parse-pos))
;; One reply is now parsed. ;; One reply is now parsed.
(lyskom-protocol-error (lyskom-protocol-error
(delete-region (point-min) (1+ lyskom-parse-pos)) (delete-region (point-min) (min (point-max) (1+ lyskom-parse-pos)))
(signal 'lyskom-protocol-error err))) (signal 'lyskom-protocol-error err)))
(goto-char (point-min)) (goto-char (point-min))
(while (looking-at "[ \t\n\r]") (if (looking-at "[ \n]+")
(delete-char 1)) (delete-region (match-beginning 0) (match-end 0)))
))) )))
(store-match-data match-data))) (store-match-data match-data)))
...@@ -868,7 +868,7 @@ Args: KOM-QUEUE HANDLER SESSION-NO &rest DATA" ...@@ -868,7 +868,7 @@ Args: KOM-QUEUE HANDLER SESSION-NO &rest DATA"
(defun blocking-do (command &rest data) (defun blocking-do (command &rest data)
"Does the COMMAND agains the lyskom-server and returns the result. "Does the COMMAND agains the lyskom-server and returns the result.
COMMAND is one lyskom-command (like the initiate-* but the initiate- is COMMAND is one lyskom-command \(like the initiate-* but the initiate- is
stripped. stripped.
The cache is consulted when command is get-conf-stat, get-pers-stat The cache is consulted when command is get-conf-stat, get-pers-stat
or get-text-stat." or get-text-stat."
...@@ -891,9 +891,10 @@ or get-text-stat." ...@@ -891,9 +891,10 @@ or get-text-stat."
(memq (process-status lyskom-proc) '(open run)) (memq (process-status lyskom-proc) '(open run))
;; The following test should probably be removed ;; The following test should probably be removed
(not lyskom-quit-flag)) (not lyskom-quit-flag))
;; (if (input-pending-p)
;; (execute-kbd-macro (read-key-sequence "")))
(lyskom-accept-process-output)) (lyskom-accept-process-output))
(if (or lyskom-quit-flag quit-flag)
(signal 'quit nil))
(setq lyskom-quit-flag nil)
lyskom-blocking-return))) lyskom-blocking-return)))
......
...@@ -389,11 +389,9 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO." ...@@ -389,11 +389,9 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO."
(setq lyskom-current-subject (substring str 0 (match-beginning 0))) (setq lyskom-current-subject (substring str 0 (match-beginning 0)))
(setq body (substring str (match-end 0))) (setq body (substring str (match-end 0)))
(lyskom-insert-string 'head-Subject) (lyskom-insert-string 'head-Subject)
;; (setq s1 (point-max))
(let ((lyskom-current-function-phase 'subject)) (let ((lyskom-current-function-phase 'subject))
(lyskom-format-insert "%#1r\n" (lyskom-format-insert "%#1r\n"
(copy-sequence lyskom-current-subject))) (copy-sequence lyskom-current-subject)))
;; (setq s2 (point-max))
(if kom-dashed-lines (if kom-dashed-lines
(lyskom-insert (lyskom-insert
"------------------------------------------------------------\n") "------------------------------------------------------------\n")
...@@ -404,11 +402,11 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO." ...@@ -404,11 +402,11 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO."
;; (setq t2 (point-max)) ;; (setq t2 (point-max))
) )
(t ;No \n found. Don't print header. (t ;No \n found. Don't print header.
;; (setq s1 (point-max)) (if kom-dashed-lines
(lyskom-insert
"------------------------------------------------------------\n")
(lyskom-insert "\n"))
(lyskom-format-insert "%#1t" str) (lyskom-format-insert "%#1t" str)
;; (setq s2 (point-max))
;; (setq t1 (point-max)
;; t2 (point-max))
(setq lyskom-current-subject ""))) (setq lyskom-current-subject "")))
(if (lyskom-text-p (cache-get-text (text->text-no text))) (if (lyskom-text-p (cache-get-text (text->text-no text)))
(cache-del-text (text->text-no text))) (cache-del-text (text->text-no text)))
......
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