Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
climacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
climacs
climacs
Commits
5967b19c
Commit
5967b19c
authored
Jul 31, 2006
by
Troels Henriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `menu-choose' for selecting symbols when doing symbol-completion.
parent
76fad850
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
24 deletions
+27
-24
lisp-syntax.lisp
lisp-syntax.lisp
+27
-24
No files found.
lisp-syntax.lisp
View file @
5967b19c
;;; -*- Mode: Lisp; Package: CLIMACS-LISP-SYNTAX -*-
;;; (c) copyright 2005 by
;;; Robert Strandh (7strandh@labri.fr)
;;; Robert Strandh (strandh@labri.fr)
;;; (c) copyright 2006 by
;;; Troels Henriksen (athas@sigkill.dk)
;;;
;;; This library is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU Library General Public
...
...
@@ -3154,7 +3156,8 @@ results."
(
defun
arglist-keyword-p
(
arg
)
"Return T if `arg' is an arglist keyword. NIL otherwise."
(
member
arg
+cl-arglist-keywords+
))
(
when
(
member
arg
+cl-arglist-keywords+
)
t
))
(
defun
split-arglist-on-keywords
(
arglist
)
"Return an alist keying lambda list keywords of `arglist'
...
...
@@ -3957,15 +3960,7 @@ For example:
(
let*
((
result
(
funcall
fn
symbol
(
package-name
package
)))
(
set
(
first
result
))
(
longest
(
second
result
)))
(
cond
((
<=
(
length
set
)
1
)
(
clear-completions
))
(
t
(
let
((
stream
(
typeout-window
"Completions"
)))
(
window-clear
stream
)
(
format
stream
"~{~A~%~}"
set
))))
(
if
(
not
(
null
longest
))
(
esa:display-message
(
format
nil
"Longest is ~a|"
longest
))
(
esa:display-message
"No completions found"
))
longest
))
(
values
longest
set
)))
(
defun
find-completion
(
syntax
token
package
)
(
let
((
symbol-name
(
token-string
syntax
token
)))
...
...
@@ -3989,16 +3984,7 @@ For example:
(
esa:display-message
(
format
nil
"~a completions"
symbol-name
))
(
let*
((
set
(
fuzzy-completions
(
get-usable-image
syntax
)
symbol-name
package
10
))
(
best
(
caar
set
)))
(
cond
((
<=
(
length
set
)
1
)
(
clear-completions
))
(
t
(
let
((
stream
(
typeout-window
"Completions"
)))
(
window-clear
stream
)
(
loop
for
completed-string
in
set
do
(
format
stream
"~{~A ~}~%"
completed-string
)))))
(
esa:display-message
(
if
(
not
(
null
best
))
(
format
nil
"Best is ~a|"
best
)
"No fuzzy completions found"
))
best
)))
(
values
best
set
))))
(
defun
complete-symbol-at-mark-with-fn
(
syntax
mark
&optional
(
fn
#'
find-completion
))
"Attempt to find and complete the symbol at `mark' using the
...
...
@@ -4011,9 +3997,26 @@ For example:
(
not
(
=
(
start-offset
token
)
(
offset
mark
))))
(
with-syntax-package
syntax
mark
(
package
)
(
let
((
completion
(
funcall
fn
syntax
token
package
)))
(
unless
(
=
(
length
completion
)
0
)
(
replace-symbol-at-mark
mark
syntax
completion
))))
(
multiple-value-bind
(
longest
completions
)
(
funcall
fn
syntax
token
package
)
(
if
(
>
(
length
longest
)
0
)
(
if
(
=
(
length
completions
)
1
)
(
replace-symbol-at-mark
mark
syntax
longest
)
(
progn
(
esa:display-message
(
format
nil
"Longest is ~a|"
longest
))
(
let
((
selection
(
menu-choose
(
mapcar
;; FIXME: this can
;; get ugly.
#'
(
lambda
(
completion
)
(
if
(
listp
completion
)
(
cons
completion
(
first
completion
))
completion
))
completions
)
:label
"Possible completions"
:scroll-bars
:vertical
)))
(
replace-symbol-at-mark
mark
syntax
(
or
selection
longest
)))))
(
esa:display-message
"No completions found"
))))
t
)))
(
defun
complete-symbol-at-mark
(
syntax
mark
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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