annotate lisp/vms-patch.el @ 15132:c89db56c289b

(CONFIG_H) [WIN95]: Use config.nt.
author Geoff Voelker <voelker@cs.washington.edu>
date Fri, 03 May 1996 18:20:11 +0000
parents 83f275dcd93a
children 12e32a06de22
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
657
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 156
diff changeset
1 ;;; vms-patch.el --- override parts of files.el for VMS.
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 156
diff changeset
2
1174
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
3 ;; Copyright (C) 1986, 1992 Free Software Foundation, Inc.
840
113281b361ec *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 812
diff changeset
4
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
5 ;; Maintainer: FSF
812
485e82a8acb5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
6 ;; Keywords: vms
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
7
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
9
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
13 ;; any later version.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
14
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
19
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 11045
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 11045
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 11045
diff changeset
23 ;; Boston, MA 02111-1307, USA.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
24
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
25 ;;; Code:
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
26
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
27 ;;; Functions that need redefinition
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
28
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
29 ;;; VMS file names are upper case, but buffer names are more
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
30 ;;; convenient in lower case.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
31
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
32 (defun create-file-buffer (filename)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
33 "Create a suitably named buffer for visiting FILENAME, and return it.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
34 FILENAME (sans directory) is used unchanged if that name is free;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
35 otherwise a string <2> or <3> or ... is appended to get an unused name."
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
36 (generate-new-buffer (downcase (file-name-nondirectory filename))))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
37
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
38 ;;; Given a string FN, return a similar name which is a legal VMS filename.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
39 ;;; This is used to avoid invalid auto save file names.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
40 (defun make-legal-file-name (fn)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
41 (setq fn (copy-sequence fn))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
42 (let ((dot nil) (indx 0) (len (length fn)) chr)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
43 (while (< indx len)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
44 (setq chr (aref fn indx))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
45 (cond
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
46 ((eq chr ?.) (if dot (aset fn indx ?_) (setq dot t)))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
47 ((not (or (and (>= chr ?a) (<= chr ?z)) (and (>= chr ?A) (<= chr ?Z))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
48 (and (>= chr ?0) (<= chr ?9))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
49 (eq chr ?$) (eq chr ?_) (and (eq chr ?-) (> indx 0))))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
50 (aset fn indx ?_)))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
51 (setq indx (1+ indx))))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
52 fn)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
53
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
54 ;;; Auto save filesnames start with _$ and end with $.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
55
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
56 (defun make-auto-save-file-name ()
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
57 "Return file name to use for auto-saves of current buffer.
11045
b4bf1f2d99f8 (make-auto-save-file-name, auto-save-file-name-p): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 2864
diff changeset
58 This function does not consider `auto-save-visited-file-name';
b4bf1f2d99f8 (make-auto-save-file-name, auto-save-file-name-p): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 2864
diff changeset
59 the caller should check that before calling this function.
b4bf1f2d99f8 (make-auto-save-file-name, auto-save-file-name-p): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 2864
diff changeset
60 This is a separate function so that your `.emacs' file or the site's
b4bf1f2d99f8 (make-auto-save-file-name, auto-save-file-name-p): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 2864
diff changeset
61 `site-init.el' can redefine it.
b4bf1f2d99f8 (make-auto-save-file-name, auto-save-file-name-p): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 2864
diff changeset
62 See also `auto-save-file-name-p'."
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
63 (if buffer-file-name
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
64 (concat (file-name-directory buffer-file-name)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
65 "_$"
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
66 (file-name-nondirectory buffer-file-name)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
67 "$")
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
68 (expand-file-name (concat "_$_" (make-legal-file-name (buffer-name)) "$"))))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
69
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
70 (defun auto-save-file-name-p (filename)
11045
b4bf1f2d99f8 (make-auto-save-file-name, auto-save-file-name-p): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 2864
diff changeset
71 "Return t if FILENAME can be yielded by `make-auto-save-file-name'.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
72 FILENAME should lack slashes.
11045
b4bf1f2d99f8 (make-auto-save-file-name, auto-save-file-name-p): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 2864
diff changeset
73 This is a separate function so that your `.emacs' file or the site's
b4bf1f2d99f8 (make-auto-save-file-name, auto-save-file-name-p): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 2864
diff changeset
74 `site-init.el' can redefine it."
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
75 (string-match "^_\\$.*\\$" filename))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
76
1174
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
77 ;;;
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
78 ;;; This goes along with kepteditor.com which defines these logicals
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
79 ;;; If EMACS_COMMAND_ARGS is defined, it supersedes EMACS_FILE_NAME,
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
80 ;;; which is probably set up incorrectly anyway.
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
81 ;;; The function command-line-again is a kludge, but it does the job.
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
82 ;;;
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
83 (defun vms-suspend-resume-hook ()
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
84 "When resuming suspended Emacs, check for file to be found.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
85 If the logical name `EMACS_FILE_NAME' is defined, `find-file' that file."
1174
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
86 (let ((file (vms-system-info "LOGICAL" "EMACS_FILE_NAME"))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
87 (args (vms-system-info "LOGICAL" "EMACS_COMMAND_ARGS"))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
88 (line (vms-system-info "LOGICAL" "EMACS_FILE_LINE")))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
89 (if (not args)
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
90 (if file
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
91 (progn (find-file file)
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
92 (if line (goto-line (string-to-int line)))))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
93 (cd (file-name-directory file))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
94 (vms-command-line-again))))
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
95
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
96 (setq suspend-resume-hook 'vms-suspend-resume-hook)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
97
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
98 (defun vms-suspend-hook ()
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
99 "Don't allow suspending if logical name `DONT_SUSPEND_EMACS' is defined."
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
100 (if (vms-system-info "LOGICAL" "DONT_SUSPEND_EMACS")
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
101 (error "Can't suspend this emacs"))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
102 nil)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
103
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
104 (setq suspend-hook 'vms-suspend-hook)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
105
1174
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
106 ;;;
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
107 ;;; A kludge that allows reprocessing of the command line. This is mostly
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
108 ;;; to allow a spawned VMS mail process to do something reasonable when
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
109 ;;; used in conjunction with the modifications to sysdep.c that allow
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
110 ;;; Emacs to attach to a "foster" parent.
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
111 ;;;
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
112 (defun vms-command-line-again ()
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
113 "Reprocess command line arguments. VMS specific.
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
114 Command line arguments are initialized from the logical EMACS_COMMAND_ARGS
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
115 which is defined by kepteditor.com. On VMS this allows attaching to a
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
116 spawned Emacs and doing things like \"emacs -l myfile.el -f doit\""
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
117 (let* ((args (downcase (vms-system-info "LOGICAL" "EMACS_COMMAND_ARGS")))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
118 (command-line-args (list "emacs"))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
119 (beg 0)
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
120 (end 0)
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
121 (len (length args))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
122 this-char)
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
123 (if args
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
124 (progn
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
125 ;;; replace non-printable stuff with spaces
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
126 (while (< beg (length args))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
127 (if (or (> 33 (setq this-char (aref args beg)))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
128 (< 127 this-char))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
129 (aset args beg 32))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
130 (setq beg (1+ beg)))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
131 (setq beg (1- (length args)))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
132 (while (= 32 (aref args beg)) (setq beg (1- beg)))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
133 (setq args (substring args 0 (1+ beg)))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
134 (setq beg 0)
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
135 ;;; now start parsing args
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
136 (while (< beg (length args))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
137 (while (and (< beg (length args))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
138 (or (> 33 (setq this-char (aref args beg)))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
139 (< 127 this-char))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
140 (setq beg (1+ beg))))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
141 (setq end (1+ beg))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
142 (while (and (< end (length args))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
143 (< 32 (setq this-char (aref args end)))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
144 (> 127 this-char))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
145 (setq end (1+ end)))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
146 (setq command-line-args (append
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
147 command-line-args
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
148 (list (substring args beg end))))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
149 (setq beg (1+ end)))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
150 (command-line)))))
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
151
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
152 (defun vms-read-directory (dirname switches buffer)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
153 (save-excursion
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
154 (set-buffer buffer)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
155 (subprocess-command-to-buffer
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
156 (concat "DIRECTORY " switches " " dirname)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
157 buffer)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
158 (goto-char (point-min))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
159 ;; Remove all the trailing blanks.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
160 (while (search-forward " \n")
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
161 (forward-char -1)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
162 (delete-horizontal-space))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
163 (goto-char (point-min))))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
164
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
165 (setq dired-listing-switches
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
166 "/SIZE/DATE/OWNER/WIDTH=(FILENAME=32,SIZE=5)")
156
29a528f78681 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
167
29a528f78681 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
168 (setq print-region-function
29a528f78681 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
169 '(lambda (start end command ign1 ign2 ign3 &rest switches)
29a528f78681 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
170 (write-region start end "sys$login:delete-me.txt")
29a528f78681 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
171 (send-command-to-subprocess
29a528f78681 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
172 1
29a528f78681 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
173 (concat command
2864
9c3bf565b354 * bibtex.el (bibtex-string): Use \" instead of "" to get a double
Jim Blandy <jimb@redhat.com>
parents: 1174
diff changeset
174 " sys$login:delete-me.txt/name=\"GNUprintbuffer\" "
156
29a528f78681 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
175 (mapconcat 'identity switches " "))
29a528f78681 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
176 nil nil nil)))
657
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 156
diff changeset
177
1174
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
178 ;;;
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
179 ;;; Fuctions for using Emacs as a VMS Mail editor
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
180 ;;;
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
181 (autoload 'vms-pmail-setup "vms-pmail"
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
182 "Set up file assuming use by VMS Mail utility.
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
183 The buffer is put into text-mode, auto-save is turned off and the
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
184 following bindings are established.
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
185
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
186 \\[vms-pmail-save-and-exit] vms-pmail-save-and-exit
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
187 \\[vms-pmail-abort] vms-pmail-abort
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
188
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
189 All other Emacs commands are still available."
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
190 t)
69fc2c96e27e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 840
diff changeset
191
657
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 156
diff changeset
192 ;;; vms-patch.el ends here