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

Fixar till långsamma kommandon.

parent 0b6c862c
Thu Jul 10 10:16:35 1997 David Byers <davby@ida.liu.se>
* utilities.el (lyskom-set-face-scheme): Testa att console-type
inte r tty. Det r antagligen marginellt bttre n att testa
explicit fr x eller win32.
* slow.el (kom-expand-slow-or-next-command): Sl av undo vid
exekvering av kommando.
(lyskom-get-entered-slow-command): Frsk hantera att prompten
saknas.
(kom-parse-command-and-execute): Disabla undo medan man kr
kommandot.
* command.el (lyskom-end-of-command): Sl p undo efter prompten
r utskriven.
* lyskom-rest.el (lyskom-update-prompt): Gr prompten read-only om
man har lngsamma kommandon p.
* vars.el.in (lyskom-saved-read-only): Ny variabel.
(lyskom-slow-mode): Ny variabel.
Wed Jul 9 11:55:47 1997 David Byers <davby@ida.liu.se>
* utilities.el (lyskom-default-collate-table): Rttat strngen som
......
......@@ -240,7 +240,9 @@ chosen according to this"
(setq lyskom-pending-commands (cdr lyskom-pending-commands))
(if (symbolp command)
(call-interactively command)
(eval command)))))
(eval command))))
(when lyskom-slow-mode
(buffer-enable-undo)))
(provide 'lyskom-command)
......
......@@ -1363,7 +1363,7 @@ Note that it is not allowed to use deferred insertions in the text."
(defun lyskom-format-html (text)
(condition-case e (require 'w3) (error nil))
(let ((tmpbuf (generate-new-buffer "lyskom-html")))
(let ((tmpbuf (lyskom-get-buffer-create 'lyskom-html " lyskom-html" t)))
(unwind-protect
(save-excursion
(set-buffer tmpbuf)
......@@ -1383,9 +1383,7 @@ Note that it is not allowed to use deferred insertions in the text."
nil))
(setq tmp (buffer-string))
(add-text-properties 0 (length tmp) '(end-closed nil) tmp)
tmp))
(kill-buffer tmpbuf)
)))
tmp)))))
(defun lyskom-format-enriched (text)
......@@ -1611,6 +1609,9 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
;; Insert the new prompt
(goto-char (point-max))
(beginning-of-line)
(when lyskom-slow-mode
(add-text-properties 0 (length prompt-text)
'(read-only t) prompt-text))
(insert-string prompt-text)
;; Delete the old prompt
(if lyskom-current-prompt
......
......@@ -51,11 +51,15 @@ Note that this function leaves point at the end of the prompt.
If no text is entered, nil is returned."
(goto-char (point-max))
(save-restriction
(when (> lyskom-last-viewed (point-max))
(setq lyskom-last-viewed (point-max)))
(narrow-to-region lyskom-last-viewed (point-max))
(search-backward lyskom-current-prompt-text))
(forward-char (length lyskom-current-prompt-text))
(while (looking-at "\\s-")
(forward-char 1))
(if (search-backward lyskom-current-prompt-text nil t)
(forward-char (length lyskom-current-prompt-text))
(goto-char (point-max))
(beginning-of-line))
(when (looking-at "\\(\\s-+\\)")
(goto-char (match-end 0))))
(if (= (point) (point-max))
nil
(buffer-substring (point) (point-max))))
......@@ -110,6 +114,7 @@ If the completion was not exact it returns nil."
(interactive)
(if (lyskom-get-entered-slow-command)
(kom-expand-slow-command)
(buffer-disable-undo)
(kom-next-command)))
......@@ -118,6 +123,7 @@ If the completion was not exact it returns nil."
(interactive)
(let* ((text (lyskom-get-entered-slow-command))
(command (and text (kom-expand-slow-command))))
(buffer-disable-undo)
(cond
((null text)
(call-interactively 'kom-next-command))
......@@ -130,14 +136,21 @@ If the completion was not exact it returns nil."
"Starts the slow-command-mode."
(interactive)
(lyskom-start-of-command 'kom-slow-mode)
(use-local-map lyskom-slow-mode-map)
(unless lyskom-slow-mode
(setq lyskom-saved-read-only buffer-read-only)
(setq lyskom-slow-mode t)
(setq buffer-read-only nil)
(use-local-map lyskom-slow-mode-map))
(lyskom-end-of-command))
(defun kom-quick-mode ()
"Starts the quick-command-mode."
(interactive)
(lyskom-start-of-command 'kom-quick-mode)
(use-local-map lyskom-mode-map)
(when lyskom-slow-mode
(setq buffer-read-only lyskom-saved-read-only)
(setq lyskom-slow-mode nil)
(use-local-map lyskom-mode-map))
(lyskom-end-of-command))
......@@ -375,9 +375,8 @@ under XEmacs."
"Set the LysKOM color and face scheme to SCHEME. Valid schemes are listed
in lyskom-face-schemes."
(let ((tmp (assoc scheme lyskom-face-schemes)))
;; This test is NOT good
(if (and tmp (or (eq (console-type) 'x)
(eq (console-type) 'win32)
;; This test is NOT good, but now it's better...
(if (and tmp (or (not (eq (console-type) 'tty))
(not (eq (device-class) 'mono))))
(progn
(mapcar
......
......@@ -1609,17 +1609,25 @@ an unknown person.")
(def-kom-var kom-no-comments-to-motd nil
"This should always be set to nil unless you are Klaus Zeuge.") ;+++SOJGE
(defvar lyskom-format-special '((html . lyskom-format-html)
(def-kom-var lyskom-format-special '((html . lyskom-format-html)
(enriched . lyskom-format-enriched))
"AList of (FORMAT . FUNCTION) specifying functions that format texts
of that type. FORMAT is a symbol and FUNCTION is a function taking one
argument and returning a formatted string.")
(defvar lyskom-send-text-transform-function nil
(def-kom-var lyskom-send-text-transform-function nil
"Function to call to transform text before sending it to the server.
The function should accept a single argument and return the transformed
texts that is to be sent to the server.")
(def-kom-var lyskom-slow-mode nil
"Non-nil when in slow mode"
local)
(def-kom-var lyskom-saved-read-only nil
"Saved value of buffer-read-only when in slow mode."
local)
;;; ======================================================================
;;; Event hooks
;;;
......
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