home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / oobr / smt-browse.el < prev    next >
Encoding:
Text File  |  1995-04-28  |  3.4 KB  |  103 lines

  1. ;;!emacs
  2. ;;
  3. ;; FILE:         smt-browse.el
  4. ;; SUMMARY:      Smalltalk source code browser.
  5. ;; USAGE:        GNU Emacs Lisp Library
  6. ;; KEYWORDS:     oop, tools
  7. ;;
  8. ;; AUTHOR:       Bob Weiner
  9. ;; ORG:          Motorola Inc.
  10. ;;
  11. ;; ORIG-DATE:    26-Jul-90
  12. ;; LAST-MOD:     26-Apr-95 at 09:50:25 by Bob Weiner
  13. ;;
  14. ;; Copyright (C) 1990-1995  Free Software Foundation, Inc.
  15. ;; See the file BR-COPY for license information.
  16. ;;
  17. ;; This file is part of the OO-Browser.
  18. ;;
  19. ;; DESCRIPTION:  
  20. ;;
  21. ;;    Use 'smt-browse' to invoke the Smalltalk OO-Browser.  Prefix arg
  22. ;;    prompts for name of Environment file.
  23. ;;
  24. ;; DESCRIP-END.
  25.  
  26. ;;; ************************************************************************
  27. ;;; Other required Elisp libraries
  28. ;;; ************************************************************************
  29.  
  30. (mapcar 'require '(br-start br br-smt))
  31.  
  32. ;;; ************************************************************************
  33. ;;; Public functions
  34. ;;; ************************************************************************
  35.  
  36. ;;;###autoload
  37. (defun smt-browse (&optional env-file no-ui)
  38.   "Invoke the Smalltalk OO-Browser.
  39. This allows browsing through Smalltalk library and system class hierarchies.
  40. With an optional non-nil prefix argument ENV-FILE, prompt for Environment
  41. file to use.  Alternatively, a string value of ENV-FILE is used as the
  42. Environment file name.  See also the file \"br-help\"."
  43.   (interactive "P")
  44.   (let ((same-lang (equal br-lang-prefix smt-lang-prefix)))
  45.     (if same-lang
  46.     nil
  47.       (if br-lang-prefix
  48.       (br-env-copy nil)) ;; Save other language Environment in memory
  49.       (setq br-lang-prefix smt-lang-prefix
  50.         *br-save-wconfig* nil))
  51.     (let ((same-env (or (equal smt-env-file env-file)
  52.             (and (null env-file)
  53.                  (or smt-lib-search-dirs smt-sys-search-dirs)))))
  54.       (cond
  55.       ;; Continue browsing an Environment
  56.     ((and same-env same-lang))
  57.     ((and same-env (not same-lang))
  58.      (progn (smt-browse-setup) (br-env-copy t)))
  59.     ;;
  60.     ;; Create default Environment file specification if needed and none
  61.     ;; exists.
  62.     ;;
  63.     (t (progn (or env-file (file-exists-p smt-env-file)
  64.               (br-env-create smt-env-file smt-lang-prefix))
  65.           (or env-file (setq env-file smt-env-file))
  66.           ;;
  67.           ;; Start browsing a new Environment.
  68.           ;;
  69.           (smt-browse-setup)
  70.           (setq *br-save-wconfig* nil
  71.             smt-env-file (br-env-init env-file same-lang nil)
  72.             smt-sys-search-dirs br-sys-search-dirs
  73.             smt-lib-search-dirs br-lib-search-dirs))))))
  74.   (br-init)
  75.   (or no-ui (br-browse)))
  76.  
  77. ;; Don't filter Environment classes when listed.
  78. (fset 'smt-class-list-filter 'identity)
  79.  
  80. (defun smt-class-definition-regexp (class)
  81.   "Return regexp to uniquely match the definition of CLASS name."
  82.   (concat smt-class-name-before (regexp-quote class)
  83.       smt-class-name-after))
  84.  
  85. ;;; ************************************************************************
  86. ;;; Internal functions
  87. ;;; ************************************************************************
  88.  
  89. (defun smt-browse-setup ()
  90.   "Setup language-dependent functions for OO-Browser."
  91.   (br-setup-functions)
  92.   ;; Use this until an info function is implemented for the language.
  93.   (fmakunbound 'br-insert-class-info)
  94.   (fset 'br-store-class-info 'smt-store-class-info)
  95.   (fset 'br-lang-mode
  96.     (cond ((featurep 'smalltalk-mode) 'smalltalk-mode)
  97.           ((load "st" 'missing-ok 'nomessage)
  98.            (provide 'smalltalk-mode))
  99.           (t 'fundamental-mode)))
  100.   (br-setup-constants))
  101.  
  102. (provide 'smt-browse)
  103.