;;; -*-Scheme-*-
;;;
-;;; $Id: kilcom.scm,v 1.64 1993/01/10 10:47:06 cph Exp $
+;;; $Id: kilcom.scm,v 1.65 1995/05/02 21:18:58 cph Exp $
;;;
-;;; Copyright (c) 1985, 1989-93 Massachusetts Institute of Technology
+;;; Copyright (c) 1985, 1989-95 Massachusetts Institute of Technology
;;;
;;; This material was developed by the Scheme project at the
;;; Massachusetts Institute of Technology, Department of
(lambda ()
(if (null? strings)
(editor-error "No previous kill"))
- (set-car! strings
- (if forward?
- (string-append (car strings) string)
- (string-append string (car strings))))
- (set-variable! kill-ring-yank-pointer strings))
+ (let ((string
+ (if forward?
+ (string-append (car strings) string)
+ (string-append string (car strings)))))
+ (set-car! strings string)
+ (set-variable! kill-ring-yank-pointer strings)
+ (os/interprogram-cut string)))
(lambda ()
- (let ((strings
- (let ((kill-ring-max (ref-variable kill-ring-max)))
- (if (zero? kill-ring-max)
- '()
- (let ((strings (cons string strings)))
- (if (> (length strings) kill-ring-max)
- (set-cdr! (list-tail strings (- kill-ring-max 1))
- '()))
- strings)))))
- (set-variable! kill-ring strings)
- (set-variable! kill-ring-yank-pointer strings)))))
+ (kill-ring-save-1 string)
+ (os/interprogram-cut string))))
(set-command-message! append-next-kill-tag))
+(define (kill-ring-save-1 string)
+ (let ((strings
+ (let ((kill-ring-max (ref-variable kill-ring-max)))
+ (if (zero? kill-ring-max)
+ '()
+ (let ((strings (cons string strings)))
+ (if (> (length strings) kill-ring-max)
+ (set-cdr! (list-tail strings (- kill-ring-max 1)) '()))
+ strings)))))
+ (set-variable! kill-ring strings)
+ (set-variable! kill-ring-yank-pointer strings)))
+
(define append-next-kill-tag
"Append Next Kill")
\f
((ref-command rotate-yank-pointer) offset)
(let* ((start (mark-right-inserting-copy (current-point)))
(end (mark-left-inserting-copy start)))
- (insert-string (car (ref-variable kill-ring-yank-pointer)) start)
+ (insert-string (let ((string (car (ref-variable kill-ring-yank-pointer)))
+ (string*
+ (and (= offset 0)
+ (os/interprogram-paste))))
+ (if (and string*
+ (not (string-null? string*))
+ (not (string=? string* string)))
+ (begin
+ (kill-ring-save-1 string*)
+ string*)
+ string))
+ start)
(mark-temporary! end)
(mark-temporary! start)
(if before?
;;; -*-Scheme-*-
;;;
-;;; $Id: os2.scm,v 1.13 1995/05/02 00:29:23 cph Exp $
+;;; $Id: os2.scm,v 1.14 1995/05/02 21:18:40 cph Exp $
;;;
;;; Copyright (c) 1994-95 Massachusetts Institute of Technology
;;;
(define (os/set-file-modes-writable! pathname)
(set-file-modes! pathname (fix:andc (file-modes pathname) #x0001)))
+
+(define (os/interprogram-cut string push?)
+ push?
+ (os2-clipboard-write-text
+ ;; Some programs can't handle strings over 64k.
+ (if (fix:< (string-length string) #x10000) string "")))
+
+(define os/interprogram-paste
+ os2-clipboard-read-text)
\f
;;;; Dired customization
;;; -*-Scheme-*-
;;;
-;;; $Id: unix.scm,v 1.48 1995/04/15 06:14:01 cph Exp $
+;;; $Id: unix.scm,v 1.49 1995/05/02 21:19:22 cph Exp $
;;;
;;; Copyright (c) 1989-95 Massachusetts Institute of Technology
;;;
(ns (decoded-time/minute dt) 2 #\0))
(string-append " "
(number->string
- (decoded-time/year dt)))))))
\ No newline at end of file
+ (decoded-time/year dt)))))))
+
+(define (os/interprogram-cut string push?)
+ string push?
+ unspecific)
+
+(define (os/interprogram-paste)
+ #f)
\ No newline at end of file