Commit a198cc61 authored by Johan Sundström's avatar Johan Sundström
Browse files

Portability fixes. Thanks, Joel and David.

parent 5d44a6ae
2001-04-24 Johan Sundstrm <jhs@lysator.liu.se>
* utilities.el (lyskom-set-alist): New function.
* commands1.el (lyskom-allocate-mark-type): Removed non-kosher use
of cdar and set-alist; uses the above now instead.
2001-04-23 Joel Rosdahl <joel@rosdahl.net> 2001-04-23 Joel Rosdahl <joel@rosdahl.net>
Clean-up of time handling and time formatting functions. Clean-up of time handling and time formatting functions.
......
...@@ -1950,7 +1950,7 @@ If no such existed either, nil is returned." ...@@ -1950,7 +1950,7 @@ If no such existed either, nil is returned."
(< i 256)) (< i 256))
(when (not (assq i used)) ; mark type i not presently used? (when (not (assq i used)) ; mark type i not presently used?
(when list (when list
(if (= i (cdar list)) ; already named? (if (= i (cdr (car list))) ; already named?
(setq list (cdr list)) (setq list (cdr list))
(setq found t)))) ; neither used nor named! (setq found t)))) ; neither used nor named!
(when (not found) (when (not found)
...@@ -1976,7 +1976,7 @@ increasing number of marks per mark type (and, when equal, by mark type)." ...@@ -1976,7 +1976,7 @@ increasing number of marks per mark type (and, when equal, by mark type)."
(type (mark->mark-type mark)) (type (mark->mark-type mark))
(tcnt (assq type cnt-alist))) (tcnt (assq type cnt-alist)))
(when tcnt (setq tcnt (cdr tcnt))) (when tcnt (setq tcnt (cdr tcnt)))
(set-alist 'cnt-alist type (if (null tcnt) 1 (1+ tcnt)))) (lyskom-set-alist cnt-alist type (if (null tcnt) 1 (1+ tcnt))))
(setq mark-list (cdr mark-list))) (setq mark-list (cdr mark-list)))
;; Sort the list, least-used, lowest number of mark type first: ;; Sort the list, least-used, lowest number of mark type first:
...@@ -1988,6 +1988,7 @@ increasing number of marks per mark type (and, when equal, by mark type)." ...@@ -1988,6 +1988,7 @@ increasing number of marks per mark type (and, when equal, by mark type)."
(t nil))))))) (t nil)))))))
;;; ================================================================ ;;; ================================================================
;;; ]terse alla markerade - Review marked texts ;;; ]terse alla markerade - Review marked texts
......
...@@ -253,6 +253,24 @@ Returns t if the feature is loaded or can be loaded, and nil otherwise." ...@@ -253,6 +253,24 @@ Returns t if the feature is loaded or can be loaded, and nil otherwise."
(lyskom-next-apo-timeout) (lyskom-next-apo-timeout)
(accept-process-output nil 0 lyskom-apo-timeout)) (accept-process-output nil 0 lyskom-apo-timeout))
(defun lyskom-current-time (&optional secs)
"Return the time in a format that LysKOM understands.
If optional argument SECS is set, it is used in place of the value
of \(current-time\)."
(let ((time (decode-time (or secs (current-time)))))
(setcar (cdr (cdr (cdr (cdr time))))
(1- (car (cdr (cdr (cdr (cdr time)))))))
(setcar (cdr (cdr (cdr (cdr (cdr time)))))
(- (car (cdr (cdr (cdr (cdr (cdr time))))))
1900))
time))
(defun lyskom-set-alist (alist item value)
"Modify an alist ALIST to set item ITEM to the value VALUE."
(let ((pair (assq item alist)))
(if pair
(progn (setcdr pair value) alist)
(cons (cons item value) alist))))
;;; ;;;
;;; LysKOM utility functions ;;; LysKOM utility functions
......
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