From 085c14e71cf015f7fd2bb2ac8620f4c076beb8c9 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 4 May 1999 17:23:09 +0000 Subject: [PATCH] Define variable that specifies the password filename for the view-password-file command. --- v7/src/edwin/loadef.scm | 6 ++++-- v7/src/edwin/pwedit.scm | 14 +++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/v7/src/edwin/loadef.scm b/v7/src/edwin/loadef.scm index 4b4ab2a21..719d72374 100644 --- a/v7/src/edwin/loadef.scm +++ b/v7/src/edwin/loadef.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: loadef.scm,v 1.38 1999/05/04 17:19:10 cph Exp $ +;;; $Id: loadef.scm,v 1.39 1999/05/04 17:23:04 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology ;;; @@ -318,7 +318,9 @@ This is usually 103 or 2627." '("pwparse" (EDWIN PASSWORD-EDIT))) (define-autoload-command 'view-password-file 'PASSWORD-EDIT - "Read in a password file and show it in password-view mode.") + "Read in a password file and show it in password-view mode. +Reads the file specified in the variable password-file. +If password-file is #f, or if prefix arg supplied, prompts for a filename.") (define-variable password-file "Name of file containing passwords, or #F meaning prompt for name. diff --git a/v7/src/edwin/pwedit.scm b/v7/src/edwin/pwedit.scm index f583c4c81..1f963a058 100644 --- a/v7/src/edwin/pwedit.scm +++ b/v7/src/edwin/pwedit.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: pwedit.scm,v 1.4 1999/01/29 20:03:35 cph Exp $ +;;; $Id: pwedit.scm,v 1.5 1999/05/04 17:23:09 cph Exp $ ;;; ;;; Copyright (c) 1999 Massachusetts Institute of Technology ;;; @@ -30,8 +30,15 @@ (declare (usual-integrations)) (define-command view-password-file - "Read in a password file and show it in password-view mode." - "fView password file" + "Read in a password file and show it in password-view mode. +Reads the file specified in the variable password-file. +If password-file is #f, or if prefix arg supplied, prompts for a filename." + (lambda () + (list + (let ((filename (ref-variable password-file))) + (if (and filename (not (command-argument))) + filename + (prompt-for-existing-file "View password file" filename))))) (lambda (pathname) (let ((forms (call-with-temporary-buffer " view-pw-file" @@ -43,6 +50,7 @@ (let ((buffer (new-buffer (pathname->buffer-name pathname)))) (insert-pw-forms forms (buffer-start buffer)) (set-buffer-major-mode! buffer (ref-mode-object password-view)) + (set-buffer-default-directory! buffer (directory-pathname pathname)) (set-buffer-point! buffer (buffer-start buffer)) (select-buffer buffer))))) -- 2.25.1