Changeset 7541


Ignore:
Timestamp:
Oct 29, 2007, 12:36:47 AM (12 years ago)
Author:
gz
Message:

Make meta-. more forgiving: if symbol not found in current package, look in other packages

Location:
trunk/ccl/cocoa-ide
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/cocoa-ide/cocoa-editor.lisp

    r7535 r7541  
    28112811(defun hi::edit-definition (name)
    28122812  (let* ((info (get-source-files-with-types&classes name)))
     2813    (when (null info)
     2814      (let* ((seen (list name))
     2815             (found ())
     2816             (pname (symbol-name name)))
     2817        (dolist (pkg (list-all-packages))
     2818          (let ((sym (find-symbol pname pkg)))
     2819            (when (and sym (not (member sym seen)))
     2820              (let ((new (get-source-files-with-types&classes sym)))
     2821                (when new
     2822                  (setq info (append new info))
     2823                  (push sym found)))
     2824              (push sym seen))))
     2825        (when found
     2826          ;; Unfortunately, this puts the message in the wrong buffer (would be better in the destination buffer).
     2827          (hi::loud-message "No definitions for ~s, using ~s instead"
     2828                            name (if (cdr found) found (car found))))))
    28132829    (if info
    28142830      (if (cdr info)
    28152831        (edit-definition-list name info)
    2816         (edit-single-definition name (car info))))))
     2832        (edit-single-definition name (car info)))
     2833      (hi::editor-error "No known definitions for ~s" name))))
    28172834
    28182835
  • trunk/ccl/cocoa-ide/hemlock/src/edit-defs.lisp

    r7129 r7541  
    7171        (if fun-name
    7272            (get-def-info-and-go-to-it fun-name (or
    73                                                  (find-package
    74                                                   (variable-value 'current-package :buffer (current-buffer)))
     73                                                 (buffer-package (current-buffer))
    7574                                                 *package*))
    7675            (beep)))))
Note: See TracChangeset for help on using the changeset viewer.