Changeset 2735
- Timestamp:
- 03/14/08 16:37:10 (10 months ago)
- Files:
-
- trunk/thirdparty/slime/CVS/Entries (modified) (1 diff)
- trunk/thirdparty/slime/ChangeLog (modified) (1 diff)
- trunk/thirdparty/slime/contrib/CVS/Entries (modified) (4 diffs)
- trunk/thirdparty/slime/contrib/ChangeLog (modified) (1 diff)
- trunk/thirdparty/slime/contrib/slime-fuzzy.el (modified) (2 diffs)
- trunk/thirdparty/slime/contrib/swank-fancy-inspector.lisp (modified) (4 diffs)
- trunk/thirdparty/slime/contrib/swank-fuzzy.lisp (modified) (4 diffs)
- trunk/thirdparty/slime/slime.el (modified) (1 diff)
- trunk/thirdparty/slime/swank.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/thirdparty/slime/CVS/Entries
r2731 r2735 28 28 /swank-source-path-parser.lisp/1.18/Tue Mar 11 05:01:33 2008// 29 29 /swank.asd/1.8/Wed Mar 12 07:05:29 2008// 30 /swank.lisp/1.538/Result of merge//31 30 /test-all.sh/1.2/Tue Mar 11 05:01:33 2008// 32 31 /test.sh/1.10/Wed Mar 12 07:05:31 2008// 33 32 /xref.lisp/1.2/Tue Mar 11 05:01:33 2008// 34 /ChangeLog/1.1318/Thu Mar 13 19:55:28 2008// 35 /slime.el/1.922/Thu Mar 13 19:55:28 2008// 33 /slime.el/1.923/Fri Mar 14 05:12:48 2008// 34 /ChangeLog/1.1320/Fri Mar 14 15:35:49 2008// 35 /swank.lisp/1.539/Result of merge// trunk/thirdparty/slime/ChangeLog
r2731 r2735 1 2008-03-14 Tobias C. Rittweiler <tcr@freebits.de> 2 3 * swank.lisp (classify-symbol, symbol-classification->string): Add 4 classification of symbols denoting type specifier, and denoting 5 constants. 6 7 2008-03-13 Tobias C. Rittweiler <tcr@freebits.de> 8 9 * slime.el (slime-eval-macroexpand): Indent expansion. 10 1 11 2008-03-13 Tobias C. Rittweiler <tcr@freebits.de> 2 12 trunk/thirdparty/slime/contrib/CVS/Entries
r2721 r2735 1 /ChangeLog/1.97/Wed Mar 12 07:05:36 2008//2 1 /README/1.3/Tue Mar 11 05:01:33 2008// 3 2 /bridge.el/1.1/Tue Mar 11 05:01:33 2008// … … 10 9 /slime-fancy-inspector.el/1.3/Tue Mar 11 05:01:33 2008// 11 10 /slime-fancy.el/1.5/Tue Mar 11 05:01:33 2008// 12 /slime-fuzzy.el/1.6/Tue Mar 11 05:01:33 2008//13 11 /slime-highlight-edits.el/1.3/Tue Mar 11 05:01:33 2008// 14 12 /slime-indentation.el/1.1/Tue Mar 11 05:01:33 2008// … … 26 24 /swank-asdf.lisp/1.1/Tue Mar 11 05:01:33 2008// 27 25 /swank-c-p-c.lisp/1.2/Tue Mar 11 05:01:33 2008// 28 /swank-fancy-inspector.lisp/1.12/Wed Mar 12 07:05:37 2008//29 /swank-fuzzy.lisp/1.7/Tue Mar 11 05:01:33 2008//30 26 /swank-goo.goo/1.1/Tue Mar 11 05:01:33 2008// 31 27 /swank-indentation.lisp/1.1/Tue Mar 11 05:01:33 2008// … … 36 32 /swank-presentation-streams.lisp/1.5/Tue Mar 11 05:01:33 2008// 37 33 /swank-presentations.lisp/1.5/Tue Mar 11 05:01:33 2008// 34 /ChangeLog/1.100/Fri Mar 14 15:35:51 2008// 35 /slime-fuzzy.el/1.7/Fri Mar 14 15:35:51 2008// 36 /swank-fancy-inspector.lisp/1.14/Fri Mar 14 15:35:51 2008// 37 /swank-fuzzy.lisp/1.8/Fri Mar 14 15:35:52 2008// 38 38 D trunk/thirdparty/slime/contrib/ChangeLog
r2721 r2735 1 2008-03-14 Tobias C. Rittweiler <tcr@freebits.de> 2 3 * swank-fancy-inspector.lisp (add-slots-for-inspector): Remove 4 IGNORE declaration of non-existing argument. 5 6 2008-03-14 Tobias C. Rittweiler <tcr@freebits.de> 7 8 * swank-fuzzy.lisp (fuzzy-convert-matching-for-emacs): Return a 9 string representation of the classifications rather than the 10 classifications themselves. (Notice this propagates up to (and 11 consequently changes the return value of) the RPC function 12 FUZZY-COMPLETIONS. (incompatible api change.) 13 14 Rationale: The number of supported classification can be changed 15 without having to adapt its display at the client. 16 17 * slime-fuzzy.lisp (slime-fuzzy-insert-completion-choice): 18 (slime-fuzzy-fill-completions-buffer): Adapted to API change. 19 20 2008-03-14 Tobias C. Rittweiler <tcr@freebits.de> 21 22 * swank-fancy-inspector.lisp (make-symbols-listing :classification): 23 Add support for typespec and constant classification; don't 24 silently ignore symbols that can't be usefully classified, but 25 group them under "MISC". 26 1 27 2008-03-08 Helmut Eller <heller@common-lisp.net> 2 28 trunk/thirdparty/slime/contrib/slime-fuzzy.el
r2410 r2735 295 295 completion choice into the current buffer, and mark it with the 296 296 proper text properties." 297 (let ((start (point)) 298 (symbol-name (first completion)) 299 (score (second completion)) 300 (chunks (third completion)) 301 (flags (fourth completion))) 302 (insert symbol-name) 303 (let ((end (point))) 297 (destructuring-bind (symbol-name score chunks classification-string) completion 298 (let ((start (point)) 299 (end)) 300 (insert symbol-name) 301 (setq end (point)) 304 302 (dolist (chunk chunks) 305 (put-text-property (+ start (first chunk))306 (+ start (first chunk)307 (length (second chunk)))308 'face 'bold))303 (put-text-property (+ start (first chunk)) 304 (+ start (first chunk) 305 (length (second chunk))) 306 'face 'bold)) 309 307 (put-text-property start (point) 'mouse-face 'highlight) 310 308 (dotimes (i (- max-length (- end start))) 311 (insert " ")) 312 (insert (format " %s%s%s%s%s%s%s %8.2f" 313 (if (member :boundp flags) "b" "-") 314 (if (member :fboundp flags) "f" "-") 315 (if (member :generic-function flags) "g" "-") 316 (if (member :class flags) "c" "-") 317 (if (member :macro flags) "m" "-") 318 (if (member :special-operator flags) "s" "-") 319 (if (member :package flags) "p" "-") 320 score)) 309 (insert " ")) 310 (insert (format " %s %-8.2f" 311 classification-string 312 score)) 321 313 (insert "\n") 322 314 (put-text-property start (point) 'completion completion)))) … … 387 379 (insert "Completion:") 388 380 (dotimes (i (- max-length 10)) (insert " ")) 389 ;; Flags: Score: 390 ;; ... ------- -------- 391 ;; bfgcmsp 392 (insert "Flags: Score:\n") 393 (dotimes (i max-length) (insert "-")) 394 (insert " ------- --------\n") 395 (setq slime-fuzzy-first (point)) 381 ;; Flags: Score: 382 ;; ... ------- -------- 383 ;; bfgctmsp 384 (let* ((example-classification-string (fourth (first completions))) 385 (classification-length (length example-classification-string)) 386 (spaces (- classification-length (length "Flags:")))) 387 (insert "Flags:") 388 (dotimes (i spaces) (insert " ")) 389 (insert " Score:\n") 390 (dotimes (i max-length) (insert "-")) 391 (insert " ") 392 (dotimes (i classification-length) (insert "-")) 393 (insert " --------\n") 394 (setq slime-fuzzy-first (point))) 396 395 397 396 (dolist (completion completions) trunk/thirdparty/slime/contrib/swank-fancy-inspector.lisp
r2721 r2735 189 189 (defgeneric all-slots-for-inspector (object) 190 190 (:method ((object standard-object)) 191 (declare (ignore inspector))192 191 (append '("--------------------" (:newline) 193 192 "All Slots:" (:newline)) … … 343 342 ;; Wrapper structure over the list of symbols of a package that should 344 343 ;; be displayed with their respective classification flags. This is 345 ;; because we need a unique type to dispatch on in INSPECT-FOR-EMACS.344 ;; because we need a unique type to dispatch on in EMACS-INSPECT. 346 345 ;; Used by the Inspector for packages. 347 346 (defstruct (%package-symbols-container (:conc-name %container.) … … 382 381 (make-string (+ max-length distance -1) :initial-element #\-) 383 382 " " 384 (let* ((dummy (classify-symbol (gensym)))383 (let* ((dummy (classify-symbol :foo)) 385 384 (dummy (symbol-classification->string dummy)) 386 385 (classification-length (length dummy))) … … 403 402 instead there are the three explicit FUNCTION, MACRO and 404 403 SPECIAL-OPERATOR groups." 405 (let ((table (make-hash-table :test #'eq))) 406 (flet ((maybe-convert-fboundps (classifications) 407 ;; Convert an :FBOUNDP in CLASSIFICATIONS to :FUNCTION if possible. 408 (if (and (member :fboundp classifications) 409 (not (member :macro classifications)) 410 (not (member :special-operator classifications))) 411 (substitute :function :fboundp classifications) 412 (remove :fboundp classifications)))) 404 (let ((table (make-hash-table :test #'eq)) 405 (+default-classification+ :misc)) 406 (flet ((normalize-classifications (classifications) 407 (cond ((null classifications) `(,+default-classification+)) 408 ;; Convert an :FBOUNDP in CLASSIFICATIONS to :FUNCTION if possible. 409 ((and (member :fboundp classifications) 410 (not (member :macro classifications)) 411 (not (member :special-operator classifications))) 412 (substitute :function :fboundp classifications)) 413 (t (remove :fboundp classifications))))) 413 414 (loop for symbol in symbols do 414 (loop for classification in ( maybe-convert-fboundps (classify-symbol symbol))415 (loop for classification in (normalize-classifications (classify-symbol symbol)) 415 416 ;; SYMBOLS are supposed to be sorted alphabetically; 416 417 ;; this property is preserved here except for reversing. 417 418 do (push symbol (gethash classification table))))) 418 419 (let* ((classifications (loop for k being each hash-key in table collect k)) 419 (classifications (sort classifications #'string<))) 420 (classifications (sort classifications 421 ;; Sort alphabetically, except +DEFAULT-CLASSIFICATION+ 422 ;; which sort to the end. 423 #'(lambda (a b) 424 (cond ((eql a +default-classification+) nil) 425 ((eql b +default-classification+) t) 426 (t (string< a b))))))) 420 427 (loop for classification in classifications 421 428 for symbols = (gethash classification table) trunk/thirdparty/slime/contrib/swank-fuzzy.lisp
r2410 r2735 31 31 object is: 32 32 33 (COMPLETED-STRING SCORE (&rest CHUNKS) FLAGS)33 (COMPLETED-STRING SCORE (&rest CHUNKS) CLASSIFICATION-STRING) 34 34 35 35 where a CHUNK is a description of a matched substring: … … 37 37 (OFFSET SUBSTRING) 38 38 39 and FLAGS is a list of keywords describing properties of the40 symbol (see CLASSIFY-SYMBOL).39 and FLAGS is short string describing properties of the symbol (see 40 CLASSIFY-SYMBOL and STRING-CLASSIFICATION->STRING). 41 41 42 42 E.g., completing \"mvb\" in a package that uses COMMON-LISP would … … 132 132 133 133 (defun fuzzy-convert-matching-for-emacs (fuzzy-matching user-input-string) 134 "Converts a result from the fuzzy completion core into 135 something that emacs is expecting. Converts symbols to strings, 136 fixes case issues, and adds information describing if the symbol 137 is :bound, :fbound, a :class, a :macro, a :generic-function, 138 a :special-operator, or a :package."134 "Converts a result from the fuzzy completion core into something 135 that emacs is expecting. Converts symbols to strings, fixes case 136 issues, and adds information (as a string) describing if the symbol is 137 bound, fbound, a class, a macro, a generic-function, a 138 special-operator, or a package." 139 139 (with-struct (fuzzy-matching. symbol score package-chunks symbol-chunks) fuzzy-matching 140 140 (multiple-value-bind (name added-length) … … 149 149 (list (+ added-length offset) string))) 150 150 symbol-chunks)) 151 ( classify-symbol symbol)))))151 (symbol-classification->string (classify-symbol symbol)))))) 152 152 153 153 (defun fuzzy-completion-set (string default-package-name &key limit time-limit-in-msec) trunk/thirdparty/slime/slime.el
r2731 r2735 6268 6268 (erase-buffer) 6269 6269 (insert expansion) 6270 (goto-char (point-min)) 6271 (indent-sexp) 6270 6272 (font-lock-fontify-buffer)))))) 6271 6273 trunk/thirdparty/slime/swank.lisp
r2721 r2735 501 501 502 502 (defun classify-symbol (symbol) 503 "Returns a list of classifiers that classify SYMBOL according 504 to its underneath objects (e.g. :BOUNDP if SYMBOL constitutes a 505 specialvariable.) The list may contain the following classification506 keywords: :BOUNDP, :FBOUNDP, : GENERIC-FUNCTION, :CLASS, :MACRO,507 : SPECIAL-OPERATOR, and/or :PACKAGE"503 "Returns a list of classifiers that classify SYMBOL according to its 504 underneath objects (e.g. :BOUNDP if SYMBOL constitutes a special 505 variable.) The list may contain the following classification 506 keywords: :BOUNDP, :FBOUNDP, :CONSTANT, :GENERIC-FUNCTION, 507 :TYPESPEC, :CLASS, :MACRO, :SPECIAL-OPERATOR, and/or :PACKAGE" 508 508 (check-type symbol symbol) 509 (let (result) 510 (when (boundp symbol) (push :boundp result)) 511 (when (fboundp symbol) (push :fboundp result)) 512 (when (find-class symbol nil) (push :class result)) 513 (when (macro-function symbol) (push :macro result)) 514 (when (special-operator-p symbol) (push :special-operator result)) 515 (when (find-package symbol) (push :package result)) 516 (when (typep (ignore-errors (fdefinition symbol)) 517 'generic-function) 518 (push :generic-function result)) 519 result)) 509 (flet ((type-specifier-p (s) 510 (or (documentation s 'type) 511 (not (eq (type-specifier-arglist s) :not-available))))) 512 (let (result) 513 (when (boundp symbol) (push (if (constantp symbol) 514 :constant :boundp) result)) 515 (when (fboundp symbol) (push :fboundp result)) 516 (when (type-specifier-p symbol) (push :typespec result)) 517 (when (find-class symbol nil) (push :class result)) 518 (when (macro-function symbol) (push :macro result)) 519 (when (special-operator-p symbol) (push :special-operator result)) 520 (when (find-package symbol) (push :package result)) 521 (when (typep (ignore-errors (fdefinition symbol)) 522 'generic-function) 523 (push :generic-function result)) 524 525 result))) 520 526 521 527 (defun symbol-classification->string (flags) 522 (format nil "~A~A~A~A~A~A~A" 523 (if (member :boundp flags) "b" "-") 528 (format nil "~A~A~A~A~A~A~A~A" 529 (if (or (member :boundp flags) 530 (member :constant flags)) "b" "-") 524 531 (if (member :fboundp flags) "f" "-") 525 532 (if (member :generic-function flags) "g" "-") 526 533 (if (member :class flags) "c" "-") 534 (if (member :typespec flags) "t" "-") 527 535 (if (member :macro flags) "m" "-") 528 536 (if (member :special-operator flags) "s" "-")
