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

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."
(interactive)
(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))
newvec))))
(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)
(map-keymap
(function
(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."
(mapconcat
(function
(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
nil
(let ((i (length (setq lyskom-initial-completing-map (make-keymap)))))
(while (>= (setq i (1- i)) 0)
(aset lyskom-initial-completing-map i 'lyskom-hack-minibuf)))
(setq lyskom-initial-completing-map (make-keymap))
(if (fboundp 'map-keymap) ;lucid-emacs' way of doing things.
(map-keymap
(function (lambda (keydesc binding)
(define-key lyskom-initial-completing-map keydesc
'lyskom-hack-minibuf)))
global-map)
(let ((i (length lyskom-initial-completing-map)))
(while (>= (setq i (1- i)) 0)
(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 ()
(interactive)
(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."
(t
(let ((map (copy-keymap oldmap))
(r 0))
(if (arrayp newmap)
(while (< r (length newmap))
(if (aref newmap r)
(define-key map (char-to-string r) (aref newmap r)))
(setq r (1+ r)))
(mapcar
(cond
((fboundp 'map-keymap) ;Special for lucid-emacs
(map-keymap
(function
(lambda (ele)
(define-key map (char-to-string (car ele)) (cdr ele))))
(cdr newmap)))
(lambda (event function)
(define-key map event function)))
newmap))
((arrayp newmap)
(while (< r (length newmap))
(if (aref newmap r)
(define-key map (char-to-string r) (aref newmap r)))
(setq r (1+ r))))
(t
(mapcar
(function
(lambda (ele)
(define-key map (char-to-string (car ele)) (cdr ele))))
(cdr newmap))))
map))))
......
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