right-inserting copies of the point, rather than left-inserting.
This way, insertion of text at point inside the SAVE-EXCURSION region
will have no effect on the original point.
Change SAVE-EXCURSION to select the original buffer after the
supplied thunk returns.
Remove PAREDIT-SAVE-EXCURSION, whose functionality is now subsumed by
the new SAVE-EXCURSION.
#| -*-Scheme-*-
-$Id: buffrm.scm,v 1.62 2003/02/14 18:28:11 cph Exp $
+$Id: buffrm.scm,v 1.63 2006/07/03 19:41:23 riastradh Exp $
-Copyright 1986, 1989-2000, 2002 Massachusetts Institute of Technology
+Copyright 1986,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
+Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology
+Copyright 2000,2002,2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
(let ((buffer (window-buffer window)))
(make-saved-window
buffer
- (mark-left-inserting-copy (window-point window))
+ (mark-right-inserting-copy (window-point window))
(let ((ring (buffer-mark-ring buffer)))
(if (ring-empty? ring)
#f
#| -*-Scheme-*-
-$Id: curren.scm,v 1.147 2003/02/14 18:28:11 cph Exp $
+$Id: curren.scm,v 1.148 2006/07/03 19:41:22 riastradh Exp $
-Copyright 1986, 1989-2001 Massachusetts Institute of Technology
+Copyright 1986,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
+Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology
+Copyright 2000,2001,2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
(mark-column (current-point)))
(define (save-excursion thunk)
- (let ((point (mark-left-inserting-copy (current-point)))
+ (let ((point (mark-right-inserting-copy (current-point)))
(mark (mark-right-inserting-copy (current-mark))))
(thunk)
(let ((buffer (mark-buffer point)))
(if (buffer-alive? buffer)
(begin
- (set-buffer-point! buffer point)
- (set-buffer-mark! buffer mark))))))
+ (select-buffer buffer)
+ (set-current-point! point)
+ (set-current-mark! mark))))))
\f
;;;; Mark and Region
#| -*-Scheme-*-
-$Id: paredit.scm,v 1.6 2006/07/03 19:05:02 riastradh Exp $
+$Id: paredit.scm,v 1.7 2006/07/03 19:41:23 riastradh Exp $
This code is written by Taylor R. Campbell and placed in the Public
Domain. All warranties are disclaimed.
(let ((state (current-parse-state)))
(cond ((parse-state-in-string? state)
(insert-char #\")
- (paredit-save-excursion
+ (save-excursion
(lambda ()
(insert-char #\space)
(insert-char #\"))))
'(#\w #\_))
(memv (char-syntax (mark-right-char point))
'(#\w #\_))))
- (paredit-save-excursion (lambda ()
- (insert-char #\space))))
+ (save-excursion (lambda ()
+ (insert-char #\space))))
(else
(undo-record-point!)
(split-sexp-at-point))))))
(new-open (mark-left-inserting-copy new-open)))
(insert-char close-char new-close)
(mark-temporary! new-close)
- (paredit-save-excursion
+ (save-excursion
(lambda ()
(if (not (char=? (char-syntax (mark-left-char new-open))
#\space))
(editor-error
"S-expressions to join have intervenining text."))
(else
- (paredit-save-excursion
+ (save-excursion
(lambda ()
(join-sexps left-point right-point))))))))))
(insert-char close after)
(insert-space #t (mark1+ after)))
(set-current-point! point))))
-
-(define (paredit-save-excursion thunk)
- (let ((point) (mark))
- (dynamic-wind
- (lambda ()
- (set! point (mark-right-inserting-copy (current-point)))
- (set! mark (mark-right-inserting-copy (current-mark))))
- thunk
- (lambda ()
- (let ((point (set! point))
- (mark (set! mark)))
- (let ((buffer (mark-buffer point)))
- (if (buffer-alive? buffer)
- (begin (select-buffer buffer)
- (set-current-point! point)
- (set-current-mark! mark)))))))))
\f
(define (insert-newline-preserving-comment #!optional mark)
(let ((mark (if (default-object? mark) (current-point) mark)))