Commit 3a58dee9 authored by Linus Tolke Y's avatar Linus Tolke Y

the textpointers datatype removed

parent 9f6439ef
Mon May 11 03:50:07 1992 Linus Tolke Y (linus@robin)
* clienttypes.el, cache.el, view-text.el (textpointers): removed
the special pointer-representation of the texts. They are now
deleted from the cache when read.
Mon May 4 02:38:59 1992 Linus Tolke Y (linus@robert)
* Distribuerat version 0.34.5 03:06
* cache.el (lyskom-set-who-info-buffer-2): Use a new insert
function that converts the data in the who-info buffer according
to the value of kom-emacs-knows-iso-8859-1.
......
......@@ -104,19 +104,10 @@
(defun cache-get-text (text-no)
"Get text for textno TEXT-NO, or nil if nothing is cached.
This is a special case:
The entry could be a text or a textpointers"
"Get text for textno TEXT-NO, or nil if nothing is cached."
(let ((tx (cache-assoc text-no lyskom-text-mass-cache)))
(cond
((lyskom-text-p tx) tx)
((lyskom-textpointers-p tx)
(lyskom-create-text
(textpointers->text-no tx)
(concat (buffer-substring (textpointers->start-subject tx)
(textpointers->end-subject tx))
(buffer-substring (textpointers->start-text tx)
(textpointers->end-text tx))))))))
((lyskom-text-p tx) tx))))
(defun cache-add-text (text)
......
......@@ -318,77 +318,6 @@ element will be the new first element."
read-list)
;;; ================================================================
;;; textpointers
;;; Constructor:
(defun lyskom-create-textpointers (text-no
start-subject
end-subject
start-text
end-text)
"Create a textpointers from all parameters."
(cons
'TEXTPOINTERS
(vector text-no start-subject end-subject start-text end-text
)))
;;; Selectors:
(defun textpointers->text-no (textpointers)
"Get text-no from textpointers."
(elt (cdr textpointers) 0))
(defun textpointers->start-subject (textpointers)
"Get start-subject from textpointers."
(elt (cdr textpointers) 1))
(defun textpointers->end-subject (textpointers)
"Get end-subject from textpointers."
(elt (cdr textpointers) 2))
(defun textpointers->start-text (textpointers)
"Get start-text from textpointers."
(elt (cdr textpointers) 3))
(defun textpointers->end-text (textpointers)
"Get end-text from textpointers."
(elt (cdr textpointers) 4))
;;; Modifiers:
(defun set-textpointers->text-no (textpointers newval)
"Set text-no in textpointers to NEWVAL."
(aset (cdr textpointers) 0 newval))
(defun set-textpointers->start-subject (textpointers newval)
"Set start-subject in textpointers to NEWVAL."
(aset (cdr textpointers) 1 newval))
(defun set-textpointers->end-subject (textpointers newval)
"Set end-subject in textpointers to NEWVAL."
(aset (cdr textpointers) 2 newval))
(defun set-textpointers->start-text (textpointers newval)
"Set start-text in textpointers to NEWVAL."
(aset (cdr textpointers) 3 newval))
(defun set-textpointers->end-text (textpointers newval)
"Set end-text in textpointers to NEWVAL."
(aset (cdr textpointers) 4 newval))
;;; Predicate:
(defun lyskom-textpointers-p (object)
"Return t if OBJECT is a textpointers."
(eq (car-safe object) 'TEXTPOINTERS))
;;; ================================================================
;;; A simple queue
......
......@@ -288,8 +288,6 @@ recipients to it that the user is a member in."
"Print a text. The header must already be printed.
Print an error message if TEXT-STAT or TEXT is nil.
Mark the text as read if (and only if) MARK-AS-READ is non-nil.
If the text is represented by a text type in the cache then this is substituted
by a textpointers type.
Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO."
(cond
((or (null text)
......@@ -322,9 +320,7 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO."
t2 (point-max))
(setq lyskom-current-subject "")))
(if (lyskom-text-p (cache-get-text (text->text-no text)))
(cache-add-text
(lyskom-create-textpointers (text->text-no text)
s1 s2 t1 t2)))
(cache-del-text (text->text-no text)))
(sit-for 0)
(lyskom-insert (format
(if kom-dashed-lines
......
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