From: Chris Hanson Date: Wed, 9 Dec 1998 02:51:45 +0000 (+0000) Subject: Implement M-x insert-filename. X-Git-Tag: 20090517-FFI~4710 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=25bee26de9e44eb2611e67c1601f97211805feb0;p=mit-scheme.git Implement M-x insert-filename. --- diff --git a/v7/src/edwin/filcom.scm b/v7/src/edwin/filcom.scm index 72c5d6894..95efc4681 100644 --- a/v7/src/edwin/filcom.scm +++ b/v7/src/edwin/filcom.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: filcom.scm,v 1.196 1998/11/18 03:42:26 cph Exp $ +;;; $Id: filcom.scm,v 1.197 1998/12/09 02:51:39 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-98 Massachusetts Institute of Technology ;;; @@ -364,6 +364,25 @@ Argument means don't offer to use auto-save file." (message "Auto-save off in this buffer till you do M-x auto-save-mode.") (select-buffer buffer))))))) + +(define-command insert-filename + "Interactively read a file name and insert it at point. +The file name is normally inserted using Scheme syntax, +but see the variable insert-filename-format." + "FInsert filename" + (lambda (filename) + (insert-string ((ref-variable insert-filename-format) filename) + (current-point)))) + +(define-variable insert-filename-format + "Defines the format used by \[insert-filename]. +The value of this variable must be a procedure of one argument. +The procedure is called with the filename as an argument, +and returns the string that is inserted into the buffer." + write-to-string + (lambda (object) + (and (procedure? object) + (procedure-arity-valid? object 1)))) (define-command save-buffer "Save current buffer in visited file if modified. Versions described below. @@ -610,6 +629,8 @@ If a file with the new name already exists, confirmation is requested first." ": Permission denied")) (set-buffer-default-directory! buffer directory)))) +;;;; Encryption + (define-command encrypt-file "Encrypt a file with the blowfish encryption algorithm. Prompts for the plaintext and ciphertext filenames. diff --git a/v7/src/edwin/modefs.scm b/v7/src/edwin/modefs.scm index 9f7d7b77b..341b162c6 100644 --- a/v7/src/edwin/modefs.scm +++ b/v7/src/edwin/modefs.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: modefs.scm,v 1.151 1998/01/20 18:40:46 adams Exp $ +;;; $Id: modefs.scm,v 1.152 1998/12/09 02:51:45 cph Exp $ ;;; -;;; Copyright (c) 1985, 1989-1998 Massachusetts Institute of Technology +;;; Copyright (c) 1985, 1989-98 Massachusetts Institute of Technology ;;; ;;; This material was developed by the Scheme project at the ;;; Massachusetts Institute of Technology, Department of @@ -237,6 +237,7 @@ Like Fundamental mode, but no self-inserting characters.") (define-key 'fundamental #\c-m-w 'append-next-kill) (define-key 'fundamental #\c-m-rubout 'backward-kill-sexp) +(define-key 'fundamental '(#\c-c #\c-i) 'insert-filename) (define-key 'fundamental '(#\c-c #\c-s) 'repl) (define-key 'fundamental '(#\c-h #\a) 'command-apropos)