Commit b61829bb authored by Linus Tolke Y's avatar Linus Tolke Y
Browse files

Support for lucid-emacs. Now it works for lucid also.

parent 55f53871
Tue Jun 16 00:34:42 1992 Linus Tolke Y (linus@robin)
* commands2.el, completing-read.el, edit-text.el, lyskom-rest.el
(keymaps are no longer always arrays): Works no for lucid-emacs.
Sat Jun 13 18:50:21 1992 Linus Tolke Y (linus@robert)
* swedish-string.el (*-mode-map): replaced
......@@ -850,7 +850,17 @@ Format is 23:29 if the text is written today. Otherwise 04-01."
(defun lyskom-help ()
"Prints a short list of alternatives when you don't know what you can do."
(let* ((tohere (substring (this-command-keys) 0 -1))
(let* ((tohere (cond
((stringp (this-command-keys))
(substring (this-command-keys) 0 -1))
(t ;This is the case in the lucid-emacs.
(let* ((tck (this-command-keys))
(newvec (make-vector (1- (length tck)) nil))
(r 0))
(while (< r (length newvec))
(aset newvec r (aref tck r))
(++ r))
(binding (key-binding tohere))
(keymap (cond
((and (symbolp binding)
......@@ -858,6 +868,15 @@ Format is 23:29 if the text is written today. Otherwise 04-01."
(symbol-function binding))
(t binding)))
(keylis (cond
((fboundp 'map-keymap)
(and keymap
(let (list)
(lambda (event function)
(setq list (cons (cons event function) list))))
keymap t)
(nreverse list))))
((vectorp keymap)
(let ((lis nil)
(r 0))
......@@ -874,8 +893,12 @@ Format is 23:29 if the text is written today. Otherwise 04-01."
(lambda (arg)
(format "%c - %s"
(car arg)
(format "%s - %s"
(if (fboundp 'map-keymap)
(if (symbolp (car arg))
(format "%s" (car arg))
(format "%c" (car arg)))
(format "%c" (car arg)))
(or (lyskom-command-name (cdr arg))
(and (keymapp (cdr arg))
(lyskom-get-string 'multiple-choice))
......@@ -289,7 +289,9 @@ When C-G is pressed then lyskom-end-of-command is evaled."
(and completion-buffer
(get-buffer-window completion-buffer)))
(use-local-map lyskom-completing-map)
(setq unread-command-char last-command-char))
(if (fboundp 'map-keymap) ;Special for lucid-emacs.
(setq unread-command-event last-command-event)
(setq unread-command-char last-command-char)))
(defun lyskom-complete-and-edit (conf-stats what
......@@ -407,9 +409,16 @@ parst matching ([^)]) in string and alist are disgarded."
(if lyskom-initial-completing-map
(let ((i (length (setq lyskom-initial-completing-map (make-keymap)))))
(setq lyskom-initial-completing-map (make-keymap))
(if (fboundp 'map-keymap) ;lucid-emacs' way of doing things.
(function (lambda (keydesc binding)
(define-key lyskom-initial-completing-map keydesc
(let ((i (length lyskom-initial-completing-map)))
(while (>= (setq i (1- i)) 0)
(aset lyskom-initial-completing-map i 'lyskom-hack-minibuf)))
(aset lyskom-initial-completing-map i 'lyskom-hack-minibuf))))
(define-key lyskom-initial-completing-map "\C-g" 'lyskom-complete-quit))
......@@ -340,7 +340,9 @@ Entry to this mode runs lyskom-edit-mode-hook."
(defun kom-edit-insert-digit-text ()
(setq unread-command-char last-command-char)
(if (fboundp 'map-keymap) ;Special for lucid-emacs
(setq unread-command-event last-command-event)
(setq unread-command-char last-command-char))
(call-interactively 'kom-edit-insert-text nil))
......@@ -735,16 +737,24 @@ BUG: does not descend in the maps."
(let ((map (copy-keymap oldmap))
(r 0))
(if (arrayp newmap)
((fboundp 'map-keymap) ;Special for lucid-emacs
(lambda (event function)
(define-key map event function)))
((arrayp newmap)
(while (< r (length newmap))
(if (aref newmap r)
(define-key map (char-to-string r) (aref newmap r)))
(setq r (1+ r)))
(setq r (1+ r))))
(lambda (ele)
(define-key map (char-to-string (car ele)) (cdr ele))))
(cdr newmap)))
(cdr newmap))))
No preview for this file type
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