Skip to content

Commit

Permalink
* contrib/swank-asdf.lisp (asdf:operation-done-p): ASDF included with…
Browse files Browse the repository at this point in the history
… some

implementations doesn't have AROUND method combination, so guard
against its usage. This will prevent swank:reload-system from working,
but it will let load swank-asdf.
Reported by Mark Evenson.

* swank-backend.lisp (defpackage): export with-symbol and
replace its fully qualified usage everywhere.
  • Loading branch information
stassats committed Dec 19, 2009
1 parent 26c892b commit 5e6f6b1
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 31 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2009-12-19 Stas Boukarev <stassats@gmail.com>

* swank-backend.lisp (defpackage): export with-symbol and
replace its fully qualified usage everywhere.

2009-12-17 Tobias C. Rittweiler <tcr@freebits.de>

* slime.el (slime-edit-uses-xrefs): New variable. For contribs to
Expand Down
8 changes: 8 additions & 0 deletions contrib/ChangeLog
@@ -1,3 +1,11 @@
2009-12-19 Stas Boukarev <stassats@gmail.com>

* swank-asdf.lisp (asdf:operation-done-p): ASDF included with some
implementations doesn't have AROUND method combination, so guard
against its usage. This will prevent swank:reload-system from working,
but it will let load swank-asdf.
Reported by Mark Evenson.

2009-12-19 Tobias C. Rittweiler <tcr@freebits.de>

* slime-asdf.el (slime-query-replace-system-and-dependents):
Expand Down
1 change: 1 addition & 0 deletions contrib/swank-asdf.lisp
Expand Up @@ -187,6 +187,7 @@ already knows."

(defvar *recompile-system* nil)

