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>
* komtypes.el (text-list->empty): Ny funktion.
......@@ -15,8 +47,29 @@ Thu Feb 13 12:28:55 1997 David K
text-list->append.
(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>
* 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
variabler.
......
......@@ -334,7 +334,7 @@ element will be the new first element."
(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."
(let ((elementcell (cons element nil)))
(if (null (car (cdr queue)))
......@@ -348,37 +348,37 @@ element will be the new first element."
elementcell))))
(defun lyskom-queue-p (queue)
(defsubst lyskom-queue-p (queue)
"Return t if QUEUE is a queue, otherwise return nil."
(eq (car-safe queue) 'QUEUE))
(defun lyskom-queue-isempty (queue)
(defsubst lyskom-queue-isempty (queue)
"Return t if QUEUE is empty, otherwise return nil."
(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."
(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)."
(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."
(car-safe (cdr (cdr queue))))
(defun lyskom-queue-make-empty (queue)
(defsubst lyskom-queue-make-empty (queue)
"Make the queue QUEUE empty."
(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
return nil and do nothing."
(if (lyskom-queue-isempty queue)
......@@ -446,7 +446,7 @@ The element last pushed is first in the list."
(cdr stack))
(defun lyskom-stack-isempty (stack)
(defsubst lyskom-stack-isempty (stack)
"Returns non-nil if the STACK is empty."
(not (cdr stack)))
......
......@@ -512,20 +512,20 @@ function work as a name-to-conf-stat translator."
(null x-list)))))
;(defun lyskom-complete-show-data-list (state data)
; (save-excursion
; (pop-to-buffer (get-buffer-create "*kom*-complete"))
; (erase-buffer)
; (while data
; (insert
; (format "%s\n" (substring (aref (car data) 2)
; (aref (car data) 0)
; (aref (car data) 1))))
; (setq data (cdr data)))
; (insert (format "%S %S: %S" (symbol-value current-state)
; (elt state 0)
; (elt state 1)))
; (sit-for 1)))
(defun lyskom-complete-show-data-list (state data)
(save-excursion
(pop-to-buffer (get-buffer-create "*kom*-complete"))
(erase-buffer)
(while data
(insert
(format "%s\n" (substring (aref (car data) 2)
(aref (car data) 0)
(aref (car data) 1))))
(setq data (cdr data)))
(insert (format "%S %S: %S" (symbol-value current-state)
(elt state 0)
(elt state 1)))
(sit-for 1)))
(defun lyskom-complete-string (string-list)
......@@ -771,25 +771,19 @@ the LysKOM rules of string matching."
(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)
(setq tmp (string-match "[^(]*)"
(aref el 2)
(aref el 0)))
(if tmp
(progn
(aset el 0 (match-end 0))
(setq depth (1- depth)))
(progn
(setq tmp (string-match "[^)]*("
(aref el 2)
(aref el 0)))
(if tmp
(progn
(aset el 0 (match-end 0))
(setq depth (1+ depth)))
(aset el 0 (aref el 1))
(setq depth 0)))))))
(cond ((>= pos (length string))
(setq depth 0))
((= (aref string pos) ?\))
(setq depth (1- depth)))
((= (aref string pos) ?\()
(setq depth (1+ depth))))
(setq pos (1+ pos)))
(aset el 0 pos)))
;;;
;;; Check what's happenin' next
......
......@@ -507,7 +507,7 @@ text is a member of some recipient of this text."
(lyskom-wait-queue 'sending)
(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))
(lyskom-j-or-n-p
(let ((kom-deferred-printing nil))
......
......@@ -654,8 +654,14 @@ The position lyskom-last-viewed will always remain visible."
(set-window-start win lyskom-last-viewed)
(move-to-window-line -1)
(vertical-motion 1)
(if (not (pos-visible-in-window-p))
(forward-char -1))))))))
(when (not (pos-visible-in-window-p))
(forward-char -1)
(when (> (current-column)
(window-width))
(backward-char (+ (- (current-column)
(window-width))
2)))
)))))))
(defun lyskom-insert (string)
......
......@@ -68,11 +68,10 @@
increase lyskom-parse-pos. Signal lyskom-parse-incomplete if
the buffer lyskom-unparsed-buffer is exhausted."
(let ((char (lyskom-parse-char)))
(cond
((or (= char ? )
(= char ?\n))
(lyskom-parse-nonwhite-char))
(t char))))
(while (or (= char ?\ )
(= char ?\n))
(setq char (lyskom-parse-char)))
char))
(defun lyskom-parse-char ()
......@@ -80,11 +79,10 @@ the buffer lyskom-unparsed-buffer is exhausted."
lyskom-parse-pos. Signal lyskom-parse-incomplete if the buffer
lyskom-unparsed-buffer is exhausted."
(cond
((>= lyskom-parse-pos (point-max))
(signal 'lyskom-parse-incomplete nil))
(t (prog1
(char-after lyskom-parse-pos)
(++ lyskom-parse-pos)))))
((< lyskom-parse-pos (point-max))
(prog1 (char-after lyskom-parse-pos)
(++ lyskom-parse-pos)))
(t (signal 'lyskom-parse-incomplete nil))))
(defun lyskom-expect-char (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-protocol-error if the next token is not a number."
(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
((and (= max (point))
(prog2
(backward-char 1)
(not (looking-at "[ \t\n\r]"))
(forward-char 1)))
(cond
((looking-at "[ \n]*[0-9]+")
(setq lyskom-parse-pos (goto-char (match-end 0)))
(string-to-int (match-string 0)))
((looking-at "[ \n]*\\'")
(goto-char (point-max))
(signal 'lyskom-parse-incomplete nil))
((numberp result)
(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))))))
result))
(t (signal 'lyskom-protocol-error
(list "Expected number, got " (lyskom-string-to-parse))))))
(defun lyskom-parse-string ()
......@@ -295,7 +274,7 @@ result is assigned to the element."
(let ((index 0)
(len (length vector)))
(while (< index len)
(aset vector index (apply parser nil))
(aset vector index (funcall parser))
(setq index (1+ index))))
vector)
......@@ -920,11 +899,11 @@ functions and variables that are connected with the lyskom-buffer."
(delete-region (point-min) lyskom-parse-pos))
;; One reply is now parsed.
(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)))
(goto-char (point-min))
(while (looking-at "[ \t\n\r]")
(delete-char 1))
(if (looking-at "[ \n]+")
(delete-region (match-beginning 0) (match-end 0)))
)))
(store-match-data match-data)))
......@@ -868,7 +868,7 @@ Args: KOM-QUEUE HANDLER SESSION-NO &rest DATA"
(defun blocking-do (command &rest data)
"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.
The cache is consulted when command is get-conf-stat, get-pers-stat
or get-text-stat."
......@@ -891,9 +891,10 @@ or get-text-stat."
(memq (process-status lyskom-proc) '(open run))
;; The following test should probably be removed
(not lyskom-quit-flag))
;; (if (input-pending-p)
;; (execute-kbd-macro (read-key-sequence "")))
(lyskom-accept-process-output))
(if (or lyskom-quit-flag quit-flag)
(signal 'quit nil))
(setq lyskom-quit-flag nil)
lyskom-blocking-return)))
......
......@@ -389,11 +389,9 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO."
(setq lyskom-current-subject (substring str 0 (match-beginning 0)))
(setq body (substring str (match-end 0)))
(lyskom-insert-string 'head-Subject)
;; (setq s1 (point-max))
(let ((lyskom-current-function-phase 'subject))
(lyskom-format-insert "%#1r\n"
(copy-sequence lyskom-current-subject)))
;; (setq s2 (point-max))
(if kom-dashed-lines
(lyskom-insert
"------------------------------------------------------------\n")
......@@ -404,11 +402,11 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO."
;; (setq t2 (point-max))
)
(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)
;; (setq s2 (point-max))
;; (setq t1 (point-max)
;; t2 (point-max))
(setq lyskom-current-subject "")))
(if (lyskom-text-p (cache-get-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