Commit 3db94226 authored by David Kågedal's avatar David Kågedal
Browse files

No commit message

No commit message
parent d4d6b09d
......@@ -1566,72 +1566,6 @@ This variable is stored in the LysKOM server.")
;;;; This file contains the code that makes it possible to run a
;;;; long-commands mode in the lyskom-buffer.
;;; Author: Linus Tolke
(defvar lyskom-slow-mode-map
"Mode map for the `slow' lyskom command mode.")
(define-key lyskom-slow-mode-map "\r" 'lyskom-parse-command-and-execute)
(defun lyskom-parse-command-and-execute ()
"Reads a command from the last line in the buffer and executes it."
(goto-char (point-max))
(narrow-to-region lyskom-last-viewed (point-max))
(search-backward lyskom-prompt-text))
(forward-char (length lyskom-prompt-text))
(while (looking-at "\\s-")
(forward-char 1))
(let* ((text (buffer-substring (point) (point-max)))
(completion-ignore-case t)
(alternatives (mapcar (function reverse)
(if kom-emacs-knows-iso-8859-1
(completes (all-completions text alternatives)))
((zerop (length text))
((> (length completes) 1)
(lyskom-insert "\nYou might mean one of the following:\n")
(mapcar (function (lambda (string)
(lyskom-insert string)
(lyskom-insert "\n")))
((= (length completes) 1)
(delete-region (point) (point-max))
(call-interactively (car (reverse-assoc (car completes)
(if kom-emacs-knows-iso-8859-1
(lyskom-insert "There is not such command.\n")
(defun kom-slow-mode ()
"Starts the slow-command-mode."
(lyskom-start-of-command 'kom-slow-mode)
(use-local-map lyskom-slow-mode-map)
(defun kom-quick-mode ()
"Starts the quick-command-mode."
(lyskom-start-of-command 'kom-quick-mode)
(use-local-map lyskom-mode-map)
;; Review a non-converted text
;; Author: Linus Tolke
Supports Markdown
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