From: Chris Hanson Date: Fri, 31 Mar 2000 19:40:13 +0000 (+0000) Subject: Change DIRED-THIS-FILE to signal an error if desired. X-Git-Tag: 20090517-FFI~4122 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=28c8680b4b7ae1c5447eca6cef3d0fa6ad065c93;p=mit-scheme.git Change DIRED-THIS-FILE to signal an error if desired. --- diff --git a/v7/src/edwin/dired.scm b/v7/src/edwin/dired.scm index ba510433b..32d359954 100644 --- a/v7/src/edwin/dired.scm +++ b/v7/src/edwin/dired.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: dired.scm,v 1.175 2000/03/31 19:35:00 cph Exp $ +;;; $Id: dired.scm,v 1.176 2000/03/31 19:40:13 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; @@ -918,7 +918,7 @@ Actions controlled by variables list-directory-brief-switches (continue)) (continue))))))) -(define (dired-this-file #!optional mark) +(define (dired-this-file #!optional mark error?) (let ((mark (cond ((or (default-object? mark) (not mark)) (current-point)) @@ -928,8 +928,9 @@ Actions controlled by variables list-directory-brief-switches (buffer-point mark))) (else mark)))) (let ((start (line-start mark 0))) - (and (dired-filename-start start) - (cons (dired-pathname start) start))))) + (if (dired-filename-start start) + (dired-pathname start) + (and error? (editor-error "No file on this line")))))) (define (for-each-dired-mark buffer procedure) (for-each (lambda (file)