/[slime]/slime/swank.lisp
ViewVC logotype

Diff of /slime/swank.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.165 by pseibel, Wed Apr 7 16:24:03 2004 UTC revision 1.166 by mbaringer, Thu Apr 8 15:26:44 2004 UTC
# Line 1755  that symbols accessible in the current p Line 1755  that symbols accessible in the current p
1755  (defslimefun load-file (filename)  (defslimefun load-file (filename)
1756    (to-string (load filename)))    (to-string (load filename)))
1757    
1758    (defun requires-compile-p (pathname)
1759      (let ((compile-file-truename (probe-file (compile-file-pathname pathname))))
1760        (or (not compile-file-truename)
1761            (< (file-write-date compile-file-truename)
1762               (file-write-date pathname)))))
1763    
1764    
1765  ;;;; Profiling  ;;;; Profiling
1766    
# Line 2011  a time.") Line 2017  a time.")
2017                          (with-connection (connection)                          (with-connection (connection)
2018                            (simple-break))))))                            (simple-break))))))
2019    
 ;;;; REPL Commands  
   
 (defvar *repl-commands* (make-hash-table :test 'equal))  
   
 (defmacro defslime-repl-command (name args &body body)  
   `(progn  
      (setf (gethash ,(symbol-name name) *repl-commands*)  
            (lambda ,args ,@body))  
      ',name))  
   
 (defmacro repl-command (op &rest args)  
   `(if (gethash ,(symbol-name op) *repl-commands*)  
        (funcall (gethash ,(symbol-name op) *repl-commands*)  ,@args)  
        (error "Unknown repl command ~S." ,(symbol-name op))))  
   
 (defslime-repl-command sayoonara ()  
   (eval-in-emacs '(slime-kill-all-buffers))  
   (swank-backend:quit-lisp))  
   
 (defslime-repl-command cd (namestring)  
   (set-default-directory namestring))  
   
 (defslime-repl-command pwd ()  
   (truename *default-pathname-defaults*))  
   
 (defslime-repl-command pack (&optional new-package)  
   (setf *package* (if new-package  
                       (or (find-package new-package)  
                           (progn  
                             (warn "No package named ~S found." new-package)  
                             *package*))  
                       *package*)))  
   
 (defslime-repl-command cload (file &optional force)  
   (unless (probe-file (merge-pathnames file))  
     (error "~S does not exist, can't load it." file))  
   (if (or force  
           (not (probe-file (compile-file-pathname file)))  
           (< (file-write-date (compile-file-pathname file))  
              (file-write-date file)))  
       (compile-file-for-emacs file t)  
       (load file)))  
   
2020  ;;; Local Variables:  ;;; Local Variables:
2021  ;;; eval: (font-lock-add-keywords 'lisp-mode '(("(\\(defslimefun\\)\\s +\\(\\(\\w\\|\\s_\\)+\\)"  (1 font-lock-keyword-face) (2 font-lock-function-name-face))))  ;;; eval: (font-lock-add-keywords 'lisp-mode '(("(\\(defslimefun\\)\\s +\\(\\(\\w\\|\\s_\\)+\\)"  (1 font-lock-keyword-face) (2 font-lock-function-name-face))))
2022  ;;; End:  ;;; End:

Legend:
Removed from v.1.165  
changed lines
  Added in v.1.166

  ViewVC Help
Powered by ViewVC 1.1.5