Commit 37e1f80b authored by David Byers's avatar David Byers
Browse files

XEmacs compatibility restored.

Fix constant definition of lyskom-max-int
parent 98dd9a91
2002-04-24 David Byers <david.byers@swipnet.se>
* compatibility.el (make-temp-file): Maybe compatibility with
XEmacs. At least the warnings are gone...
* commands2.el (kom-diff-texts): Survive even if diff-command is
not bound (assume that the command is called "diff").
* lyskom-rest.el (lyskom-format-insert-overlays): Made XEmacs
compatible.
(lyskom-format-aux-help): Removed unused variables.
* edit-text.el (lyskom-edit-send-check-recipients): Removed unused
variables.
* commands2.el (kom-status-server): Removed unused variables.
* startup.el (kom-start-anew): Removed unused variable err.
* aux-items.el (lyskom-print-faq-format-subject): Removed unused
variable "subject".
Fix bug 473:
* vars.el.in (lyskom-max-int): Define as variable, not constant.
2002-04-24 David Kgedal <david@virtutech.se>
* commands2.el (kom-change-language): Added prefix parameter to
......
......@@ -578,14 +578,13 @@ return non-nil if the item is to be included in the list."
(lyskom-aux-item-terminating-button item obj)))
(defun lyskom-print-faq-format-subject (text text-stat text-no)
(let ((subject ""))
(if (and text text-stat)
(concat "\""
(cond ((string-match "\n" (text->decoded-text-mass text text-stat))
(substring (text->decoded-text-mass text text-stat) 0 (match-beginning 0)))
(t ""))
"\"")
(lyskom-format 'no-such-text-no text-no))))
(if (and text text-stat)
(concat "\""
(cond ((string-match "\n" (text->decoded-text-mass text text-stat))
(substring (text->decoded-text-mass text text-stat) 0 (match-beginning 0)))
(t ""))
"\"")
(lyskom-format 'no-such-text-no text-no)))
(defun lyskom-deferred-print-faq (text-stat defer-info)
(if text-stat
......
......@@ -2547,6 +2547,8 @@ to the first text that NEW is a comment or footnote to."
(kill-buffer buf)
file))
(defvar diff-command)
(def-kom-command kom-diff-texts (old new &optional switches)
"Show differences between text OLD and NEW.
When called interactively, it will prompt for the NEW text first,
......@@ -2602,7 +2604,10 @@ to the first text that NEW is a comment or footnote to."
(set-buffer buf)
(let ((buffer-read-only nil))
(apply 'call-process diff-command nil buf nil args))
(apply 'call-process (if (boundp 'diff-command)
diff-command
"diff")
nil buf nil args))
(delete-file oldfile)
(delete-file newfile))))
......@@ -2685,9 +2690,6 @@ to the first text that NEW is a comment or footnote to."
(setq lyskom-server-version-info (blocking-do 'get-version-info))
(let* ((aux-items (server-info->aux-item-list lyskom-server-info))
(e-mail-address (lyskom-get-aux-item aux-items 13))
(faqs (lyskom-get-aux-item aux-items 14))
(recommended-conf (lyskom-get-aux-item aux-items 29))
(canonical-name-aux (car (lyskom-get-aux-item aux-items 31)))
(invisible-sessions 0)
(anonymous-sessions 0)
......
......@@ -465,12 +465,15 @@ If DIR-FLAG is non-nil, create a new empty directory instead of a file."
(progn
(setq file
(make-temp-name
(expand-file-name prefix temporary-file-directory)))
(expand-file-name prefix
(lyskom-xemacs-or-gnu
(temp-directory)
temporary-file-directory))))
(if dir-flag
(make-directory file)
(write-region "" nil file nil 'silent nil 'excl))
nil)
(file-already-exists t))
(file-already-exists t))
;; the file was somehow created by someone else between
;; `make-temp-name' and `write-region', let's try again.
nil)
......
......@@ -912,7 +912,6 @@ Cannot be called from a callback."
(let ((raw-author-list (make-collector))
(author-list nil)
(authors-to-ask-about nil)
(authors-to-add nil)
(recipient-list (let ((result nil))
(lyskom-traverse misc (cdr misc-list)
(when (memq (car misc)
......
......@@ -1118,12 +1118,19 @@ Args: FORMAT-STRING &rest ARGS"
(defun lyskom-format-insert-overlays (start format-state)
"Insert delayed overlays according to FORMAT-STATE."
(lyskom-traverse overlay (format-state->delayed-overlays format-state)
(let ((overlay (make-overlay (+ start (aref overlay 0))
(+ start (aref overlay 1))))
(args (aref overlay 2)))
(while args
(overlay-put overlay (car args) (car (cdr args)))
(setq args (nthcdr 2 args))))))
(lyskom-xemacs-or-gnu
(let ((overlay (make-extent (+ start (aref overlay 0))
(+ start (aref overlay 1))))
(args (aref overlay 2)))
(while args
(set-extent-property overlay (car args) (car (cdr args)))
(setq args (nthcdr 2 args))))
(let ((overlay (make-overlay (+ start (aref overlay 0))
(+ start (aref overlay 1))))
(args (aref overlay 2)))
(while args
(overlay-put overlay (car args) (car (cdr args)))
(setq args (nthcdr 2 args)))))))
(defun lyskom-format-insert (format-string &rest argl)
"Format and insert a string according to FORMAT-STRING.
......@@ -1420,13 +1427,12 @@ Deferred insertions and overlays are not supported."
;;
((= format-letter ?$)
(when arg
(let ((overlay (make-overlay 0 0)))
(set-format-state->delayed-overlays
format-state
(cons (vector (length (format-state->result format-state))
nil
arg)
(format-state->delayed-overlays format-state))))))
(set-format-state->delayed-overlays
format-state
(cons (vector (length (format-state->result format-state))
nil
arg)
(format-state->delayed-overlays format-state)))))
;;
;; Format a subformat list by recursively formatting the contents
;; of the list, augmenting the result and format state
......
......@@ -577,7 +577,7 @@ shown to other users."
(setq lyskom-is-new-user nil)
;; Do some FAQ handling
(condition-case err
(condition-case nil
(progn (lyskom-update-read-faqs)
(lyskom-update-rejected-recommendations)
(lyskom-startup-check-faqs)
......
......@@ -1850,7 +1850,7 @@ is a list of vectors, where each vector specifies an item.
(defconst lyskom-clientversion "@@CLIENTVERSION@@"
"Version of the LysKOM elisp client.")
(defconst lyskom-max-int 8388607
(defvar lyskom-max-int 8388607
"The largest int Emacs, and thus this LysKOM client, can handle.")
(defconst lyskom-server-features
......
......@@ -903,8 +903,7 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO FLAT-REVIEW."
pos nil
truncated t)))))
(let ((lyskom-current-function-phase 'body)
(start (point)))
(let ((lyskom-current-function-phase 'body))
(lyskom-format-insert "%#2$%#1t\n"
(cons text-stat body)
(and kom-color-text-background
......
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