Mercurial > emacs
annotate lisp/obsolete/vms-patch.el @ 96849:d049ef97c446
* print.c (print_object): Check print_depth before searching for
circularities.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Mon, 21 Jul 2008 05:02:31 +0000 |
parents | 090433f48c5f |
children |
rev | line source |
---|---|
96523
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
1 ;; -*- no-byte-compile: t -*- |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
2 ;; Not byte compiled because it uses functions that are not part of |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
3 ;; emacs, so it would generate unnecessary warnings. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
4 ;;; vms-patch.el --- override parts of files.el for VMS |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
5 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
6 ;; Copyright (C) 1986, 1992, 2001, 2002, 2003, 2004, |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
7 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
8 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
9 ;; Maintainer: FSF |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
10 ;; Keywords: vms |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
11 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
12 ;; This file is part of GNU Emacs. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
13 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
14 ;; GNU Emacs is free software: you can redistribute it and/or modify |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
15 ;; it under the terms of the GNU General Public License as published by |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
16 ;; the Free Software Foundation, either version 3 of the License, or |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
17 ;; (at your option) any later version. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
18 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
19 ;; GNU Emacs is distributed in the hope that it will be useful, |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
22 ;; GNU General Public License for more details. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
23 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
24 ;; You should have received a copy of the GNU General Public License |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
26 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
27 ;;; Commentary: |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
28 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
29 ;;; Code: |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
30 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
31 (defvar print-region-function) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
32 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
33 (setq auto-mode-alist (cons '(("\\.com\\'" . dcl-mode)) auto-mode-alist)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
34 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
35 ;;; Functions that need redefinition |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
36 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
37 ;;; VMS file names are upper case, but buffer names are more |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
38 ;;; convenient in lower case. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
39 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
40 (defun create-file-buffer (filename) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
41 "Create a suitably named buffer for visiting FILENAME, and return it. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
42 FILENAME (sans directory) is used unchanged if that name is free; |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
43 otherwise a string <2> or <3> or ... is appended to get an unused name." |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
44 (generate-new-buffer (downcase (file-name-nondirectory filename)))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
45 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
46 ;;; Given a string FN, return a similar name which is a valid VMS filename. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
47 ;;; This is used to avoid invalid auto save file names. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
48 (defun make-valid-file-name (fn) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
49 (setq fn (copy-sequence fn)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
50 (let ((dot nil) (indx 0) (len (length fn)) chr) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
51 (while (< indx len) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
52 (setq chr (aref fn indx)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
53 (cond |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
54 ((eq chr ?.) (if dot (aset fn indx ?_) (setq dot t))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
55 ((not (or (and (>= chr ?a) (<= chr ?z)) (and (>= chr ?A) (<= chr ?Z)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
56 (and (>= chr ?0) (<= chr ?9)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
57 (eq chr ?$) (eq chr ?_) (and (eq chr ?-) (> indx 0)))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
58 (aset fn indx ?_))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
59 (setq indx (1+ indx)))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
60 fn) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
61 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
62 (define-obsolete-function-alias 'make-legal-file-name 'make-valid-file-name "23.1") |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
63 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
64 ;;; Auto save filesnames start with _$ and end with $. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
65 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
66 (defun make-auto-save-file-name () |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
67 "Return file name to use for auto-saves of current buffer. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
68 This function does not consider `auto-save-visited-file-name'; |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
69 the caller should check that before calling this function. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
70 This is a separate function so that your `.emacs' file or the site's |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
71 `site-init.el' can redefine it. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
72 See also `auto-save-file-name-p'." |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
73 (if buffer-file-name |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
74 (concat (file-name-directory buffer-file-name) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
75 "_$" |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
76 (file-name-nondirectory buffer-file-name) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
77 "$") |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
78 (expand-file-name (concat "_$_" (make-valid-file-name (buffer-name)) "$")))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
79 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
80 (defun auto-save-file-name-p (filename) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
81 "Return t if FILENAME can be yielded by `make-auto-save-file-name'. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
82 FILENAME should lack slashes. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
83 This is a separate function so that your `.emacs' file or the site's |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
84 `site-init.el' can redefine it." |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
85 (string-match "^_\\$.*\\$" filename)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
86 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
87 ;;; |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
88 ;;; This goes along with kepteditor.com which defines these logicals |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
89 ;;; If EMACS_COMMAND_ARGS is defined, it supersedes EMACS_FILE_NAME, |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
90 ;;; which is probably set up incorrectly anyway. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
91 ;;; The function command-line-again is a kludge, but it does the job. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
92 ;;; |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
93 (defun vms-suspend-resume-hook () |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
94 "When resuming suspended Emacs, check for file to be found. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
95 If the logical name `EMACS_FILE_NAME' is defined, `find-file' that file." |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
96 (let ((file (vms-system-info "LOGICAL" "EMACS_FILE_NAME")) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
97 (args (vms-system-info "LOGICAL" "EMACS_COMMAND_ARGS")) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
98 (line (vms-system-info "LOGICAL" "EMACS_FILE_LINE"))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
99 (if (not args) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
100 (if file |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
101 (progn (find-file file) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
102 (if line (goto-line (string-to-number line))))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
103 (cd (file-name-directory file)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
104 (vms-command-line-again)))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
105 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
106 (setq suspend-resume-hook 'vms-suspend-resume-hook) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
107 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
108 (defun vms-suspend-hook () |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
109 "Don't allow suspending if logical name `DONT_SUSPEND_EMACS' is defined." |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
110 (if (vms-system-info "LOGICAL" "DONT_SUSPEND_EMACS") |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
111 (error "Can't suspend this emacs")) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
112 nil) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
113 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
114 (setq suspend-hook 'vms-suspend-hook) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
115 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
116 ;;; |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
117 ;;; A kludge that allows reprocessing of the command line. This is mostly |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
118 ;;; to allow a spawned VMS mail process to do something reasonable when |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
119 ;;; used in conjunction with the modifications to sysdep.c that allow |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
120 ;;; Emacs to attach to a "foster" parent. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
121 ;;; |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
122 (defun vms-command-line-again () |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
123 "Reprocess command line arguments. VMS specific. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
124 Command line arguments are initialized from the logical EMACS_COMMAND_ARGS |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
125 which is defined by kepteditor.com. On VMS this allows attaching to a |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
126 spawned Emacs and doing things like \"emacs -l myfile.el -f doit\"" |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
127 (let* ((args (downcase (vms-system-info "LOGICAL" "EMACS_COMMAND_ARGS"))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
128 (command-line-args (list "emacs")) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
129 (beg 0) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
130 (end 0) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
131 (len (length args)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
132 this-char) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
133 (if args |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
134 (progn |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
135 ;;; replace non-printable stuff with spaces |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
136 (while (< beg (length args)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
137 (if (or (> 33 (setq this-char (aref args beg))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
138 (< 127 this-char)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
139 (aset args beg 32)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
140 (setq beg (1+ beg))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
141 (setq beg (1- (length args))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
142 (while (= 32 (aref args beg)) (setq beg (1- beg))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
143 (setq args (substring args 0 (1+ beg))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
144 (setq beg 0) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
145 ;;; now start parsing args |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
146 (while (< beg (length args)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
147 (while (and (< beg (length args)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
148 (or (> 33 (setq this-char (aref args beg))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
149 (< 127 this-char)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
150 (setq beg (1+ beg)))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
151 (setq end (1+ beg)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
152 (while (and (< end (length args)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
153 (< 32 (setq this-char (aref args end))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
154 (> 127 this-char)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
155 (setq end (1+ end))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
156 (setq command-line-args (append |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
157 command-line-args |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
158 (list (substring args beg end)))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
159 (setq beg (1+ end))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
160 (command-line))))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
161 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
162 (defun vms-read-directory (dirname switches buffer) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
163 (save-excursion |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
164 (set-buffer buffer) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
165 (subprocess-command-to-buffer |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
166 (concat "DIRECTORY " switches " " dirname) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
167 buffer) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
168 (goto-char (point-min)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
169 ;; Remove all the trailing blanks. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
170 (while (search-forward " \n") |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
171 (forward-char -1) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
172 (delete-horizontal-space)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
173 (goto-char (point-min)))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
174 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
175 (setq dired-listing-switches |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
176 "/SIZE/DATE/OWNER/WIDTH=(FILENAME=32,SIZE=5)") |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
177 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
178 (setq print-region-function |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
179 (lambda (start end command ign1 ign2 ign3 &rest switches) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
180 (write-region start end "sys$login:delete-me.txt") |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
181 (send-command-to-subprocess |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
182 1 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
183 (concat command |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
184 " sys$login:delete-me.txt/name=\"GNUprintbuffer\" " |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
185 (mapconcat 'identity switches " ")) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
186 nil nil nil))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
187 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
188 ;;; |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
189 ;;; Fuctions for using Emacs as a VMS Mail editor |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
190 ;;; |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
191 (autoload 'vms-pmail-setup "vms-pmail" |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
192 "Set up file assuming use by VMS Mail utility. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
193 The buffer is put into text-mode, auto-save is turned off and the |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
194 following bindings are established. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
195 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
196 \\[vms-pmail-save-and-exit] vms-pmail-save-and-exit |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
197 \\[vms-pmail-abort] vms-pmail-abort |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
198 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
199 All other Emacs commands are still available." |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
200 t) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
201 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
202 ;;; |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
203 ;;; Filename handling in the minibuffer |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
204 ;;; |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
205 (defun vms-magic-right-square-brace () |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
206 "\ |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
207 Insert a right square brace, but do other things first depending on context. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
208 During filename completion, when point is at the end of the line and the |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
209 character before is not a right square brace, do one of three things before |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
210 inserting the brace: |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
211 - If there are already two left square braces preceding, do nothing special. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
212 - If there is a previous right-square-brace, convert it to dot. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
213 - If the character before is dot, delete it. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
214 Additionally, if the preceding chars are right-square-brace followed by |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
215 either \"-\" or \"..\", strip one level of directory hierarchy." |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
216 (interactive) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
217 (when (and minibuffer-completing-file-name |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
218 (= (point) (point-max)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
219 (not (= 93 (char-before)))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
220 (cond |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
221 ;; Avoid clobbering: user:[one.path][another.path |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
222 ((search-backward "[" (field-beginning) t 2)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
223 ((search-backward "]" (field-beginning) t) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
224 (delete-char 1) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
225 (insert ".") |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
226 (goto-char (point-max))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
227 ((= ?. (char-before)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
228 (delete-char -1))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
229 (goto-char (point-max)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
230 (let ((specs '(".." "-")) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
231 (pmax (point-max))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
232 (while specs |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
233 (let* ((up (car specs)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
234 (len (length up)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
235 (cut (- (point) len))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
236 (when (and (< (1+ len) pmax) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
237 (= ?. (char-before cut)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
238 (string= up (buffer-substring cut (point)))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
239 (delete-char (- (1+ len))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
240 (while (not (let ((c (char-before))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
241 (or (= ?. c) (= 91 c)))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
242 (delete-char -1)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
243 (when (= ?. (char-before)) (delete-char -1)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
244 (setq specs nil))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
245 (setq specs (cdr specs))))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
246 (insert "]")) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
247 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
248 (defun vms-magic-colon () |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
249 "\ |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
250 Insert a colon, but do other things first depending on context. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
251 During filename completion, when point is at the end of the line |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
252 and the line contains a right square brace, remove all characters |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
253 from the beginning of the line up to and including such brace. |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
254 This enables one to type a new filespec without having to delete |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
255 the old one." |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
256 (interactive) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
257 (when (and minibuffer-completing-file-name |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
258 (= (point) (point-max)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
259 (search-backward "]" (field-beginning) t)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
260 (delete-region (field-beginning) (1+ (point))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
261 (goto-char (point-max))) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
262 (insert ":")) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
263 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
264 (let ((m minibuffer-local-completion-map)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
265 (define-key m "]" 'vms-magic-right-square-brace) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
266 (define-key m "/" 'vms-magic-right-square-brace) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
267 (define-key m ":" 'vms-magic-colon)) |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
268 |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
269 ;; arch-tag: c178494e-2c37-4d02-99b7-e47e615656cf |
090433f48c5f
* vms-patch.el, vmsproc.el, mail/vms-pmail.el: Move to obsolete dir.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
270 ;;; vms-patch.el ends here |