Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
lyskom-elisp-client
lyskom-elisp-client
Commits
246d024d
Commit
246d024d
authored
Jun 23, 2002
by
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ChangeLog
View file @
246d024d
2002-06-23 David Byers <david.byers@swipnet.se>
Try to fix bug 429 (sort of):
* command.el (lyskom-command-minibuffer-local-completion-map): New
variable.
(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-complete-command.
(lyskom-ok-command): Support vectors from
lyskom-read-extended-command as inputs.
2002-06-22 David Byers <david.byers@swipnet.se>
* 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.
...
...
src/command.el
View file @
246d024d
...
...
@@ -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"
)))
map
)
"Keymap used for reading LysKOM names."
)
(
defvar
lyskom-command-minibuffer-local-must-match-map
(
let
((
map
(
copy-keymap
minibuffer-local-must-match-map
)))
(
lyskom-xemacs-or-gnu
(
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"
))))
map
)
"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,18 +247,23 @@
(
concat
prefix-text
base-prompt
)
base-prompt
)))
(
lyskom-with-lyskom-minibuffer
(
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
;; Yes, this is not beautiful
(
list
'lambda
'
(
alternative
)
(
list
'lyskom-ok-command
'alternative
lyskom-is-administrator
))
t
nil
'lyskom-command-history
)))
(
let
((
minibuffer-local-completion-map
lyskom-command-minibuffer-local-completion-map
)
(
minibuffer-local-must-match-map
lyskom-command-minibuffer-local-must-match-map
))
(
lyskom-with-lyskom-minibuffer
(
setq
name
(
lyskom-completing-read
prompt
'lyskom-complete-command
; (lyskom-maybe-frob-completion-table
; alternatives)
;; lyskom-is-administrator is buffer-local and
;; must be evalled before the call to
;; completing-read
;; Yes, this is not beautiful
(
list
'lambda
'
(
alternative
)
(
list
'lyskom-ok-command
'alternative
lyskom-is-administrator
))
t
nil
'lyskom-command-history
))))
(
cdr
(
lyskom-string-assoc
name
alternatives
))))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment