[slime-cvs] CVS slime/contrib
trittweiler
trittweiler at common-lisp.net
Fri Mar 14 14:33:07 UTC 2008
Update of /project/slime/cvsroot/slime/contrib
In directory clnet:/tmp/cvs-serv22176
Modified Files:
slime-fuzzy.el
Log Message:
* swank-fuzzy.lisp (fuzzy-convert-matching-for-emacs): Return a
string representation of the classifications rather than the
classifications themselves. (Notice this propagates up to (and
consequently changes the return value of) the RPC function
FUZZY-COMPLETIONS. (incompatible api change.)
Rationale: The number of supported classification can be changed
without having to adapt its display at the client.
* slime-fuzzy.lisp (slime-fuzzy-insert-completion-choice):
(slime-fuzzy-fill-completions-buffer): Adapted to API change.
--- /project/slime/cvsroot/slime/contrib/slime-fuzzy.el 2008/01/10 00:39:19 1.6
+++ /project/slime/cvsroot/slime/contrib/slime-fuzzy.el 2008/03/14 14:33:07 1.7
@@ -294,30 +294,22 @@
"Inserts the completion object `completion' as a formatted
completion choice into the current buffer, and mark it with the
proper text properties."
- (let ((start (point))
- (symbol-name (first completion))
- (score (second completion))
- (chunks (third completion))
- (flags (fourth completion)))
- (insert symbol-name)
- (let ((end (point)))
+ (destructuring-bind (symbol-name score chunks classification-string) completion
+ (let ((start (point))
+ (end))
+ (insert symbol-name)
+ (setq end (point))
(dolist (chunk chunks)
- (put-text-property (+ start (first chunk))
- (+ start (first chunk)
- (length (second chunk)))
- 'face 'bold))
+ (put-text-property (+ start (first chunk))
+ (+ start (first chunk)
+ (length (second chunk)))
+ 'face 'bold))
(put-text-property start (point) 'mouse-face 'highlight)
(dotimes (i (- max-length (- end start)))
- (insert " "))
- (insert (format " %s%s%s%s%s%s%s %8.2f"
- (if (member :boundp flags) "b" "-")
- (if (member :fboundp flags) "f" "-")
- (if (member :generic-function flags) "g" "-")
- (if (member :class flags) "c" "-")
- (if (member :macro flags) "m" "-")
- (if (member :special-operator flags) "s" "-")
- (if (member :package flags) "p" "-")
- score))
+ (insert " "))
+ (insert (format " %s %-8.2f"
+ classification-string
+ score))
(insert "\n")
(put-text-property start (point) 'completion completion))))
@@ -386,13 +378,20 @@
(insert "Completion:")
(dotimes (i (- max-length 10)) (insert " "))
- ;; Flags: Score:
- ;; ... ------- --------
- ;; bfgcmsp
- (insert "Flags: Score:\n")
- (dotimes (i max-length) (insert "-"))
- (insert " ------- --------\n")
- (setq slime-fuzzy-first (point))
+ ;; Flags: Score:
+ ;; ... ------- --------
+ ;; bfgctmsp
+ (let* ((example-classification-string (fourth (first completions)))
+ (classification-length (length example-classification-string))
+ (spaces (- classification-length (length "Flags:"))))
+ (insert "Flags:")
+ (dotimes (i spaces) (insert " "))
+ (insert " Score:\n")
+ (dotimes (i max-length) (insert "-"))
+ (insert " ")
+ (dotimes (i classification-length) (insert "-"))
+ (insert " --------\n")
+ (setq slime-fuzzy-first (point)))
(dolist (completion completions)
(setq slime-fuzzy-last (point)) ; will eventually become the last entry
More information about the slime-cvs
mailing list