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
climacs
climacs
Commits
ee0998bd
Commit
ee0998bd
authored
Jul 21, 2006
by
Troels Henriksen
Browse files
Fixed issue where the symbol-completer was a bit too eager in deleting
the original partial symbol.
parent
9ba9d1d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
lisp-syntax-commands.lisp
View file @
ee0998bd
...
...
@@ -245,24 +245,22 @@ Definition command was issued."
(
clear-completions
)))
(
define-command
(
com-complete-symbol
:name
t
:command-table
lisp-table
)
()
"Attempt to complete the symbol at mark.
"Attempt to complete the symbol at mark. If successful, move point
to end of symbol.
If more than one completion is available, a list of
possible
completions will be displayed."
If more than one completion is available, a list of
possible
completions will be displayed."
(
let*
((
pane
(
current-window
))
(
buffer
(
buffer
pane
))
(
syntax
(
syntax
buffer
))
(
point-current-window
(
point
pane
))
(
name
(
symbol-name-at-mark
point-current-window
(
mark
(
point
pane
))
(
name
(
symbol-name-at-mark
mark
syntax
)))
(
when
name
(
with-syntax-package
syntax
point-current-window
(
package
)
(
let
((
completion
(
show-completions
syntax
name
package
))
(
mark
(
clone-mark
point-current-window
)))
(
with-syntax-package
syntax
mark
(
package
)
(
let
((
completion
(
show-completions
syntax
name
package
)))
(
unless
(
=
(
length
completion
)
0
)
(
backward-object
mark
(
length
name
))
(
delete-region
mark
point-current-window
)
(
insert-sequence
point-current-window
completion
)))))))
(
replace-symbol-at-mark
mark
syntax
completion
)))))))
(
define-command
(
com-fuzzily-complete-symbol
:name
t
:command-table
lisp-table
)
()
"Attempt to fuzzily complete the abbreviation at mark.
...
...
@@ -273,17 +271,14 @@ will be displayed."
(
let*
((
pane
(
current-window
))
(
buffer
(
buffer
pane
))
(
syntax
(
syntax
buffer
))
(
point-current-window
(
point
pane
))
(
name
(
symbol-name-at-mark
point-current-window
(
mark
(
mark
pane
))
(
name
(
symbol-name-at-mark
mark
syntax
)))
(
when
name
(
with-syntax-package
syntax
point-current-window
(
package
)
(
let
((
completion
(
show-fuzzy-completions
syntax
name
package
))
(
mark
(
clone-mark
point-current-window
)))
(
with-syntax-package
syntax
mark
(
package
)
(
let
((
completion
(
show-fuzzy-completions
syntax
name
package
)))
(
unless
(
=
(
length
completion
)
0
)
(
backward-object
mark
(
length
name
))
(
delete-region
mark
point-current-window
)
(
insert-sequence
point-current-window
completion
)))))))
(
replace-symbol-at-mark
mark
syntax
completion
)))))))
(
define-presentation-to-command-translator
lookup-symbol-arglist
(
symbol
com-lookup-arglist
lisp-table
...
...
lisp-syntax.lisp
View file @
ee0998bd
...
...
@@ -1573,6 +1573,19 @@ returned."
(let ((token (symbol-at-mark mark syntax)))
(when token (token-string syntax token))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Useful functions for modifying forms based on the mark.
(defun replace-symbol-at-mark (mark syntax string)
"Replace the symbol at `mark' with `string' and move `mark' to
after `string'."
(let ((token (symbol-at-mark mark syntax)))
(unless (= (offset mark) (start-offset token))
(backward-expression mark syntax 1 nil))
(forward-kill-expression mark syntax)
(insert-sequence mark string)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; display
...
...
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