#+#.(swank-backend:with-symbol 'around 'asdf)
(defmethod asdf:operation-done-p asdf:around ((operation asdf:compile-op)
component)
(unless (eql *recompile-system*
Expand Down
25 changes: 12 additions & 13 deletions swank-abcl.lisp
Expand Up @@ -17,15 +17,14 @@
;;; The introduction of SYS::*INVOKE-DEBUGGER-HOOK* obliterates the
;;; need for redefining BREAK. The following should thus be removed at
;;; some point in the future.
#-#.(swank-backend::with-symbol '*invoke-debugger-hook* 'sys)
#-#.(swank-backend:with-symbol '*invoke-debugger-hook* 'sys)
(defun sys::break (&optional (format-control "BREAK called")
&rest format-arguments)
(let ((sys::*saved-backtrace*
#+#.(swank-backend::with-symbol 'backtrace 'sys)
#+#.(swank-backend:with-symbol 'backtrace 'sys)
(sys:backtrace)
#-#.(swank-backend::with-symbol 'backtrace 'sys)
(ext:backtrace-as-list)
))
#-#.(swank-backend:with-symbol 'backtrace 'sys)
(ext:backtrace-as-list)))
(with-simple-restart (continue "Return from BREAK.")
(invoke-debugger
(sys::%make-condition 'simple-condition
Expand Down Expand Up @@ -300,25 +299,25 @@

(defimplementation call-with-debugger-hook (hook fun)
(let ((*debugger-hook* hook)
#+#.(swank-backend::with-symbol '*invoke-debugger-hook* 'sys)
#+#.(swank-backend:with-symbol '*invoke-debugger-hook* 'sys)
(sys::*invoke-debugger-hook* (make-invoke-debugger-hook hook)))
(funcall fun)))

(defimplementation install-debugger-globally (function)
(setq *debugger-hook* function)
#+#.(swank-backend::with-symbol '*invoke-debugger-hook* 'sys)
#+#.(swank-backend:with-symbol '*invoke-debugger-hook* 'sys)
(setq sys::*invoke-debugger-hook* (make-invoke-debugger-hook function)))

(defvar *sldb-topframe*)

(defimplementation call-with-debugging-environment (debugger-loop-fn)
(let* ((magic-token (intern "SWANK-DEBUGGER-HOOK" 'swank))
(*sldb-topframe*
#+#.(swank-backend::with-symbol 'backtrace 'sys)
#+#.(swank-backend:with-symbol 'backtrace 'sys)
(second (member magic-token (sys:backtrace)
:key #'(lambda (frame)
(first (sys:frame-to-list frame)))))
#-#.(swank-backend::with-symbol 'backtrace 'sys)
#-#.(swank-backend:with-symbol 'backtrace 'sys)
(second (member magic-token (ext:backtrace-as-list)
:key #'(lambda (frame)
(first frame))))
Expand All @@ -328,9 +327,9 @@
(defun backtrace (start end)
"A backtrace without initial SWANK frames."
(let ((backtrace
#+#.(swank-backend::with-symbol 'backtrace 'sys)
#+#.(swank-backend:with-symbol 'backtrace 'sys)
(sys:backtrace)
#-#.(swank-backend::with-symbol 'backtrace 'sys)
#-#.(swank-backend:with-symbol 'backtrace 'sys)
(ext:backtrace-as-list)
))
(subseq (or (member *sldb-topframe* backtrace) backtrace)
Expand All @@ -345,9 +344,9 @@

(defimplementation print-frame (frame stream)
(write-string
#+#.(swank-backend::with-symbol 'backtrace 'sys)
#+#.(swank-backend:with-symbol 'backtrace 'sys)
(sys:frame-to-string frame)
#-#.(swank-backend::with-symbol 'backtrace 'sys)
#-#.(swank-backend:with-symbol 'backtrace 'sys)
(string-trim '(#\space #\newline) (prin1-to-string frame))
stream))

Expand Down
2 changes: 1 addition & 1 deletion swank-backend.lisp
Expand Up @@ -42,7 +42,7 @@
#:emacs-inspect
#:label-value-line
#:label-value-line*
))
#:with-symbol))

(defpackage :swank-mop
(:use)
Expand Down
12 changes: 6 additions & 6 deletions swank-ecl.lisp
Expand Up @@ -305,13 +305,13 @@
(declare (ignore position))
(if file (is-swank-source-p file)))))

#+#.(swank-backend::with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
#+#.(swank-backend:with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
(defmacro find-ihs-top (x)
(if (< ext:+ecl-version-number+ 90601)
`(si::ihs-top ,x)
'(si::ihs-top)))

#-#.(swank-backend::with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
#-#.(swank-backend:with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
(defmacro find-ihs-top (x)
`(si::ihs-top ,x))

Expand Down Expand Up @@ -379,11 +379,11 @@
(let ((functions '())
(blocks '())
(variables '()))
#+#.(swank-backend::with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
#+#.(swank-backend:with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
#.(if (< ext:+ecl-version-number+ 90601)
'(setf frame (second frame))
'(setf frame (si::decode-ihs-env (second frame))))
#-#.(swank-backend::with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
#-#.(swank-backend:with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
'(setf frame (second frame))
(dolist (record frame)
(let* ((record0 (car record))
Expand Down Expand Up @@ -493,11 +493,11 @@
`(:snippet
,(with-open-file (s file)

#+#.(swank-backend::with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
#+#.(swank-backend:with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
(if (< ext:+ecl-version-number+ 90601)
(skip-toplevel-forms pos s)
(file-position s pos))
#-#.(swank-backend::with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
#-#.(swank-backend:with-symbol '+ECL-VERSION-NUMBER+ 'EXT)
(skip-toplevel-forms pos s)
(skip-comments-and-whitespace s)
(read-snippet s))))))))
Expand Down
22 changes: 11 additions & 11 deletions swank-sbcl.lisp
Expand Up @@ -372,11 +372,11 @@

;;; Utilities

#+#.(swank-backend::with-symbol 'function-lambda-list 'sb-introspect)
#+#.(swank-backend:with-symbol 'function-lambda-list 'sb-introspect)
(defimplementation arglist (fname)
(sb-introspect:function-lambda-list fname))

#-#.(swank-backend::with-symbol 'function-lambda-list 'sb-introspect)
#-#.(swank-backend:with-symbol 'function-lambda-list 'sb-introspect)
(defimplementation arglist (fname)
(sb-introspect:function-arglist fname))

Expand All @@ -396,7 +396,7 @@
flags :key #'ensure-list))
(call-next-method)))))

#+#.(swank-backend::with-symbol 'deftype-lambda-list 'sb-introspect)
#+#.(swank-backend:with-symbol 'deftype-lambda-list 'sb-introspect)
(defmethod type-specifier-arglist :around (typespec-operator)
(multiple-value-bind (arglist foundp)
(sb-introspect:deftype-lambda-list typespec-operator)
Expand Down Expand Up @@ -434,7 +434,7 @@ information."
(sb-ext:compiler-note :note)
(error :error)
(reader-error :read-error)
#+#.(swank-backend::with-symbol redefinition-warning sb-kernel)
#+#.(swank-backend:with-symbol redefinition-warning sb-kernel)
(sb-kernel:redefinition-warning
:redefinition)
(style-warning :style-warning)
Expand Down Expand Up @@ -594,13 +594,13 @@ compiler state."

(defun get-compiler-policy (default-policy)
(declare (ignorable default-policy))
#+#.(swank-backend::with-symbol 'restrict-compiler-policy 'sb-ext)
#+#.(swank-backend:with-symbol 'restrict-compiler-policy 'sb-ext)
(remove-duplicates (append default-policy (sb-ext:restrict-compiler-policy))
:key #'car))

(defun set-compiler-policy (policy)
(declare (ignorable policy))
#+#.(swank-backend::with-symbol 'restrict-compiler-policy 'sb-ext)
#+#.(swank-backend:with-symbol 'restrict-compiler-policy 'sb-ext)
(loop for (qual . value) in policy
do (sb-ext:restrict-compiler-policy qual value)))

Expand Down Expand Up @@ -847,7 +847,7 @@ Return NIL if the symbol is unbound."
(defxref who-sets)
(defxref who-references)
(defxref who-macroexpands)
#+#.(swank-backend::with-symbol 'who-specializes-directly 'sb-introspect)
#+#.(swank-backend:with-symbol 'who-specializes-directly 'sb-introspect)
(defxref who-specializes who-specializes-directly))

(defun source-location-for-xref-data (xref-data)
Expand Down Expand Up @@ -1027,11 +1027,11 @@ stack."
(plist (sb-c::debug-source-plist dsource)))
(if (getf plist :emacs-buffer)
(emacs-buffer-source-location code-location plist)
#+#.(swank-backend::with-symbol 'debug-source-from 'sb-di)
#+#.(swank-backend:with-symbol 'debug-source-from 'sb-di)
(ecase (sb-di:debug-source-from dsource)
(:file (file-source-location code-location))
(:lisp (lisp-source-location code-location)))
#-#.(swank-backend::with-symbol 'debug-source-from 'sb-di)
#-#.(swank-backend:with-symbol 'debug-source-from 'sb-di)
(if (sb-di:debug-source-namestring dsource)
(file-source-location code-location)
(lisp-source-location code-location)))))
Expand Down Expand Up @@ -1087,10 +1087,10 @@ stack."
`(:snippet ,snippet)))))))

(defun code-location-debug-source-name (code-location)
(namestring (truename (#+#.(swank-backend::with-symbol
(namestring (truename (#+#.(swank-backend:with-symbol
'debug-source-name 'sb-di)
sb-c::debug-source-name
#-#.(swank-backend::with-symbol
#-#.(swank-backend:with-symbol
'debug-source-name 'sb-di)
sb-c::debug-source-namestring
(sb-di::code-location-debug-source code-location)))))
Expand Down

0 comments on commit 5e6f6b1

Please sign in to comment.