annotate lisp/efs/default-dir.el @ 114:8619ce7e4c50 r20-1b9

Import from CVS: tag r20-1b9
author cvs
date Mon, 13 Aug 2007 09:21:54 +0200
parents 4be1180a9e89
children 9f59509498e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1 ;; -*-Emacs-Lisp-*-
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3 ;;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4 ;; File: default-dir.el
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5 ;; RCS:
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
6 ;; Version: $Revision: 1.4 $
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7 ;; Description: Defines the function default-directory, for fancy handling
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8 ;; of the initial contents in the minibuffer when reading
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
9 ;; file names.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
10 ;; Authors: Sebastian Kremer <sk@thp.uni-koeln.de>
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
11 ;; Sandy Rutherford <sandy@ibm550.sissa.it>
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
12 ;; Created: Sun Jul 18 11:38:06 1993 by sandy on ibm550
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
13 ;;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
14 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
15
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
16 ;; This program is free software; you can redistribute it and/or modify
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
17 ;; it under the terms of the GNU General Public License as published by
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
18 ;; the Free Software Foundation; either version 1, or (at your option)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
19 ;; any later version.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
20
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
21 ;; This program is distributed in the hope that it will be useful,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
22 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
23 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
24 ;; GNU General Public License for more details.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
25
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
26 ;; You should have received a copy of the GNU General Public License
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
27 ;; along with GNU Emacs; see the file COPYING. If not, write to
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
28 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
29
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
30 (provide 'default-dir)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
31 (require 'efs-ovwrt)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
32
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
33 (defconst default-dir-emacs-variant
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
34 (cond ((string-match "XEmacs" emacs-version) 'xemacs)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
35 ((>= (string-to-int (substring emacs-version 0 2)) 19) 'fsf-19)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
36 (t 'fsf-18)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
37
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
38 ;;;###autoload
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
39 (defvar default-directory-function nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
40 "A function to call to compute the default-directory for the current buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
41 If this is nil, the function default-directory will return the value of the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
42 variable default-directory.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
43 Buffer local.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
44 (make-variable-buffer-local 'default-directory-function)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
45
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
46 ;; As a bonus we give shell-command history if possible.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
47 (defvar shell-command-history nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
48 "History list of previous shell commands.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
49
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
50 (defun default-directory ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
51 " Returns the default-directory for the current buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
52 Will use the variable default-directory-function if it non-nil."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
53 (if default-directory-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
54 (funcall default-directory-function)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
55 (if (eq default-dir-emacs-variant 'xemacs)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
56 (abbreviate-file-name default-directory t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
57 (abbreviate-file-name default-directory))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
58
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
59 ;;; Overloads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
60
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
61 (cond
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
62 ((or (featurep 'mule)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
63 (boundp 'MULE))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
64
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
65 (defun default-dir-find-file (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
66 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
67 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
68 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
69 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
70 (read-file-name "Find file: " (default-directory)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
71 (and current-prefix-arg
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
72 (read-coding-system "Coding-system: "))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
73 (default-dir-real-find-file file coding-system))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
74
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
75 (defun default-dir-find-file-other-window (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
76 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
77 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
78 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
79 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
80 (read-file-name "Find file in other window: " (default-directory)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
81 (and current-prefix-arg
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
82 (read-coding-system "Coding-system: "))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
83 (default-dir-real-find-file-other-window file coding-system))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
84
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
85 (defun default-dir-find-file-read-only (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
86 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
87 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
88 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
89 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
90 (read-file-name "Find file read-only: " (default-directory) nil t))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
91 (and current-prefix-arg
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
92 (read-coding-system "Coding-system: "))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
93 (default-dir-real-find-file-read-only file coding-system))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
94
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
95 (if (fboundp 'find-file-read-only-other-window)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
96 (progn
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
97 (defun default-dir-find-file-read-only-other-window
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
98 (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
99 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
100 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
101 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
102 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
103 (read-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
104 "Find file read-only in other window: "
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
105 (default-directory) nil t))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
106 (and current-prefix-arg
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
107 (read-coding-system "Coding-system: "))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
108 (default-dir-real-find-file-read-only-other-window file
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
109 coding-system))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
110
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
111 (if (fboundp 'find-file-other-frame)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
112 (progn
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
113 (defun default-dir-find-file-other-frame
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
114 (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
115 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
116 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
117 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
118 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
119 (read-file-name "Find file in other frame: "
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
120 (default-directory)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
121 (and current-prefix-arg
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
122 (read-coding-system "Coding-system: "))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
123 (default-dir-real-find-file-other-frame file
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
124 coding-system))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
125
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
126 (if (fboundp 'find-file-read-only-other-frame)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
127 (progn
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
128 (defun default-dir-find-file-read-only-other-frame
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
129 (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
130 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
131 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
132 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
133 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
134 (read-file-name "Find file read-only in other frame: "
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
135 (default-directory) nil t))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
136 (and current-prefix-arg
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
137 (read-coding-system "Coding-system: "))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
138 (default-dir-real-find-file-read-only-other-frame file
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
139 coding-system)))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
140
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
141 (default-dir-find-file-takes-coding-system
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
142 ;; This lossage is due to the fact that XEmacs 20.x without mule
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
143 ;; still accepts an optional argument for find-file related
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
144 ;; functions. Things like advice.el insist on passing nil for
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
145 ;; optional arguments, and the interaction screws things up.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
146 ;; Therefore these functions accept an optional dummy coding-system
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
147 ;; argument.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
148
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
149 (defun default-dir-find-file (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
150 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
151 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
152 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
153 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
154 (read-file-name "Find file: " (default-directory)))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
155 (default-dir-real-find-file file coding-system))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
156
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
157 (defun default-dir-find-file-other-window (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
158 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
159 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
160 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
161 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
162 (read-file-name "Find file in other window: " (default-directory)))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
163 (default-dir-real-find-file-other-window file coding-system))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
164
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
165 (defun default-dir-find-file-read-only (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
166 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
167 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
168 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
169 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
170 (read-file-name "Find file read-only: " (default-directory) nil t))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
171 (default-dir-real-find-file-read-only file coding-system))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
172
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
173 (if (fboundp 'find-file-read-only-other-window)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
174 (progn
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
175 (defun default-dir-find-file-read-only-other-window
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
176 (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
177 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
178 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
179 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
180 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
181 (read-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
182 "Find file read-only in other window: "
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
183 (default-directory) nil t))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
184 (default-dir-real-find-file-read-only-other-window file))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
185
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
186 (if (fboundp 'find-file-other-frame)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
187 (progn
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
188 (defun default-dir-find-file-other-frame
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
189 (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
190 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
191 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
192 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
193 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
194 (read-file-name "Find file in other frame: "
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
195 (default-directory)))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
196 (default-dir-real-find-file-other-frame file))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
197
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
198 (if (fboundp 'find-file-read-only-other-frame)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
199 (progn
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
200 (defun default-dir-find-file-read-only-other-frame
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
201 (file &optional coding-system)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
202 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
203 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
204 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
205 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
206 (read-file-name "Find file read-only in other frame: "
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
207 (default-directory) nil t))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
208 (default-dir-real-find-file-read-only-other-frame file)))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
209
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
210 (t
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
211 (defun default-dir-find-file (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
212 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
213 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
214 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
215 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
216 (read-file-name "Find file: " (default-directory)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
217 (default-dir-real-find-file file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
218
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
219 (defun default-dir-find-file-other-window (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
220 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
221 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
222 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
223 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
224 (read-file-name "Find file in other window: " (default-directory)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
225 (default-dir-real-find-file-other-window file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
226
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
227 (defun default-dir-find-file-read-only (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
228 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
229 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
230 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
231 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
232 (read-file-name "Find file read-only: " (default-directory) nil t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
233 (default-dir-real-find-file-read-only file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
234
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
235 (if (fboundp 'find-file-read-only-other-window)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
236 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
237 (defun default-dir-find-file-read-only-other-window (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
238 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
239 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
240 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
241 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
242 (read-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
243 "Find file read-only in other window: "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
244 (default-directory) nil t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
245 (default-dir-real-find-file-read-only-other-window file))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
246
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
247 (if (fboundp 'find-file-other-frame)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
248 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
249 (defun default-dir-find-file-other-frame (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
250 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
251 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
252 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
253 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
254 (read-file-name "Find file in other frame: "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
255 (default-directory)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
256 (default-dir-real-find-file-other-frame file))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
257
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
258 (if (fboundp 'find-file-read-only-other-frame)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
259 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
260 (defun default-dir-find-file-read-only-other-frame (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
261 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
262 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
263 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
264 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
265 (read-file-name "Find file read-only in other frame: "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
266 (default-directory) nil t))))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
267 (default-dir-real-find-file-read-only-other-frame file))))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
268
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
269
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
270
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
271 (efs-overwrite-fn "default-dir" 'find-file 'default-dir-find-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
272 (efs-overwrite-fn "default-dir" 'find-file-other-window
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
273 'default-dir-find-file-other-window)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
274 (if (fboundp 'find-file-other-frame)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
275 (efs-overwrite-fn "default-dir" 'find-file-other-frame
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
276 'default-dir-find-file-other-frame))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
277 (efs-overwrite-fn "default-dir" 'find-file-read-only
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
278 'default-dir-find-file-read-only)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
279 (if (fboundp 'find-file-read-only-other-window)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
280 (efs-overwrite-fn "default-dir" 'find-file-read-only-other-window
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
281 'default-dir-find-file-read-only-other-window))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
282 (if (fboundp 'find-file-read-only-other-frame)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
283 (efs-overwrite-fn "default-dir" 'find-file-read-only-other-frame
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
284 'default-dir-find-file-read-only-other-frame))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
285
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
286
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
287 (defun default-dir-load-file (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
288 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
289 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
290 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
291 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
292 (read-file-name "Load file: " (default-directory) nil t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
293 (default-dir-real-load-file file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
294
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
295 (efs-overwrite-fn "default-dir" 'load-file 'default-dir-load-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
296
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
297 (condition-case nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
298 (require 'view-less)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
299 (error (require 'view)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
300
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
301 (defun default-dir-view-file (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
302 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
303 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
304 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
305 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
306 (read-file-name "View file: " (default-directory) nil t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
307 (default-dir-real-view-file file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
308
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
309 (efs-overwrite-fn "default-dir" 'view-file 'default-dir-view-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
310
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
311 (if (fboundp 'view-file-other-window)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
312 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
313 (defun default-dir-view-file-other-window (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
314 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
315 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
316 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
317 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
318 (read-file-name "View file in other window: "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
319 (default-directory) nil t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
320 (default-dir-real-view-file-other-window file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
321 (efs-overwrite-fn "default-dir" 'view-file-other-window
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
322 'default-dir-view-file-other-window)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
323
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
324 (if (fboundp 'view-file-other-frame)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
325 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
326 (defun default-dir-view-file-other-frame (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
327 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
328 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
329 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
330 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
331 (read-file-name "View file in other frame: "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
332 (default-directory) nil t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
333 (default-dir-real-view-file-other-frame file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
334 (efs-overwrite-fn "default-dir" 'view-file-other-frame
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
335 'default-dir-view-file-other-frame)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
336
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
337
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
338 (defun default-dir-shell-command (command &optional insert)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
339 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
340 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
341 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
342 (let ((prompt (format "Shell command in %s: " (default-directory))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
343 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
344 ((memq default-dir-emacs-variant '(fsf-19 xemacs))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
345 (read-from-minibuffer prompt nil nil nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
346 'shell-command-history))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
347 ((featurep 'gmhist)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
348 (let ((minibuffer-history-symbol 'shell-command-history))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
349 (read-string prompt)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
350 (t (read-string prompt))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
351 current-prefix-arg))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
352 (let ((default-directory (expand-file-name (default-directory))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
353 (default-dir-real-shell-command command insert)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
354
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
355 (efs-overwrite-fn "default-dir" 'shell-command 'default-dir-shell-command)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
356
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
357 (defun default-dir-cd (dir)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
358 "Documented as original"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
359 (interactive
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
360 (list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
361 (expand-file-name
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
362 (read-file-name "Change default directory: " (default-directory)))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
363 (default-dir-real-cd dir))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
364
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 100
diff changeset
365 (efs-overwrite-fn "default-dir" 'cd 'default-dir-cd)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
366
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
367 (defun default-dir-set-visited-file-name (filename)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
368 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
369 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
370 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
371 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
372 (read-file-name "Set visited file name: " (default-directory)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
373 (default-dir-real-set-visited-file-name filename))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
374
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
375 (efs-overwrite-fn "default-dir" 'set-visited-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
376 'default-dir-set-visited-file-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
377
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
378 (defun default-dir-insert-file (filename &rest args)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
379 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
380 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
381 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
382 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
383 (read-file-name "Insert file: " (default-directory) nil t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
384 (apply 'default-dir-real-insert-file filename args))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
385
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
386 (efs-overwrite-fn "default-dir" 'insert-file 'default-dir-insert-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
387
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
388 (defun default-dir-append-to-file (start end filename &rest args)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
389 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
390 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
391 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
392 (or (mark) (error "The mark is not set now"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
393 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
394 (min (mark) (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
395 (max (mark) (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
396 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
397 (read-file-name "Append to file: " (default-directory))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
398 (apply 'default-dir-real-append-to-file start end filename args))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
399
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
400 (efs-overwrite-fn "default-dir" 'append-to-file 'default-dir-append-to-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
401
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
402 (defun default-dir-delete-file (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
403 "Documented as original"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
404 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
405 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
406 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
407 (read-file-name "Delete file: " (default-directory) nil t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
408 (default-dir-real-delete-file file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
409
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
410 (efs-overwrite-fn "default-dir" 'delete-file 'default-dir-delete-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
411
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
412 ;;; end of default-dir.el