Commit fe48d131 authored by David Byers's avatar David Byers
Browse files

Major code cleanup.

I have made lots of changes, including transitioning most data
structures to use def-komtype, removing functions that weren't used
(there are several left), removing almost all the remaining who-buffer
remnants and generally messing with things.

Chances are I broke something. I haven't figured out what yet, but do
let me know if you spot anything.


Detailed changes:
> 	* I have cleaned up all over the place. There are no ChangeLog
> 	entries for most of the changes. Changes include: converting types
> 	to use def-komtype; removing who-buffer code; removing who-info
> 	cache; removing dead code; removing commented-out code.
>
> 	* mship-edit.el (lp--hide-memberships-by-date): Call
> 	lyskom-read-date.
>
> 	Code cleanup:
> 	* prefetch.el (lyskom-prefetch-whobuffer-handler): Commented out
> 	the code since thw who buffer is gone.
>
> 	* commands2.el (kom-bury): Removed who-buffer code.
>
> 	* cache.el: Removed who-info cache.
>
> 	* async.el (lyskom-parse-async): Removed who-buffer code.
> 	(lyskom-parse-async): Don't cache who info.
>
> 	* filter-edit.el (filter-entry): Redefined using def-komtype.
>
> 	* komtypes.el (conf-no-list): Redefined using def-komtype.
>
> 	* prioritize.el (prioritize-entry): Redefined using def-komtype.
>
> 	* clienttypes.el: Removed format-props and who-buffer-related
> 	types.
>
> 	* lyskom-rest.el (lyskom-format-aux-help): Removed something about
> 	format-props, which aren't used anywhere.
>
> 	* komtypes.el,deferred-insert.el,clienttypes.el,mship-edit.el,names.el,
> 	regexp.el,tree-edit.el: Rewrote all uses of def-komtype. Defined
> 	more datatypes using def-komtype. Removed unused functions.
>
> 	* clienttypes.el (format-state): Renamed argl to args, since
> 	that's what we actually use.
> 	(format-state): Converted to new def-komtype syntax.
>
> 	* lyskom-rest.el (lyskom-membership-highest-index): Unused.
> 	Removed.
>
> 	* komtypes.el (def-komtype): Added support for &optional in the
> 	arg list and for default values.
> 	(privs): Re-implemented with def-komtype.
> 	(pers-stat): Ditto.
> 	(text-stat): Ditto.
> 	(conf-stat): Ditto.
> 	(flags): Ditto.
> 	(map): Ditto.
> 	(membership): Ditto.
> 	(conf-list): Ditto.
> 	(text): Ditto.
> 	(misc-info): Ditto.
> 	(mark): Ditto.
> 	(lyskom-create-who-info): Ditto.
> 	(session-info): Ditto.
> 	(conf-type): Ditto.
> 	(server-info): Ditto.
> 	(version-info): Ditto.
> 	(conf-z-info-list): Ditto.
>
> 	* deferred-insert.el (defer-info): Re-implemented with
> 	def-komtype.
>
> 	* language.el (lyskom-string-check-category): Unused. Removed.
>
> 	* async.el (lyskom-show-changed-person): Unused. Removed.
>
> 	* utilities.el (lyskom-set-face-foreground): Unused. Removed.
> 	(lyskom-set-face-background): Unused. Removed.
>
> 	* lyskom-buttons.el (lyskom-set-default-button-action): Unused.
> 	Removed.
>
> 	* startup.el (lyskom-print-name): Unused. Removed.
>
> 	* lyskom-buttons.el (lyskom-menu-selection): Unused. Removed.
>
> 	* aux-items.el (lyskom-map-aux-items): Unused. Removed.
>
> 	* view-text.el (lyskom-fetch-author-for-cache): Unused. Removed.
>
> 	* utilities.el (lyskom-emacs-version): Unused. Removed.
>
> 	* view-text.el (lyskom-fetch-text-for-cache): Unused. Removed.
>
> 	* utilities.el (lyskom-face-resource): Unused. Removed.
> 	(lyskom-modify-face): Unused. Removed.
>
> 	* startup.el (lyskom-extract-persons): Unused. Removed.
> 	(lyskom-extract-confs): Unused. Removed.
> 	(lyskom-do-extract-persons-or-confs): Unused. Removed.
>
> 	* edit-text.el (lyskom-edit-goto-char): Unused. Removed.
> 	(lyskom-edit-on-aux-item): Unused. Removed.
>
> 	* utilities.el (lyskom-background-mode): Unused. Removed.
>
parent 6adc4b07
2003-01-05 David Byers <david.byers@swipnet.se>
* I have cleaned up all over the place. There are no ChangeLog
entries for most of the changes. Changes include: converting types
to use def-komtype; removing who-buffer code; removing who-info
cache; removing dead code; removing commented-out code.
* mship-edit.el (lp--hide-memberships-by-date): Call
lyskom-read-date.
Code cleanup:
* prefetch.el (lyskom-prefetch-whobuffer-handler): Commented out
the code since thw who buffer is gone.
* commands2.el (kom-bury): Removed who-buffer code.
* cache.el: Removed who-info cache.
* async.el (lyskom-parse-async): Removed who-buffer code.
(lyskom-parse-async): Don't cache who info.
* filter-edit.el (filter-entry): Redefined using def-komtype.
* komtypes.el (conf-no-list): Redefined using def-komtype.
* prioritize.el (prioritize-entry): Redefined using def-komtype.
* clienttypes.el: Removed format-props and who-buffer-related
types.
* lyskom-rest.el (lyskom-format-aux-help): Removed something about
format-props, which aren't used anywhere.
* komtypes.el,deferred-insert.el,clienttypes.el,mship-edit.el,names.el,
regexp.el,tree-edit.el: Rewrote all uses of def-komtype. Defined
more datatypes using def-komtype. Removed unused functions.
* clienttypes.el (format-state): Renamed argl to args, since
that's what we actually use.
(format-state): Converted to new def-komtype syntax.
* lyskom-rest.el (lyskom-membership-highest-index): Unused.
Removed.
* komtypes.el (def-komtype): Added support for &optional in the
arg list and for default values.
(privs): Re-implemented with def-komtype.
(pers-stat): Ditto.
(text-stat): Ditto.
(conf-stat): Ditto.
(flags): Ditto.
(map): Ditto.
(membership): Ditto.
(conf-list): Ditto.
(text): Ditto.
(misc-info): Ditto.
(mark): Ditto.
(lyskom-create-who-info): Ditto.
(session-info): Ditto.
(conf-type): Ditto.
(server-info): Ditto.
(version-info): Ditto.
(conf-z-info-list): Ditto.
* deferred-insert.el (defer-info): Re-implemented with
def-komtype.
* language.el (lyskom-string-check-category): Unused. Removed.
* async.el (lyskom-show-changed-person): Unused. Removed.
* utilities.el (lyskom-set-face-foreground): Unused. Removed.
(lyskom-set-face-background): Unused. Removed.
* lyskom-buttons.el (lyskom-set-default-button-action): Unused.
Removed.
* startup.el (lyskom-print-name): Unused. Removed.
* lyskom-buttons.el (lyskom-menu-selection): Unused. Removed.
* aux-items.el (lyskom-map-aux-items): Unused. Removed.
* view-text.el (lyskom-fetch-author-for-cache): Unused. Removed.
* utilities.el (lyskom-emacs-version): Unused. Removed.
* view-text.el (lyskom-fetch-text-for-cache): Unused. Removed.
* utilities.el (lyskom-face-resource): Unused. Removed.
(lyskom-modify-face): Unused. Removed.
* startup.el (lyskom-extract-persons): Unused. Removed.
(lyskom-extract-confs): Unused. Removed.
(lyskom-do-extract-persons-or-confs): Unused. Removed.
* edit-text.el (lyskom-edit-goto-char): Unused. Removed.
(lyskom-edit-on-aux-item): Unused. Removed.
* utilities.el (lyskom-background-mode): Unused. Removed.
Fix bug 677:
* filter.el (kom-super-jump): Fixed recipient selection. The order
is now current conf, recipient user is a member of, cc user is a
......
......@@ -97,7 +97,6 @@ this function shall be with current-buffer the BUFFER."
'you-changed-name-to
new-name
(lyskom-default-button 'conf conf-no)))
;; (cache-del-conf-stat conf-no) ;+++Borde {ndra i cachen i st{llet.
(let ((cached-stat (cache-get-conf-stat conf-no))
(cached-ustat (cache-get-uconf-stat conf-no)))
(when cached-stat
......@@ -120,16 +119,10 @@ this function shall be with current-buffer the BUFFER."
;; Update in the mship-edit buffer
(lp--maybe-update-entry-for-conf conf-no))))
((eq msg-no 6) ;i_am_on - something is moving
(let ((info (lyskom-parse-who-info)))
(lyskom-save-excursion
(set-buffer buffer)
(if (or (null lyskom-pers-no)
(zerop lyskom-pers-no))
nil
(cache-add-who-info info)))))
(lyskom-parse-who-info))
((eq msg-no 7) ; Database is syncing.
(lyskom-save-excursion
(set-buffer buffer)
......@@ -157,7 +150,9 @@ this function shall be with current-buffer the BUFFER."
((eq msg-no 9) ; A person has logged in
(let ((pers-no (lyskom-parse-num))
(session-no (lyskom-parse-num)))
;;;(session-no (lyskom-parse-num))
)
(lyskom-parse-num)
(lyskom-save-excursion
(set-buffer buffer)
(if (and lyskom-pers-no
......@@ -166,11 +161,6 @@ this function shall be with current-buffer the BUFFER."
(initiate-get-conf-stat 'follow
'lyskom-show-logged-in-person
pers-no))
(if (and lyskom-pers-no
(not (zerop lyskom-pers-no))
lyskom-who-info-buffer-is-on)
(initiate-get-session-info 'who-buffer 'cache-add-session-info
session-no))
)))
;; msg-no 10 is the old broadcast message. No longer used.
......@@ -179,13 +169,6 @@ this function shall be with current-buffer the BUFFER."
(lyskom-save-excursion
(set-buffer buffer)
(lyskom-insert-before-prompt (lyskom-get-string-sol 'lyskom-is-full))
;;; (if (and (eq major-mode 'lyskom-mode)
;;; (not (listp lyskom-time-last-command))
;;; kom-auto-quit-when-idle)
;;; (progn
;;; (lyskom-insert-before-prompt
;;; (lyskom-get-string-sol 'session-auto-ended))
;;; (kom-quit 1)
))
......@@ -218,9 +201,7 @@ this function shall be with current-buffer the BUFFER."
(lyskom-show-presence pers-no kom-presence-messages-in-buffer)))
(initiate-get-conf-stat 'follow
'lyskom-show-logged-out-person
pers-no session-no))
(if (and lyskom-pers-no (not (zerop lyskom-pers-no)))
(lyskom-run 'who-buffer 'cache-del-who-info session-no)))))
pers-no session-no)))))
((eq msg-no 14) ; Deleted text
(let* ((text-no (lyskom-parse-num))
......@@ -417,35 +398,6 @@ according to the value of FLAG."
(defun lyskom-show-changed-person (personconfstat conf-num doing)
"Tells the user what another person is doing."
(if personconfstat ;+++ Annan felhantering
(progn
(cond
((and (lyskom-show-presence (conf-stat->conf-no personconfstat)
kom-presence-messages-in-echo-area)
(or (= 0 conf-num)
(eq conf-num lyskom-current-conf))
(/= 0 (length doing)))
(lyskom-message "%s %s" (conf-stat->name personconfstat)
(let ((string
(concat (char-to-string (downcase
(string-to-char doing)))
(substring doing 1))))
string))))
(cond
((and (lyskom-show-presence (conf-stat->conf-no personconfstat)
kom-presence-messages-in-buffer)
(or (= 0 conf-num)
(eq conf-num lyskom-current-conf))
(/= 0 (length doing)))
(lyskom-format-insert-before-prompt
"%#1M %#2s\n"
personconfstat
(concat (char-to-string (downcase (string-to-char doing)))
(substring doing 1))))))))
(defun lyskom-is-in-minibuffer ()
"Returns non-nil if I am using the minibuffer for some reading."
(or lyskom-inhibit-minibuffer-messages
......
......@@ -36,12 +36,6 @@
(concat lyskom-clientversion-long
"$Id$\n"))
;;; (eval-when-compile
;;; (require 'lyskom-defvar "defvar.el")
;;; (require 'lyskom-vars "vars.el")
;;; (require 'lyskom-types "komtypes.el"))
(def-kom-var lyskom-aux-item-definitions nil
"List of aux item definitions.")
......@@ -58,16 +52,6 @@
(defun lyskom-aux-item-definition->number (def)
(car def))
(defun lyskom-map-aux-items (fn text-stat)
"Apply FN to every aux item in TEXT-STAT."
(let ((items (text-stat->aux-items text-stat)))
(while items
(when (and (car items)
(not (aux-item-flags->deleted (aux-item->flags items))))
(funcall fn (car items)))
(setq items (cdr items)))))
(defun lyskom-aux-item-try-call (item method default &rest args)
(when (lyskom-aux-item-p item)
......
......@@ -241,127 +241,6 @@ otherwise return nil"
(cache-del session 'lyskom-static-session-info-cache))
;;; ================================================================
;;; who-info cache
(defun cache-initiate-who-info-buffer (who-info-arr kombuf)
"Sets the cache of who-info items."
(setq lyskom-who-info-cache (list 'WHO-INFO-LIST))
(lyskom-save-excursion
(setq lyskom-who-info-buffer
(lyskom-get-buffer-create 'WHO-INFO (concat (buffer-name) "-who") t))
(set-buffer lyskom-who-info-buffer)
(make-local-variable 'kom-buffer)
(setq lyskom-buffer kombuf)
(local-set-key [mouse-2] 'kom-mouse-2)
(erase-buffer))
(mapcar 'cache-add-who-info
(sort (listify-vector who-info-arr)
(function (lambda (who1 who2)
(< (who-info->connection who1)
(who-info->connection who2)))))))
(defun cache-add-who-info (who-info)
"Adds another entry to the lyskom-who-info-cache. Updating the buffer."
(if lyskom-who-info-buffer-is-on
(progn
(lyskom-collect 'who-buffer)
(initiate-get-conf-stat
'who-buffer nil (who-info->pers-no who-info))
(initiate-get-conf-stat
'who-buffer nil (who-info->working-conf who-info))
(lyskom-use 'who-buffer 'lyskom-set-who-info-buffer-2
who-info))))
(defun cache-add-session-info (session-info)
"Adds another entry to the lyskom-who-info-cache. Updating the buffer.
ARG: session-info"
(if (null session-info)
nil ;+++ Annan felhantering
(lyskom-halt 'who-buffer)
(lyskom-collect 'who-buffer-2)
(initiate-get-conf-stat
'who-buffer-2 nil (session-info->pers-no session-info))
(initiate-get-conf-stat
'who-buffer-2 nil (session-info->working-conf session-info))
(lyskom-use 'who-buffer-2 'lyskom-set-session-info
session-info)
(lyskom-run 'who-buffer-2 'lyskom-resume 'who-buffer)))
(defun cache-del-who-info (session-no)
"Delete the session SESSION-NO from the lyskom-who-info-cache. Updating buffer."
(if lyskom-who-info-buffer-is-on
(let ((where (cache-assoc session-no lyskom-who-info-cache)))
(if where
(progn
(lyskom-save-excursion
(set-buffer lyskom-who-info-buffer)
(delete-region (marker-position
(who-buffer-info->start-marker where))
(marker-position
(who-buffer-info->end-marker where))))
(set-marker (who-buffer-info->start-marker where) nil)
(set-marker (who-buffer-info->end-marker where) nil)
(cache-del session-no 'lyskom-who-info-cache))))))
(defun lyskom-set-who-info-buffer-2 (pers-conf-stat conf-conf-stat who-info)
"Inserts a who-buffer-info into lyskom-who-info-cache"
;; ;We can use lyskom-insert (not beautiful)
;; ;we insert everything at the end of the buffer.
;; ;defensive programming and it will work:
;; (if (and lyskom-who-info-buffer-is-on
;; lyskom-who-info-buffer)
;; (let ((sesno lyskom-session-no)
;; min max
;; (where (cache-assoc (who-info->connection who-info)
;; lyskom-who-info-cache)))
;; (lyskom-save-excursion
;; (set-buffer lyskom-who-info-buffer)
;; (save-restriction
;; (if where
;; (progn
;; (narrow-to-region (marker-position
;; (who-buffer-info->start-marker where))
;; (1- (marker-position
;; (who-buffer-info->end-marker where))))
;; (delete-region (point-min) (point-max)))
;; (goto-char (point-max))
;; (insert " ")
;; (narrow-to-region (point-min) (1- (point-max))))
;; (setq min (point-max-marker))
;; (lyskom-print-who-info pers-conf-stat conf-conf-stat who-info sesno
;; (function
;; (lambda (string)
;; (insert string))))
;; (setq max (point-max-marker))
;; (goto-char (point-max)))
;; (delete-char 1))
;; (cache-add (who-info->connection who-info)
;; (lyskom-create-who-buffer-info who-info min max)
;; 'lyskom-who-info-cache)
;; (run-hooks 'lyskom-who-info-has-changed-hook)))
)
(defun lyskom-set-session-info (pers-conf-stat conf-conf-stat session-info)
"Inserts a session-info into lyskom-who-info-cache"
;;; (lyskom-set-who-info-buffer-2 pers-conf-stat conf-conf-stat
;;; (lyskom-create-who-info
;;; (session-info->pers-no session-info)
;;; (session-info->working-conf session-info)
;;; (session-info->connection session-info)
;;; (session-info->doing session-info)
;;; (session-info->username session-info)))
)
;;; ================================================================
;;; Generic cache routines
......@@ -409,71 +288,6 @@ CACHE is the name of the variable that points to the cache."
(set cache nil)
(setq lyskom-caches (delete cache lyskom-caches)))
;; (defsubst cache-hash (key cache)
;; "Return a hash value for use in the cache."
;; (mod key (length (aref cache 2))))
;;
;; (defun cache-create (cache &optional size)
;; (set cache (vector 'CACHE-HASH (or size 1000)
;; (make-vector (or size 1000) nil)))
;; (if (not (memq cache lyskom-caches))
;; (setq lyskom-caches (cons cache lyskom-caches)))
;; (symbol-value cache))
;;
;; (defun cache-rehash (cache-symbol)
;; (let* ((cache (symbol-value cache-symbol))
;; (newsize (/ (aref cache 1) 5))
;; (oldsize (length (aref cache 2)))
;; (i 0))
;; (cache-create cache-symbol newsize)
;; (while (< i oldsize)
;; (let ((entries (aref cache i)))
;; (while entries
;; (cache-add cache-symbol (car (car entries)) (cdr (car entries)))
;; (setq entries (cdr entries))))
;; (setq i (1+ i)))
;; (symbol-value cache-symbol)))
;;
;; (defun cache-assoc (key cache)
;; "Get data for item with key KEY from CACHE.
;; CACHE is an assoc-list in this implementation."
;; (if cache
;; (cdr-safe (assq key (aref (aref cache 2)
;; (cache-hash key cache))))))
;;
;;
;;
;; (defun cache-add (key data cache-symbol)
;; "Add DATA to CACHE under the key KEY.
;; Args: KEY DATA CACHE.
;; CACHE is a (the only one) quoted variable pointing to the cache (an alist).
;; The variable might be changed."
;; (let ((cache (symbol-value cache-symbol)))
;; (if (null cache)
;; (setq cache (cache-create cache-symbol))
;; (if (> (aset cache 1 (1+ (aref cache 1)))
;; (* (length (aref cache 2)) 20))
;; (setq cache (cache-rehash cache-symbol))))
;; (let ((hash (cache-hash key cache)))
;; (aset (aref cache 2) hash
;; (cons (cons key data) (aref (aref cache 2) hash))))))
;;
;; (defun cache-del (key cache-symbol)
;; "Delete item with key KEY from CACHE.
;; CACHE is the name of the variable that points to the cache."
;; (let ((cache (symbol-value cache-symbol)))
;; (if cache
;; (let* ((hash (cache-hash key cache))
;; (entries (aref (aref cache 2) hash))
;; (ass (assq key entries)))
;; (if ass
;; (progn (aset cache 1 (1- (aref cache 1)))
;; (aset (aref cache 2) hash
;; (delq ass entries))))))))
;;
;; (defun cache-clear (cache)
;; (set cache nil)
;; (setq lyskom-caches (delete cache lyskom-caches)))
(defun clear-all-caches ()
(mapcar (function (lambda (cache) (set cache nil)))
......
......@@ -72,88 +72,17 @@
;;; read-info
(defsubst lyskom-create-read-info (type
conf-stat
priority
text-list
&optional comm-to forward misc)
"Create a read-info from all parameters."
;; The last nil is for the unfetched-texts pair (first . last)
;; This field is only applicable in read-infos of type CONF where
;; it shows which part of the map for this conference that has not
;; yet been fetched.
(cons
'READ-INFO
(vector type conf-stat priority text-list comm-to forward nil misc)))
(defsubst read-info->type (read-info)
"Get type from read-info."
(elt (cdr read-info) 0))
(defsubst read-info->conf-stat (read-info)
"Get conf-stat from read-info."
(elt (cdr read-info) 1))
(defsubst read-info->priority (read-info)
"Get priority from read-info."
(elt (cdr read-info) 2))
(defsubst read-info->text-list (read-info)
"Get text-list from read-info."
(elt (cdr read-info) 3))
(defsubst read-info->comm-to (read-info)
"Get comm-to from read-info."
(elt (cdr read-info) 4))
(defsubst read-info->forward (read-info)
"Get forward from read-info."
(elt (cdr read-info) 5))
(defsubst read-info->unfetched-texts (read-info)
"Get forward from read-info."
(elt (cdr read-info) 6))
(defsubst read-info->misc (read-info)
"Get forward from read-info."
(elt (cdr read-info) 7))
(defsubst set-read-info->type (read-info newval)
"Set type in read-info to NEWVAL."
(aset (cdr read-info) 0 newval))
(defsubst set-read-info->conf-stat (read-info newval)
"Set conf-stat in read-info to NEWVAL."
(aset (cdr read-info) 1 newval))
(defsubst set-read-info->priority (read-info newval)
"Set priority in read-info to NEWVAL."
(aset (cdr read-info) 2 newval))
(defsubst set-read-info->text-list (read-info newval)
"Set text-list in read-info to NEWVAL."
(aset (cdr read-info) 3 newval))
(defsubst set-read-info->comm-to (read-info newval)
"Set comm-to in read-info to NEWVAL."
(aset (cdr read-info) 4 newval))
(defsubst set-read-info->forward (read-info newval)
"Set forward in read-info to NEWVAL."
(aset (cdr read-info) 5 newval))
(defsubst set-read-info->unfetched-texts (read-info newval)
"Set forward in read-info to NEWVAL."
(aset (cdr read-info) 6 newval))
(defsubst set-read-info->misc (read-info newval)
"Set forward in read-info to NEWVAL."
(aset (cdr read-info) 7 newval))
(defsubst lyskom-read-info-p (object)
"Return t if OBJECT is a read-info."
(eq (car-safe object) 'READ-INFO))
(def-komtype read-info
((type :read-only t)
(conf-stat :read-only t)
priority
(text-list :read-only t)
&optional
(comm-to :read-only t)
forward
(unfetched-texts :read-only t :automatic nil)
(misc :read-only t))
:nil-safe)
(defsubst read-info-append-text-list (read-info texts)
......@@ -162,10 +91,13 @@
(defsubst read-info-enter-text-last (read-info text-no)
(read-info-append-text-list read-info (list text-no)))
;;; ================================================================
;;; read-list
;;;
;;; We don't use def-komtype here because the code below relies on
;;; read-lists being a cons of READ-LIST and the data.
;;;
;;; Constructor:
......@@ -204,7 +136,7 @@ The range of valid values for N is [0, num-entries - 1]."
(defsubst read-list-length (read-list)
"Return the number of entries in READ-LIST."
(1- (length read-list)))
(length (read-list->all-entries read-list)))
;;; Modifiers:
......@@ -380,6 +312,7 @@ element will be the new first element."
(car-safe (cdr queue)))
;;UNUSED: lyskom-queue->last
(defsubst lyskom-queue->last (queue)
"Return the lastelement of QUEUE or nil if it is empty."
(car-safe (cdr (cdr queue))))
......@@ -389,6 +322,7 @@ element will be the new first element."
"Make the queue QUEUE empty."
(setcdr queue (cons nil nil)))
;;UNUSED: lyskom-queue-set-data
(defsubst lyskom-queue-set-data (queue data)
(lyskom-queue-make-empty queue)
(setcdr queue (cons data (last data))))
......@@ -445,11 +379,12 @@ is empty, return nil"
(car-safe (cdr stack)))
;;UNUSED: lyskom-stack->length
(defun lyskom-stack->length (stack)
"Return the number of elements on STACK."
(length (cdr stack)))
;;UNUSED: lyskom-stack->nth
(defun lyskom-stack->nth (stack n)
"Return element no (second arg) N of the stack (first arg) STACK.
N counts from zero. If the length of STACK is less than N, nil is returned."
......@@ -467,155 +402,21 @@ The element last pushed is first in the list."
(not (cdr stack)))
;;; ================================================================
;;; who-buffer-info
;;; Author: Inge Wallin
;;; Constructor:
(defun lyskom-create-who-buffer-info (info
start-marker
end-marker)
"Create a who-buffer-info from all parameters."
(cons
'WHO-BUFFER-INFO
(vector info start-marker end-marker )))
;;; Selectors:
(defun who-buffer-info->info (who-buffer-info)
"Get info from who-buffer-info."
(elt (cdr who-buffer-info) 0))
(defun who-buffer-info->start-marker (who-buffer-info)
"Get start-marker from who-buffer-info."
(elt (cdr who-buffer-info) 1))
(defun who-buffer-info->end-marker (who-buffer-info)
"Get end-marker from who-buffer-info."
(elt (cdr who-buffer-info) 2))
;;; Modifiers: