[slime-cvs] CVS update: slime/slime.el

Helmut Eller heller at common-lisp.net
Mon Jan 10 19:32:08 UTC 2005


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

Modified Files:
	slime.el 
Log Message:
(slime-conservative-indentation): The default is now nil.  Suggested
by Travis Cross.

(slime-inspector-next-inspectable-object): Accept a prefix argument
and make wrapping around more reliable.  The code is adapted from
`widget-move'.  
(slime-inspector-previous-inspectable-object): New command.  
(slime-inspector-mode-map): Bind to S-TAB.

Date: Mon Jan 10 20:32:02 2005
Author: heller

Index: slime/slime.el
diff -u slime/slime.el:1.443 slime/slime.el:1.444
--- slime/slime.el:1.443	Thu Dec 16 23:24:41 2004
+++ slime/slime.el	Mon Jan 10 20:32:00 2005
@@ -6882,18 +6882,60 @@
   (set-window-configuration slime-saved-window-config)
   (kill-buffer (current-buffer)))
 
-(defun slime-inspector-next-inspectable-object ()
-  "sets the point to the next inspectable object"
-  (interactive)
-  (let ((pos (if (get-text-property (point) 'slime-part-number)
-                 ;; we're in a part
-                 (next-single-property-change 
-                  (or (next-single-property-change (point) 'slime-part-number) (point-min))
-                  'slime-part-number)
-                 ;; go to the next part or wrap around
-                 (or (next-single-property-change (point) 'slime-part-number)
-                     (next-single-property-change (point-min) 'slime-part-number)))))
-    (when pos (goto-char pos))))
+(defun slime-inspector-next-inspectable-object (arg)
+  "Move point to the next inspectable object.
+With optional ARG, move across that many objects.
+If ARG is negative, move backwards."
+  (interactive "p")
+  (or (bobp) (> arg 0) (backward-char))
+  (let ((wrapped 0)
+	(number arg)
+	(old (get-text-property (point) 'slime-part-number))
+	new)
+    ;; Forward.
+    (while (> arg 0)
+      (cond ((eobp)
+	     (goto-char (point-min))
+	     (setq wrapped (1+ wrapped)))
+	    (t
+	     (goto-char (or (next-single-property-change (point) 
+                                                         'slime-part-number)
+                            (point-max)))))
+      (and (= wrapped 2)
+	   (eq arg number)
+	   (error "No inspectable objects"))
+      (let ((new (get-text-property (point) 'slime-part-number)))
+	(when new
+	  (unless (eq new old)
+	    (setq arg (1- arg))
+	    (setq old new)))))
+    ;; Backward.
+    (while (< arg 0)
+      (cond ((bobp)
+	     (goto-char (point-max))
+	     (setq wrapped (1+ wrapped)))
+	    (t
+	     (goto-char (or (previous-single-property-change 
+                             (point) 'slime-part-number)
+                            (point-min)))))
+      (and (= wrapped 2)
+	   (eq arg number)
+	   (error "No inspectable objects"))
+      (let ((new (get-text-property (point) 'slime-part-number)))
+	(when new
+	  (unless (eq new old)
+	    (setq arg (1+ arg))))))
+    (let ((new (get-text-property (point) 'slime-part-number)))
+      (while (eq (get-text-property (point) 'slime-part-number) new)
+	(backward-char)))
+    (forward-char)))
+
+(defun slime-inspector-previous-inspectable-object (arg)
+  "Move point to the previous inspectable object.
+With optional ARG, move across that many objects.
+If ARG is negative, move forwards."
+  (interactive "p")
+  (slime-inspector-next-inspectable-object (- arg)))
   
 (defun slime-inspector-describe ()
   (interactive)
@@ -6909,6 +6951,7 @@
   ("d" 'slime-inspector-describe)
   ("q" 'slime-inspector-quit)
   ("\C-i" 'slime-inspector-next-inspectable-object)
+  ([(shift tab)] 'slime-inspector-previous-inspectable-object)
   ("\M-." 'slime-edit-definition))
 
 
@@ -7256,7 +7299,7 @@
 
 ;;;; Indentation
 
-(defcustom slime-conservative-indentation t
+(defcustom slime-conservative-indentation nil
   "If true then don't discover indentation of \"with-\" or \"def\" symbols."
   :type 'boolean
   :group 'slime-mode)




More information about the slime-cvs mailing list