[slime-cvs] CVS slime

CVS User heller heller at common-lisp.net
Sun May 22 07:18:52 UTC 2011


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv19330

Modified Files:
	ChangeLog slime.el 
Log Message:
Turn on lexical-binding for slime.el.
This mostly involves prefixing unused variables
with underscores to shut up the compiler, but
also some less harmless changes.

* slime.el (slime-dispatching-connection, slime-current-thread):
Add defvars.
(slime-connect): called-interactively-p wants 1 arg in Emacs 24
but none in Emacs 22.  So we can't use it; instead add an extra
optional arg and set that to non-nil in the interactive spec.
(slime-read-from-minibuffer): Actually use the history arg.
(slime-inspector-quit): Drop the unused kill-buffer arg from the
lambda-list.
(slime-run-tests): Can't specbind slime-repl-history-file without
variable declation.  I don't want to declare it here so I just
eliminated it and let somebody else fix slime-repl.el.

--- /project/slime/cvsroot/slime/ChangeLog	2011/05/21 18:11:39	1.2190
+++ /project/slime/cvsroot/slime/ChangeLog	2011/05/22 07:18:52	1.2191
@@ -1,3 +1,22 @@
+2011-05-22  Helmut Eller  <heller at common-lisp.net>
+
+	Turn on lexical-binding for slime.el.
+	This mostly involves prefixing unused variables
+	with underscores to shut up the compiler, but
+	also some less harmless changes.
+
+	* slime.el (slime-dispatching-connection, slime-current-thread):
+	Add defvars.
+	(slime-connect): called-interactively-p wants 1 arg in Emacs 24
+	but none in Emacs 22.  So we can't use it; instead add an extra
+	optional arg and set that to non-nil in the interactive spec.
+	(slime-read-from-minibuffer): Actually use the history arg.
+	(slime-inspector-quit): Drop the unused kill-buffer arg from the
+	lambda-list.
+	(slime-run-tests): Can't specbind slime-repl-history-file without
+	variable declation.  I don't want to declare it here so I just
+	eliminated it and let somebody else fix slime-repl.el.
+
 2011-05-21  Helmut Eller  <heller at common-lisp.net>
 
 	Minor tweaks to avoid some compiler warnings.
--- /project/slime/cvsroot/slime/slime.el	2011/05/21 18:11:39	1.1365
+++ /project/slime/cvsroot/slime/slime.el	2011/05/22 07:18:52	1.1366
@@ -386,6 +386,8 @@
 
 (defvar slime-modeline-string)
 (defvar slime-buffer-connection)
