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
881d74e3
Commit
881d74e3
authored
Sep 02, 2000
by
David Byers
Browse files
Cleanup of command completion code.
parent
60e22571
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/ChangeLog
View file @
881d74e3
2000-09-02 David Byers <davby@sen2.ida.liu.se>
* completing-read.el (lyskom-completing-strip-name): Added
DONT-STRIP-SPACES argument.
2000-09-02 David Byers <davby@ida.liu.se>
* command.el (lyskom-command-match-string-regexp): New function.
(lyskom-completing-strip-command): New function.
(lyskom-complete-command): Record exact matches when iterating
through alternatives. Fix lyskom-lookup to return the exact match,
not just the first possible match.
* distribution-Makefile (INFODIR): Changed to default location for
Emacs installations.
(LISPDIR): Same here.
Sat Sep 2 14:24:57 2000 David Byers <davby@sen2.ida.liu.se>
* slow.el (lyskom-expand-slow-command): Use
lyskom-slow-list-completions to sort possible completions.
(lyskom-slow-list-completions): New function.
...
...
@@ -18,8 +17,6 @@ Sat Sep 2 14:24:57 2000 David Byers <davby@sen2.ida.liu.se>
* compatibility.el (char-before): New compatibility definition.
2000-09-02 David Byers <davby@sen2.ida.liu.se>
* utilities.el (lyskom-maybe-frob-completion-table): Add third
argument to lyskom-recode-string.
...
...
src/command.el
View file @
881d74e3
...
...
@@ -205,13 +205,6 @@
"Reads and returns a command"
(
let*
((
completion-ignore-case
t
)
(
minibuffer-setup-hook
minibuffer-setup-hook
)
;;; (alternatives (mapcar
;;; (lambda (pair)
;;; (cons
;;; (cdr pair)
;;; (car pair)))
;;; (lyskom-get-strings lyskom-commands
;;; 'lyskom-command)))
(
name
nil
)
(
prefix-text
(
cond
((
eq
prefix-arg
'-
)
"- "
)
...
...
@@ -256,11 +249,26 @@ transformed for matching."
(
lyskom-complete-command
string
predicate
'lyskom-lookup
))
(
defsubst
lyskom-command-match-string-regexp
(
string
)
(
concat
"^"
(
replace-in-string
(
regexp-quote
(
lyskom-unicase
(
lyskom-completing-strip-name
string
t
)))
"\\s-+"
"\\\\S-*\\\\s-+"
)
(
concat
"^"
(
replace-in-string
(
regexp-quote
(
lyskom-unicase
(
lyskom-completing-strip-command
string
)))
"\\s-+"
"\\\\S-*\\\\s-+"
)
"\\s-*"
))
(
defun
lyskom-completing-strip-command
(
string
)
"Strip parens and crap from a name.
If optional DONT-STRIP-SPACES is non-nil, don't strip spaces at front
and back of the string."
(
while
(
string-match
"([^()]*)"
string
)
; Strip nested parens
(
setq
string
(
replace-match
" "
t
t
string
)))
(
while
(
string-match
"\\s-\\s-+"
string
)
; Collapse spaces
(
setq
string
(
replace-match
" "
t
t
string
)))
(
while
(
string-match
"([^()]*$"
string
)
; Strip incomplete parens at end
(
setq
string
(
substring
string
0
(
match-beginning
0
))))
string
)
(
defun
lyskom-complete-command
(
string
predicate
all
)
"Completion function for LysKOM commands."
(
let
((
alternatives
nil
)
...
...
src/completing-read.el
View file @
881d74e3
...
...
@@ -550,18 +550,15 @@ function work as a name-to-conf-stat translator."
result
))
(
defun
lyskom-completing-strip-name
(
string
&optional
dont-strip-spaces
)
"Strip parens and crap from a name.
If optional DONT-STRIP-SPACES is non-nil, don't strip spaces at front
and back of the string."
(
defun
lyskom-completing-strip-name
(
string
)
"Strip parens and crap from a name."
(
while
(
string-match
"([^()]*)"
string
)
(
setq
string
(
replace-match
" "
t
t
string
)))
(
while
(
string-match
"\\s-\\s-+"
string
)
(
setq
string
(
replace-match
" "
t
t
string
)))
(
while
(
string-match
"([^()]*$"
string
)
(
setq
string
(
substring
string
0
(
match-beginning
0
))))
(
if
(
and
(
not
dont-strip-spaces
)
(
string-match
"^\\s-*\\(.*\\S-\\)\\s-*$"
string
))
(
if
(
string-match
"^\\s-*\\(.*\\S-\\)\\s-*$"
string
)
(
match-string
1
string
)
string
))
...
...
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