changeset 104663:ae5e866fedd8

(edebug-display, edebug-outside-excursion): Replace uses of default-cursor-in-non-selected-windows with (default-value 'cursor-in-non-selected-windows). Use with-current-buffer.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 28 Aug 2009 04:12:49 +0000
parents 790bd85e4cb0
children 50fdf250e26b
files lisp/ChangeLog lisp/emacs-lisp/edebug.el
diffstat 2 files changed, 19 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Aug 28 04:05:58 2009 +0000
+++ b/lisp/ChangeLog	Fri Aug 28 04:12:49 2009 +0000
@@ -1,5 +1,10 @@
 2009-08-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* emacs-lisp/edebug.el (edebug-display, edebug-outside-excursion):
+	Replace uses of default-cursor-in-non-selected-windows
+	with (default-value 'cursor-in-non-selected-windows).
+	Use with-current-buffer.
+
 	* mail/feedmail.el: Use CL macros.
 	(feedmail-run-the-queue, feedmail-send-it-immediately):
 	* dos-w32.el (find-buffer-file-type): Replace uses of
--- a/lisp/emacs-lisp/edebug.el	Fri Aug 28 04:05:58 2009 +0000
+++ b/lisp/emacs-lisp/edebug.el	Fri Aug 28 04:12:49 2009 +0000
@@ -352,8 +352,7 @@
 	 (edebug:s-r-end (point-max-marker)))
      (unwind-protect
 	 (progn ,@body)
-       (save-excursion
-	 (set-buffer (marker-buffer edebug:s-r-beg))
+       (with-current-buffer (marker-buffer edebug:s-r-beg)
 	 (narrow-to-region edebug:s-r-beg edebug:s-r-end)))))
 
 ;;; Display
@@ -2579,15 +2578,16 @@
 	(edebug-outside-o-a-p overlay-arrow-position)
 	(edebug-outside-o-a-s overlay-arrow-string)
 	(edebug-outside-c-i-e-a cursor-in-echo-area)
-	(edebug-outside-d-c-i-n-s-w default-cursor-in-non-selected-windows))
+	(edebug-outside-d-c-i-n-s-w
+         (default-value 'cursor-in-non-selected-windows)))
     (unwind-protect
 	(let ((overlay-arrow-position overlay-arrow-position)
 	      (overlay-arrow-string overlay-arrow-string)
 	      (cursor-in-echo-area nil)
-	      (default-cursor-in-non-selected-windows t)
 	      (unread-command-events unread-command-events)
 	      ;; any others??
 	      )
+          (setq-default cursor-in-non-selected-windows t)
 	  (if (not (buffer-name edebug-buffer))
 	      (let ((debug-on-error nil))
 		(error "Buffer defining %s not found" edebug-function)))
@@ -2782,10 +2782,8 @@
 	  ;; Restore edebug-buffer's outside point.
 	  ;;    (edebug-trace "restore edebug-buffer point: %s"
 	  ;;		  edebug-buffer-outside-point)
-	  (let ((current-buffer (current-buffer)))
-	    (set-buffer edebug-buffer)
-	    (goto-char edebug-buffer-outside-point)
-	    (set-buffer current-buffer))
+	  (with-current-buffer edebug-buffer
+	    (goto-char edebug-buffer-outside-point))
 	  ;; ... nothing more.
 	  )
       (with-timeout-unsuspend edebug-with-timeout-suspend)
@@ -2794,8 +2792,8 @@
        unread-command-events edebug-outside-unread-command-events
        overlay-arrow-position edebug-outside-o-a-p
        overlay-arrow-string edebug-outside-o-a-s
-       cursor-in-echo-area edebug-outside-c-i-e-a
-       default-cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w)
+       cursor-in-echo-area edebug-outside-c-i-e-a)
+      (setq-default cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w)
       )))
 
 
@@ -2851,8 +2849,7 @@
   (let ((edebug-buffer-read-only buffer-read-only)
 	;; match-data must be done in the outside buffer
 	(edebug-outside-match-data
-	 (save-excursion  ; might be unnecessary now??
-	   (set-buffer edebug-outside-buffer)  ; in case match buffer different
+	 (with-current-buffer edebug-outside-buffer ; in case match buffer different
 	   (match-data)))
 
 	;;(edebug-number-of-recursions (1+ edebug-number-of-recursions))
@@ -3605,8 +3602,8 @@
 	   (overlay-arrow-position edebug-outside-o-a-p)
 	   (overlay-arrow-string edebug-outside-o-a-s)
 	   (cursor-in-echo-area edebug-outside-c-i-e-a)
-	   (default-cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w)
 	   )
+       (setq-default cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w)
        (unwind-protect
 	   (save-excursion		; of edebug-buffer
 	     (set-buffer edebug-outside-buffer)
@@ -3642,14 +3639,16 @@
 	  edebug-outside-o-a-p overlay-arrow-position
 	  edebug-outside-o-a-s overlay-arrow-string
 	  edebug-outside-c-i-e-a cursor-in-echo-area
-	  edebug-outside-d-c-i-n-s-w default-cursor-in-non-selected-windows
-	  )
+	  edebug-outside-d-c-i-n-s-w (default-value
+                                       'cursor-in-non-selected-windows)
+          )
 
 	 ;; Restore the outside saved values; don't alter
 	 ;; the outside binding loci.
 	 (setcdr edebug-outside-pre-command-hook pre-command-hook)
 	 (setcdr edebug-outside-post-command-hook post-command-hook)
 
+         (setq-default cursor-in-non-selected-windows t)
 	 ))				; let
      ))