home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / interfaces / Emacs-cl-shell / cl-flavors.el < prev    next >
Encoding:
Text File  |  1990-03-07  |  2.9 KB  |  66 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;; FILE:          cl-flavors.el
  3. ;;; DESCRIPTION:   Extensions to cl-shell.el for FLAVORS
  4. ;;; AUTHOR:        Eero Simoncelli, 
  5. ;;;                Vision Science Group, 
  6. ;;;                MIT Media Laboratory.
  7. ;;; CREATED:       December, 1989
  8. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  9.  
  10. ;; GNU Emacs is distributed in the hope that it will be useful,
  11. ;; but WITHOUT ANY WARRANTY.  No author or distributor
  12. ;; accepts responsibility to anyone for the consequences of using it
  13. ;; or for whether it serves any particular purpose or works at all,
  14. ;; unless he says so in writing.  Refer to the GNU Emacs General Public
  15. ;; License for full details.
  16.  
  17. ;; Everyone is granted permission to copy, modify and redistribute
  18. ;; GNU Emacs, but only under the conditions described in the
  19. ;; GNU Emacs General Public License.   A copy of this license is
  20. ;; supposed to have been given to you along with GNU Emacs so you
  21. ;; can know your rights and responsibilities.  It should be in a
  22. ;; file named COPYING.  Among other things, the copyright notice
  23. ;; and this notice must be preserved on all copies.
  24.  
  25. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  26.  
  27. ;;; This file contains additional hacks for use with code in
  28. ;;; cl-shell.el when using FLavors.  It is loaded automatically by
  29. ;;; run-cl if :FLAVORS is on the *features* list in the CL world.
  30.  
  31. (require 'cl-shell)
  32.  
  33. ;;; Add some more special forms to the indentation list.  See
  34. ;;; cl-indent.el for more confusion.  Basically, the number refers to
  35. ;;; the number of "special" - i.e. non-body forms passed as arguments
  36. ;;; to these things.  *** Many more forms should be added here...
  37. (put 'defmethod  'common-lisp-indent-hook 'defun)
  38. (put 'defflavor   'common-lisp-indent-hook 'defun)
  39.  
  40. ;;;; ---------- Source file recording enhancements for Lucid ---------
  41.  
  42. ;;; These are helpful if the file source-file-extensions.lisp is
  43. ;;; loaded into lisp.  Nothing breaks if this is not true.
  44. ;;; *** need to do pushnew here.
  45. (if (featurep 'cl-lucid)        ;if Lucid CL
  46.     (setq *cl-definition-regexp-alist*
  47.       (append *cl-definition-regexp-alist*
  48.           '((:FLAVOR . "(defflavor[ \t\n]*%s")
  49.             (:METHOD . cl-make-flavor-method-regexp)))))
  50.  
  51. ;;; Type-spec defined in source-file-extensions.lisp is
  52. ;;; '(:method <flavor> <type>).  We try to handle the old Symbolics
  53. ;;; syntax as well as the newer one.
  54. (if (featurep 'cl-lucid)
  55.     (defun cl-make-flavor-method-regexp (method type-spec)
  56.       (let ((flavor (cl-strip-package (cadr type-spec)))
  57.         (type (cl-strip-package (caddr type-spec))))
  58.     (concat "(defmethod[ \t\n]*([ \t\n]*" ;"(defmethod ("
  59.         "\\("            ;either
  60.         (format "%s[ \t\n]*\\(%s\\|%s[ \t\n]*%s\\)" ;old syntax
  61.             flavor method type method)
  62.         "\\|"            ;or
  63.         (format "%s[ \t\n]*\\(%s\\|%s[ \t\n]*%s\\)" ;new syntax
  64.             method flavor flavor type)
  65.         "\\)"))))
  66.