Commit e7705b03 authored by Niels Möller's avatar Niels Möller
Browse files

lyskom-commands är en riktig alista

parent 22fbcfe4
......@@ -620,8 +620,8 @@ If optional arg TEXT-NO is present write a comment to that text instead."
(t
(signal 'lyskom-internal-error '(kom-write-comment))))))
(lyskom-start-of-command (concat
(car (cdr (assoc 'kom-write-comment
lyskom-commands)))
(lyskom-get-string 'kom-write-comment
lyskom-commands)
(if text-no
(format " (%d)" text-no)
"")))
......
No preview for this file type
......@@ -1097,8 +1097,8 @@ customize buffer but do not save them to the server."
(string (save-excursion
(set-buffer lyskom-buffer)
(cond ((null value) "")
(t (or (car-safe (cdr-safe
(assq value lyskom-commands)))
(t (or (cdr-safe
(assq value lyskom-commands))
(lyskom-format
(lyskom-custom-string 'unknown-command)
(symbol-name value))))))))
......
......@@ -70,7 +70,8 @@ If the completion was not exact it returns nil."
(interactive)
(let* ((text (lyskom-get-entered-slow-command))
(completion-ignore-case t)
(alternatives (mapcar 'reverse
(alternatives (mapcar (function (lambda (pair)
(list (cdr pair) (car pair))))
(if kom-emacs-knows-iso-8859-1
lyskom-commands
lyskom-swascii-commands)))
......@@ -83,10 +84,10 @@ If the completion was not exact it returns nil."
(lyskom-insert-before-prompt (lyskom-get-string 'no-such-command))
(lyskom-beep t))
((= (length completes) 1)
(setq command (cons (car (reverse-assoc (car completes)
(if kom-emacs-knows-iso-8859-1
lyskom-commands
lyskom-swascii-commands)))
(setq command (cons (car (rassq (car completes)
(if kom-emacs-knows-iso-8859-1
lyskom-commands
lyskom-swascii-commands)))
(point)))
(delete-region (point) (point-max))
(insert (car completes)))
......
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