From: Chris Hanson Date: Sun, 30 Apr 1995 07:02:18 +0000 (+0000) Subject: Change select-buffer hooks to take a second argument, the window that X-Git-Tag: 20090517-FFI~6367 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=337726e0611ab37209e0404f319c5c230ecaa75b;p=mit-scheme.git Change select-buffer hooks to take a second argument, the window that the buffer is being selected in. This is often useful, and if it's not passed in there's no way to get it. --- diff --git a/v7/src/edwin/curren.scm b/v7/src/edwin/curren.scm index 017c9eace..3d17ba0bd 100644 --- a/v7/src/edwin/curren.scm +++ b/v7/src/edwin/curren.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: curren.scm,v 1.115 1995/04/27 20:33:28 cph Exp $ +;;; $Id: curren.scm,v 1.116 1995/04/30 07:02:10 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-95 Massachusetts Institute of Technology ;;; @@ -466,7 +466,7 @@ The screen is guaranteed to be deselected at that time." (set-buffer-point! buffer (window-point window)) (if record? (bufferset-select-buffer! (current-bufferset) buffer)) - (for-each (lambda (hook) (hook buffer)) + (for-each (lambda (hook) (hook buffer window)) (get-buffer-hooks buffer 'SELECT-BUFFER-HOOKS)) (if (not (minibuffer? buffer)) (event-distributor/invoke! diff --git a/v7/src/edwin/intmod.scm b/v7/src/edwin/intmod.scm index b9467684b..81dd53ad9 100644 --- a/v7/src/edwin/intmod.scm +++ b/v7/src/edwin/intmod.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: intmod.scm,v 1.85 1994/11/01 23:12:09 adams Exp $ +;;; $Id: intmod.scm,v 1.86 1995/04/30 07:02:18 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-94 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-95 Massachusetts Institute of Technology ;;; ;;; This material was developed by the Scheme project at the ;;; Massachusetts Institute of Technology, Department of @@ -916,11 +916,11 @@ If this is an error, the debugger examines the error condition." (define (when-buffer-selected buffer thunk) (if (current-buffer? buffer) (thunk) - (letrec - ((hook - (lambda (buffer) - (thunk) - (remove-select-buffer-hook buffer hook)))) + (letrec ((hook (lambda (buffer window) + (if (current-window? window) + (begin + (thunk) + (remove-select-buffer-hook buffer hook)))))) (add-select-buffer-hook buffer hook)))) (define (operation/prompt-for-command-expression port prompt level)