+(defvar slime-dispatching-connection)
+(defvar slime-current-thread)
 
 (define-minor-mode slime-mode
   "\\<slime-mode-map>\
@@ -1188,7 +1190,7 @@
 (defun slime-start* (options)
   (apply #'slime-start options))
 
-(defun slime-connect (host port &optional coding-system)
+(defun slime-connect (host port &optional coding-system interactive-p)
   "Connect to a running Swank server. Return the connection."
   (interactive (list (read-from-minibuffer
                       "Host: " (first slime-connect-host-history)
@@ -1196,8 +1198,9 @@
                      (string-to-number
                       (read-from-minibuffer
                        "Port: " (first slime-connect-port-history)
-                       nil nil '(slime-connect-port-history . 1)))))
-  (when (and (called-interactively-p 'interactive)
+                       nil nil '(slime-connect-port-history . 1)))
+                     nil t))
+  (when (and interactive-p
              slime-net-processes
              (y-or-n-p "Close old connections first? "))
     (slime-disconnect-all))
@@ -1499,7 +1502,7 @@
   "Find the magic secret from the user's home directory.
 Return nil if the file doesn't exist or is empty; otherwise the
 first line of the file."
-  (condition-case err
+  (condition-case _err
       (with-temp-buffer
 	(insert-file-contents "~/.slime-secret")
 	(goto-char (point-min))
@@ -1928,8 +1931,7 @@
   (let ((slime-dispatching-connection connection)
         (slime-current-thread t))
     (destructuring-bind (&key pid style lisp-implementation machine
-                              features package version modules
-                              &allow-other-keys) info
+                              features version modules &allow-other-keys) info
       (slime-check-version version connection)
       (setf (slime-pid) pid
             (slime-communication-style) style
@@ -1941,7 +1943,7 @@
               (slime-lisp-implementation-name) name
               (slime-lisp-implementation-program) program
               (slime-connection-name) (slime-generate-connection-name name)))
-      (destructuring-bind (&key instance type version) machine
+      (destructuring-bind (&key instance ((:type _)) ((:version _))) machine
         (setf (slime-machine-instance) instance)))
     (let ((args (when-let (p (slime-inferior-process))
                   (slime-inferior-lisp-args p))))
@@ -2183,7 +2185,7 @@
             (error "Reply to canceled synchronous eval request tag=%S sexp=%S"
                    tag sexp))
           (throw tag (list #'identity value)))
-         ((:abort condition)
+         ((:abort _condition)
           (throw tag (list #'error "Synchronous Lisp Evaluation aborted"))))
        (let ((debug-on-quit t)
              (inhibit-quit nil)
@@ -2502,14 +2504,14 @@
   (assert (slime-inferior-process) () "No inferior lisp process")
   (slime-quit-lisp-internal (slime-connection) 'slime-restart-sentinel t))
 
-(defun slime-restart-sentinel (process message)
+(defun slime-restart-sentinel (process _message)
   "Restart the inferior lisp process.
 Also rearrange windows."
   (assert (process-status process) 'closed)
   (let* ((proc (slime-inferior-process process))
          (args (slime-inferior-lisp-args proc))
          (buffer (buffer-name (process-buffer proc)))
-         (buffer-window (get-buffer-window buffer))
+         ;;(buffer-window (get-buffer-window buffer))
          (new-proc (slime-start-lisp (plist-get args :program)
                                      (plist-get args :program-args)
                                      (plist-get args :env)
@@ -3051,7 +3053,7 @@
   (let ((location (slime-note.location note)))
     (when location 
       (destructure-case location
-        ((:error _) _ nil)                 ; do nothing
+        ((:error _) nil)                 ; do nothing
         ((:location file pos _hints)
          (cond ((eq (car file) ':source-form) nil)
                ((eq (slime-note.severity note) :read-error)
@@ -3402,7 +3404,7 @@
              | (:source-path <list> <start-position>) 
              | (:method <name string> <specializer strings> . <qualifiers strings>)"
   (destructure-case location
-    ((:location buffer position hints)
+    ((:location buffer _position _hints)
      (slime-goto-location-buffer buffer)
      (let ((pos (slime-location-offset location)))
        (cond ((and (<= (point-min) pos) (<= pos (point-max))))
@@ -3502,7 +3504,7 @@
       (goto-char here)
       (message "No previous note."))))
 
-(defun slime-goto-first-note (&rest ignore)
+(defun slime-goto-first-note (&rest _)
   "Go to the first note in the buffer."
   (let ((point (point)))
     (goto-char (point-min))
@@ -3793,7 +3795,7 @@
 reading input.  The result is a string (\"\" if no input was given)."
   (let ((minibuffer-setup-hook (slime-minibuffer-setup-hook)))
     (read-from-minibuffer prompt initial-value slime-minibuffer-map
-			  nil 'slime-minibuffer-history)))
+			  nil (or history 'slime-minibuffer-history))))
 
 (defun slime-bogus-completion-alist (list)
   "Make an alist out of list.
@@ -3920,7 +3922,7 @@
                   (format "%S" buffer) ; "#<buffer foo.lisp>"
                 (format "%s (previously existing buffer)" bufname))))
            ((:source-form _) "(S-Exp)")
-           ((:zip zip entry) entry)))
+           ((:zip _zip entry) entry)))
         (t
          "(No location)")))
 
@@ -4638,7 +4640,7 @@
 
 ;;;;; XREF results buffer and window management
 
-(defmacro* slime-with-xref-buffer ((xref-type symbol &optional package)
+(defmacro* slime-with-xref-buffer ((_xref-type _symbol &optional package)
                                    &body body)
   "Execute BODY in a xref buffer, then show that buffer."
   `(let ((xref-buffer-name% (slime-buffer-name :xref)))
@@ -4690,8 +4692,8 @@
   "The most recent XREF results buffer.
 This is used by `slime-goto-next-xref'")
 
-(defun slime-show-xref-buffer (xrefs type symbol package)
-  (slime-with-xref-buffer (type symbol package)
+(defun slime-show-xref-buffer (xrefs _type _symbol package)
+  (slime-with-xref-buffer (_type _symbol package)
     (slime-insert-xrefs xrefs)
     (setq slime-next-location-function 'slime-goto-next-xref)
     (setq slime-previous-location-function 'slime-goto-previous-xref)
@@ -4752,6 +4754,7 @@
   (interactive (list (slime-read-symbol-name "List callees: ")))
   (slime-xref :callees symbol-name))
 
+;; FIXME: whats the call (slime-postprocess-xrefs result) good for?
 (defun slime-xref (type symbol &optional continuation)
   "Make an XREF request to Lisp."
   (slime-eval-async
@@ -5144,7 +5147,7 @@
         (unless (memq (process-status process) '(exit signal))
           (kill-process process))))))
 
-(defun slime-quit-sentinel (process message)
+(defun slime-quit-sentinel (process _message)
   (assert (process-status process) 'closed)
   (let* ((inferior (slime-inferior-process process))
          (inferior-buffer (if inferior (process-buffer inferior))))
@@ -5418,7 +5421,7 @@
     ((:ok result)
      (apply #'sldb-setup thread level result))))
 
-(defun sldb-exit (thread level &optional stepping)
+(defun sldb-exit (thread _level &optional stepping)
   "Exit from the debug level LEVEL."
   (when-let (sldb (sldb-find-buffer thread))
     (with-current-buffer sldb
@@ -5546,7 +5549,7 @@
          (slime-add-face face string)))
       (insert "\n"))))
 
-(defun sldb-fetch-more-frames (&rest ignore)
+(defun sldb-fetch-more-frames (&rest _)
   "Fetch more backtrace frames.
 Called on the `point-entered' text-property hook."
   (let ((inhibit-point-motion-hooks t)
@@ -5719,7 +5722,7 @@
 (defun sldb-default-action/mouse (event)
   "Invoke the action pointed at by the mouse."
   (interactive "e")
-  (destructuring-bind (mouse-1 (w pos &rest _)) event
+  (destructuring-bind (_mouse-1 (_w pos &rest _)) event
     (save-excursion
       (goto-char pos)
       (let ((fn (get-text-property (point) 'sldb-default-action)))
@@ -5853,8 +5856,8 @@
             (funcall sldb-insert-frame-variable-value-function value frame i)
             (insert "\n")))))
 
-(defun sldb-insert-frame-variable-value (value frame index)
-  (insert (in-sldb-face local-value value)))  
+(defun sldb-insert-frame-variable-value (value _frame _index)
+  (insert (in-sldb-face local-value value)))
 
 (defun sldb-hide-frame-details ()
   ;; delete locals and catch tags, but keep the function name and args.
@@ -6607,7 +6610,7 @@
 	  (t (message "No next object")
 	     (ding)))))
   
-(defun slime-inspector-quit (&optional kill-buffer)
+(defun slime-inspector-quit ()
   "Quit the inspector and kill the buffer."
   (interactive)
   (slime-eval-async `(swank:quit-inspector))
@@ -6764,7 +6767,7 @@
             (t '(nil nil))))))
 
 (defun slime-inspector-join-chunks (chunk1 chunk2)
-  (destructuring-bind (i1 l1 s1 e1) chunk1
+  (destructuring-bind (i1 _l1 s1 e1) chunk1
     (destructuring-bind (i2 l2 s2 e2) chunk2
       (cond ((= e1 s2)
              (list (append i1 i2) l2 s1 e2))
@@ -6859,7 +6862,7 @@
   (ignore-errors (kill-buffer "*Select Help*"))
   (with-current-buffer (get-buffer-create "*Select Help*")
     (insert "Select Methods:\n\n")
-    (loop for (key line function) in slime-selector-methods
+    (loop for (key line _function) in slime-selector-methods
           do (insert (format "%c:\t%s\n" key line)))
     (goto-char (point-min))
     (help-mode)
@@ -6990,7 +6993,7 @@
   authors
   license)
 
-(defmacro define-slime-contrib (name docstring &rest clauses)
+(defmacro define-slime-contrib (name _docstring &rest clauses)
   (destructuring-bind (&key slime-dependencies
                             swank-dependencies
                             on-load 
@@ -7024,7 +7027,7 @@
 (put 'slime-indulge-pretty-colors 'define-slime-contrib t)
 
 (defun slime-all-contribs ()
-  (loop for (name val) on (symbol-plist 'slime-contribs) by #'cddr
+  (loop for (_name val) on (symbol-plist 'slime-contribs) by #'cddr
         when (slime-contrib-p val)
         collect val))
 
@@ -7207,11 +7210,13 @@
 
 (defun slime-cheat-sheet ()
   (interactive)
-  (switch-to-buffer-other-frame (get-buffer-create (slime-buffer-name :cheat-sheet)))
+  (switch-to-buffer-other-frame 
+   (get-buffer-create (slime-buffer-name :cheat-sheet)))
   (setq buffer-read-only nil)
   (delete-region (point-min) (point-max))
   (goto-char (point-min))
-  (insert "SLIME: The Superior Lisp Interaction Mode for Emacs (minor-mode).\n\n")
+  (insert 
+   "SLIME: The Superior Lisp Interaction Mode for Emacs (minor-mode).\n\n")
   (dolist (mode slime-cheat-sheet-table)
     (let ((title (getf mode :title))
           (mode-map (getf mode :map))
@@ -7238,19 +7243,17 @@
                          (integerp (aref binding 0)))
                 (push binding key-bindings)))
             (push (mapconcat 'key-description key-bindings " or ") keys)))
-        (loop
-           with key-length = (apply 'max (mapcar 'length keys))
-           with desc-length = (apply 'max (mapcar 'length descriptions))
-           for key in (nreverse keys)
-           for desc in (nreverse descriptions)
-           do (insert desc)
-           do (insert (make-string (- desc-length (length desc)) ? ))
-           do (insert " => ")
-           do (insert (if (string= "" key)
-                          "<not on any key>"
-                          key))
-           do (insert "\n")
-           finally do (insert "\n")))))
+        (loop with desc-length = (apply 'max (mapcar 'length descriptions))
+              for key in (nreverse keys)
+              for desc in (nreverse descriptions)
+              do (insert desc)
+              do (insert (make-string (- desc-length (length desc)) ? ))
+              do (insert " => ")
+              do (insert (if (string= "" key)
+                             "<not on any key>"
+                           key))
+              do (insert "\n")
+              finally do (insert "\n")))))
   (setq buffer-read-only t)
   (goto-char (point-min)))
 
@@ -7303,9 +7306,7 @@
   (assert (slime-at-top-level-p) () "Pending RPCs or open debuggers.")
   (slime-create-test-results-buffer)
   (unwind-protect
-      (let ((slime-repl-history-file 
-             (expand-file-name "slime-repl-history" (slime-temp-directory)))
-            (slime-tests (if slime-randomize-test-order
+      (let ((slime-tests (if slime-randomize-test-order
                              (slime-shuffle-list slime-tests)
                            slime-tests)))
         (slime-execute-tests))
@@ -7353,7 +7354,6 @@
   (save-window-excursion
     (let ((slime-total-tests 0)
           (slime-skipped-tests 0)
-          (slime-expected-passes 0)
           (slime-unexpected-failures 0)
           (slime-expected-failures 0)
           (slime-lisp-under-test (slime-lisp-implementation-name)))
@@ -7409,10 +7409,8 @@
     (slime)
     ;; Block until we are up and running.
     (let* ((timeout 30)
-           (cell (cons nil nil))
-           (timer (run-with-timer timeout nil (lambda (cell) 
-                                                (setcar cell t))
-                                  cell)))
+           (cell (cons nil nil)))
+      (run-with-timer timeout nil (lambda (cell) (setcar cell t)) cell)
       (while (not (slime-connected-p))
         (sit-for 1)
         (when (car cell)
@@ -7557,7 +7555,7 @@
 ;; Clear out old tests.
 (setq slime-tests nil)
 
-(defun slime-check-top-level (&optional test-name)
+(defun slime-check-top-level () ;(&optional _test-name)
   (slime-accept-process-output nil 0.001)
   (slime-check "At the top level (no debugging or pending RPCs)"
     (slime-at-top-level-p)))
@@ -8998,9 +8996,9 @@
     (interactive)
     (let ((saved-point (point))
 	  (state (parse-partial-sexp (point-min) (point-max) -1)))
-      (destructuring-bind (depth innermost-start last-terminated-start
+      (destructuring-bind (depth innermost-start _last-terminated-start
 				 in-string in-comment after-quote 
-				 minimum-depth comment-style 
+				 _minimum-depth comment-style 
 				 comment-or-string-start &rest _) state
 	(cond ((and (zerop depth) 
 		    (not in-string) 
@@ -9044,15 +9042,15 @@
   (or (eq coding-system 'binary)
       (error "No such coding system: %S" coding-system)))
 
-(slime-defun-if-undefined process-coding-system (process)
+(slime-defun-if-undefined process-coding-system (_process)
   '(binary . binary))
 
 (slime-defun-if-undefined set-process-coding-system 
-    (process &optional decoding encoding))
+    (_process &optional _decoding _encoding))
 
 ;; For Emacs 21
 (slime-defun-if-undefined display-warning
-    (type message &optional level buffer-name)
+    (type message &optional level _buffer-name)
   (with-output-to-temp-buffer "*Warnings*"
     (princ (format "Warning (%s %s): %s" type level message))))
 
@@ -9158,6 +9156,7 @@
 (run-hooks 'slime-load-hook)
 
 ;; Local Variables: 
+;; lexical-binding: t
 ;; outline-regexp: ";;;;+"
 ;; indent-tabs-mode: nil
 ;; coding: latin-1-unix





More information about the slime-cvs mailing list