Commit 246d024d authored by David Byers's avatar David Byers
Browse files

Better completion of LysKOM commands. Now minibuffer completion of

commands works the same way completion with slow commands works.
parent 3d2177cf
2002-06-23 David Byers <>
Try to fix bug 429 (sort of):
* command.el (lyskom-command-minibuffer-local-completion-map): New
(lyskom-command-minibuffer-local-must-match-map): New variable.
(lyskom-read-extended-command): Use new minibuffer maps when
reading command names. Do completion using
(lyskom-ok-command): Support vectors from
lyskom-read-extended-command as inputs.
2002-06-22 David Byers <>
* doc/NEWS-0.47: Uppdaterad till denna punkt i ChangeLog infr
release av 0.47-BETA-3 ngon gng snart.
* startup.el (lyskom): Renamed all proxy-* variables to
www-proxy-*. Changed open-network-stream to
lyskom-open-network-stream in order to support ssh proxies.
......@@ -189,6 +189,8 @@
(defun lyskom-ok-command (alternative administrator)
"Returns non-nil if it is ok to do such a command right now."
(when (vectorp alternative)
(setq alternative (cons (elt alternative 0) (elt alternative 1))))
(if administrator
(not (memq (cdr alternative) lyskom-admin-removed-commands))
(not (memq (cdr alternative) lyskom-noadmin-removed-commands))))
......@@ -201,6 +203,22 @@
(fnc (call-interactively fnc))
(t (kom-next-command)))) )
(defvar lyskom-command-minibuffer-local-completion-map
(let ((map (copy-keymap minibuffer-local-completion-map)))
(define-key map " " (lookup-key map (kbd "TAB")))
"Keymap used for reading LysKOM names.")
(defvar lyskom-command-minibuffer-local-must-match-map
(let ((map (copy-keymap minibuffer-local-must-match-map)))
(progn (set-keymap-parent map lyskom-minibuffer-local-completion-map)
(define-key map " "
(lookup-key lyskom-minibuffer-local-completion-map (kbd "TAB"))))
(define-key map " " (lookup-key map (kbd "TAB"))))
"Keymap used for reading LysKOM names.")
(defun lyskom-read-extended-command (&optional prefix-arg prompt)
"Reads and returns a command"
(let* ((completion-ignore-case t)
......@@ -229,10 +247,15 @@
(concat prefix-text base-prompt)
(let ((minibuffer-local-completion-map
(setq name (lyskom-completing-read prompt
; (lyskom-maybe-frob-completion-table
; alternatives)
;; lyskom-is-administrator is buffer-local and
;; must be evalled before the call to
;; completing-read
......@@ -240,7 +263,7 @@
(list 'lambda '(alternative)
(list 'lyskom-ok-command 'alternative
t nil 'lyskom-command-history)))
t nil 'lyskom-command-history))))
(cdr (lyskom-string-assoc name alternatives))))
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