Index: slime.el =================================================================== RCS file: /project/slime/cvsroot/slime/slime.el,v retrieving revision 1.37 diff -u -r1.37 slime.el --- slime.el 17 Oct 2003 01:38:01 -0000 1.37 +++ slime.el 17 Oct 2003 17:28:38 -0000 @@ -76,7 +76,7 @@ "Number of times to try connecting to the Swank server before aborting. Nil means never give up.") -(defvar slime-lisp-binary-extension ".x86f" +(defvar slime-lisp-binary-extension ".fasl" "Filename extension for Lisp object files.") (defvar slime-backend "swank" @@ -125,12 +125,21 @@ "Face for warnings from the compiler." :group 'slime) -(defface slime-note-face +(defface slime-style-warning-face '((((class color) (background light)) (:underline "brown")) (((class color) (background dark)) (:underline "gold")) (t (:underline t))) + "Face for style-warnings from the compiler." + :group 'slime) + +(defface slime-note-face + '((((class color) (background light)) + (:underline "brown4")) + (((class color) (background dark)) + (:underline "light goldenrod")) + (t (:underline t))) "Face for notes from the compiler." :group 'slime) @@ -522,7 +531,7 @@ (when (or (and (not (file-exists-p binary)) (or slime-dont-prompt (y-or-n-p "\ -The CMUCL support library (Swank) is not compiled. Compile now? "))) +The SLIME support library (Swank) is not compiled. Compile now? "))) (and (file-newer-than-file-p source binary) (or slime-dont-prompt (y-or-n-p "\ @@ -1014,16 +1023,24 @@ (slime-buffer-package) (slime-compilation-finished-continuation))) +(defun slime-note-count-string (severity count) + (format "%s %s%s" count severity (if (= count 1) "" "s"))) + (defun slime-show-note-counts (notes &optional secs) (loop for note in notes for severity = (plist-get note :severity) count (eq :error severity) into errors count (eq :warning severity) into warnings + count (eq :style-warning severity) into style-warnings count (eq :note severity) into notes finally (message - "Compilation finished: %s errors %s warnings %s notes%s" - errors warnings notes (if secs (format " [%s secs]" secs) "")))) + "Compilation finished: %s %s %s %s%s" + (slime-note-count-string "error" errors) + (slime-note-count-string "warning" warnings) + (slime-note-count-string "style-warning" style-warnings) + (slime-note-count-string "note" notes) + (if secs (format " [%s secs]" secs) "")))) (defun slime-compilation-finished (result buffer) (with-current-buffer buffer @@ -1079,7 +1096,7 @@ "Create an overlay representing a compiler note. The overlay has several properties: FACE - to underline the relevant text. - SEVERITY - for future reference, :NOTE, :WARNING, or :ERROR. + SEVERITY - for future reference, :NOTE, :STYLE-WARNING, :WARNING, or :ERROR. MOUSE-FACE - highlight the note when the mouse passes over. HELP-ECHO - a string describing the note, both for future reference and for display as a tooltip (due to the special @@ -1138,16 +1155,19 @@ (defun slime-severity-face (severity) "Return the name of the font-lock face representing SEVERITY." (ecase severity - (:error 'slime-error-face) - (:warning 'slime-warning-face) - (:note 'slime-note-face))) + (:error 'slime-error-face) + (:warning 'slime-warning-face) + (:style-warning 'slime-style-warning-face) + (:note 'slime-note-face))) (defun slime-most-severe (sev1 sev2) "Return the most servere of two conditions. -Severity is ordered as :NOTE < :WARNING < :ERROR." +Severity is ordered as :NOTE < :STYLE-WARNING < :WARNING < :ERROR." (if (or (eq sev1 :error) ; Well, not exactly Smullyan.. (and (eq sev1 :warning) - (not (eq sev2 :error)))) + (not (eq sev2 :error))) + (and (eq sev1 :style-warning) + (not (member sev2 '(:warning :error))))) sev1 sev2)) Index: swank-sbcl.lisp =================================================================== RCS file: /project/slime/cvsroot/slime/swank-sbcl.lisp,v retrieving revision 1.6 diff -u -r1.6 swank-sbcl.lisp --- swank-sbcl.lisp 17 Oct 2003 01:38:41 -0000 1.6 +++ swank-sbcl.lisp 17 Oct 2003 17:28:38 -0000 @@ -40,7 +40,8 @@ (eval-when (:compile-toplevel :load-toplevel :execute) (require 'sb-bsd-sockets) (use-package "SB-BSD-SOCKETS") - #+nil (require 'sb-introspect) + (require 'sb-introspect) + #+nil (load "/home/dan/src/sourceforge/sbcl/contrib/sb-introspect/sb-introspect")) @@ -257,7 +258,8 @@ :source-path (current-compiler-error-source-path context) :severity (etypecase condition (sb-c:compiler-error :error) - (style-warning :note) + (sb-ext:compiler-note :note) + (style-warning :style-warning) (warning :warning)) :message (brief-compiler-message-for-emacs condition context) :buffername (if (boundp '*buffername*) *buffername*) @@ -293,6 +295,7 @@ (defun call-trapping-compilation-notes (fn) (handler-bind ((sb-c:compiler-error #'handle-notification-condition) + (sb-ext:compiler-note #'handle-notification-condition) (style-warning #'handle-notification-condition) (warning #'handle-notification-condition)) (funcall fn))) Index: swank.lisp =================================================================== RCS file: /project/slime/cvsroot/slime/swank.lisp,v retrieving revision 1.35 diff -u -r1.35 swank.lisp --- swank.lisp 17 Oct 2003 02:08:50 -0000 1.35 +++ swank.lisp 17 Oct 2003 17:28:38 -0000 @@ -191,7 +191,7 @@ "Database of recorded compiler notes/warnings/erros (keyed by filename). Each value is a list of (LOCATION SEVERITY MESSAGE CONTEXT) lists. LOCATION is a position in the source code (integer or source path). - SEVERITY is one of :ERROR, :WARNING, and :NOTE. + SEVERITY is one of :ERROR, :WARNING, :STYLE-WARNING and :NOTE. MESSAGE is a string describing the note. CONTEXT is a string giving further details of where the error occured.")