MULE support for efs.
Ishikawa Ichiro (ichiro@ccsr.u-tokyo.ac.jp)
Sat, 20 Aug 1994 11:26:55 +0900
>>>>> "sandy" == sandy <sandy@ibm550.sissa.it> writes:
sandy> 10. Added MULE support for default-dir and dired. It was based on
sandy> patches contributed by Ishikawa Ichiro. Thanks.
I've made some fixes on efs-1.10 to support MULE.
I've made a mistake in the previous patch. find-file-other-frame and
view-file is not re-defined by the current version of MULE.
Following is the revised patch.
diff -aruN /home/acc1/ichiro/tmp/efs-1.10 /home/acc1/ichiro/tmp/efs-1.10-local
diff -aruN /home/acc1/ichiro/tmp/efs-1.10/default-dir-mule.el /home/acc1/ichiro/tmp/efs-1.10-local/default-dir-mule.el
--- /home/acc1/ichiro/tmp/efs-1.10/default-dir-mule.el Thu Jan 1 09:00:00 1970
+++ /home/acc1/ichiro/tmp/efs-1.10-local/default-dir-mule.el Sat Aug 20 11:06:45 1994
@@ -0,0 +1,59 @@
+;; MULE support for efs.
+
+(require 'default-dir)
+
+(defun default-dir-find-file (file &optional coding-system &rest args)
+ "Documented as original"
+ (interactive
+ (list
+ (expand-file-name
+ (read-file-name "Find file: " (default-directory)))
+ (and current-prefix-arg
+ (read-coding-system "Coding-system: "))))
+ (apply 'default-dir-real-find-file file coding-system args))
+
+(efs-overwrite-fn "default-dir" 'find-file 'default-dir-find-file)
+
+(defun default-dir-find-file-other-window (file &optional coding-system &rest args)
+ "Documented as original"
+ (interactive
+ (list
+ (expand-file-name
+ (read-file-name "Find file in other window: " (default-directory)))
+ (and current-prefix-arg
+ (read-coding-system "Coding-system: "))))
+ (apply 'default-dir-real-find-file-other-window file coding-system args))
+
+(efs-overwrite-fn "default-dir" 'find-file-other-window
+ 'default-dir-find-file-other-window)
+
+(defun default-dir-find-file-read-only (file &optional coding-system &rest args)
+ "Documented as original"
+ (interactive
+ (list
+ (expand-file-name
+ (read-file-name "Find file read-only: " (default-directory) nil t))
+ (and current-prefix-arg
+ (read-coding-system "Coding-system: "))))
+ (apply 'default-dir-real-find-file-read-only file coding-system args))
+
+(efs-overwrite-fn "default-dir" 'find-file-read-only
+ 'default-dir-find-file-read-only)
+
+(if (fboundp 'find-file-read-only-other-window)
+ (progn
+ (defun default-dir-find-file-read-only-other-window (file &optional coding-system &rest args)
+ "Documented as original"
+ (interactive
+ (list
+ (expand-file-name
+ (read-file-name
+ "Find file read-only in other window: "
+ (default-directory) nil t))
+ (and current-prefix-arg
+ (read-coding-system "Coding-system: "))))
+ (apply 'default-dir-real-find-file-read-only-other-window file coding-system args))
+ (efs-overwrite-fn "default-dir" 'find-file-read-only-other-window
+ 'default-dir-find-file-read-only-other-window)))
+
+(provide 'default-dir-mule)
\ No newline at end of file
diff -aruN /home/acc1/ichiro/tmp/efs-1.10/default-dir.el /home/acc1/ichiro/tmp/efs-1.10-local/default-dir.el
--- /home/acc1/ichiro/tmp/efs-1.10/default-dir.el Mon Aug 1 03:43:01 1994
+++ /home/acc1/ichiro/tmp/efs-1.10-local/default-dir.el Sat Aug 20 11:06:02 1994
@@ -61,26 +61,55 @@
;;; Overloads
-(defun default-dir-find-file (file &rest args)
- "Documented as original"
- (interactive
- (list
- (expand-file-name
- (read-file-name "Find file: " (default-directory)))))
- (apply 'default-dir-real-find-file file args))
-
-(efs-overwrite-fn "default-dir" 'find-file 'default-dir-find-file)
-
-(defun default-dir-find-file-other-window (file &rest args)
- "Documented as original"
- (interactive
- (list
- (expand-file-name
- (read-file-name "Find file in other window: " (default-directory)))))
- (apply 'default-dir-real-find-file-other-window file args))
-
-(efs-overwrite-fn "default-dir" 'find-file-other-window
- 'default-dir-find-file-other-window)
+(if (boundp 'MULE)
+ ;; For mule, these functions get defined in dired-mule.el
+ (require 'default-dir-mule)
+
+ (defun default-dir-find-file (file &rest args)
+ "Documented as original"
+ (interactive
+ (list
+ (expand-file-name
+ (read-file-name "Find file: " (default-directory)))))
+ (apply 'default-dir-real-find-file file args))
+
+ (efs-overwrite-fn "default-dir" 'find-file 'default-dir-find-file)
+
+ (defun default-dir-find-file-other-window (file &rest args)
+ "Documented as original"
+ (interactive
+ (list
+ (expand-file-name
+ (read-file-name "Find file in other window: " (default-directory)))))
+ (apply 'default-dir-real-find-file-other-window file args))
+
+ (efs-overwrite-fn "default-dir" 'find-file-other-window
+ 'default-dir-find-file-other-window)
+
+ (defun default-dir-find-file-read-only (file &rest args)
+ "Documented as original"
+ (interactive
+ (list
+ (expand-file-name
+ (read-file-name "Find file read-only: " (default-directory) nil t))))
+ (apply 'default-dir-real-find-file-read-only file args))
+
+ (efs-overwrite-fn "default-dir" 'find-file-read-only
+ 'default-dir-find-file-read-only)
+
+ (if (fboundp 'find-file-read-only-other-window)
+ (progn
+ (defun default-dir-find-file-read-only-other-window (file &rest args)
+ "Documented as original"
+ (interactive
+ (list
+ (expand-file-name
+ (read-file-name
+ "Find file read-only in other window: "
+ (default-directory) nil t))))
+ (apply 'default-dir-real-find-file-read-only-other-window file args))
+ (efs-overwrite-fn "default-dir" 'find-file-read-only-other-window
+ 'default-dir-find-file-read-only-other-window))))
(if (fboundp 'find-file-other-frame)
(progn
@@ -93,31 +122,6 @@
(apply 'default-dir-real-find-file-other-frame file args))
(efs-overwrite-fn "default-dir" 'find-file-other-frame
'default-dir-find-file-other-frame)))
-
-(defun default-dir-find-file-read-only (file &rest args)
- "Documented as original"
- (interactive
- (list
- (expand-file-name
- (read-file-name "Find file read-only: " (default-directory) nil t))))
- (apply 'default-dir-real-find-file-read-only file args))
-
-(efs-overwrite-fn "default-dir" 'find-file-read-only
- 'default-dir-find-file-read-only)
-
-(if (fboundp 'find-file-read-only-other-window)
- (progn
- (defun default-dir-find-file-read-only-other-window (file &rest args)
- "Documented as original"
- (interactive
- (list
- (expand-file-name
- (read-file-name
- "Find file read-only in other window: "
- (default-directory) nil t))))
- (apply 'default-dir-real-find-file-read-only-other-window file args))
- (efs-overwrite-fn "default-dir" 'find-file-read-only-other-window
- 'default-dir-find-file-read-only-other-window)))
(if (fboundp 'find-file-read-only-other-frame)
(progn
diff -aruN /home/acc1/ichiro/tmp/efs-1.10/dired-mule.el /home/acc1/ichiro/tmp/efs-1.10-local/dired-mule.el
--- /home/acc1/ichiro/tmp/efs-1.10/dired-mule.el Mon Aug 1 03:43:03 1994
+++ /home/acc1/ichiro/tmp/efs-1.10-local/dired-mule.el Sat Aug 20 11:05:25 1994
@@ -20,17 +20,6 @@
(interactive "ZCoding-system: ")
(find-file (dired-get-filename) coding-system))
-(defun dired-view-file (&optional coding-system)
- "In dired, examine a file in view mode, returning to dired when done.
-When file is a directory, show it in this buffer if it is inserted;
-otherwise, display it in another buffer."
- (interactive "ZCoding-system: ")
- (let ((file (dired-get-filename)))
- (if (file-directory-p file)
- (or (dired-goto-subdir file)
- (dired file))
- (view-file file coding-system))))
-
(defun dired-find-file-other-window (&optional display coding-system)
"In dired, visit this file or directory in another window.
With a prefix, the file is displayed, but the window is not selected."
@@ -45,11 +34,6 @@
(interactive (list (dired-get-filename)))
(display-buffer (find-file-noselect file)))
-;; Only for Emacs 19
-(defun dired-find-file-other-frame (&optional coding-system)
- "In dired, visit this file or directory in another frame.
-Only works for Emacs 19, or later."
- (interactive "ZCoding-system: ")
- (find-file-other-frame (dired-get-filename) coding-system))
+(provide 'dired-mule)
;;; end of dired-mule.el
diff -aruN /home/acc1/ichiro/tmp/efs-1.10/dired.el /home/acc1/ichiro/tmp/efs-1.10-local/dired.el
--- /home/acc1/ichiro/tmp/efs-1.10/dired.el Fri Aug 19 09:56:50 1994
+++ /home/acc1/ichiro/tmp/efs-1.10-local/dired.el Sat Aug 20 11:05:01 1994
@@ -2689,24 +2689,13 @@
(if (boundp 'MULE)
;; For mule, these functions get defined in dired-mule.el
- (load "dired-mule")
+ (require 'dired-mule)
(defun dired-find-file ()
"In dired, visit the file or directory named on this line."
(interactive)
(find-file (dired-get-filename)))
- (defun dired-view-file ()
- "In dired, examine a file in view mode, returning to dired when done.
-When file is a directory, show it in this buffer if it is inserted;
-otherwise, display it in another buffer."
- (interactive)
- (let ((file (dired-get-filename)))
- (if (file-directory-p file)
- (or (dired-goto-subdir file)
- (dired file))
- (view-file file))))
-
(defun dired-find-file-other-window (&optional display)
"In dired, visit this file or directory in another window.
With a prefix, the file is displayed, but the window is not selected."
@@ -2714,14 +2703,24 @@
(let ((file (dired-get-filename)))
(if display
(dired-display-file file)
- (find-file-other-window file))))
+ (find-file-other-window file)))))
- ;; Only for Emacs 19
- (defun dired-find-file-other-frame ()
- "In dired, visit this file or directory in another frame."
- (interactive)
- (find-file-other-frame (dired-get-filename))))
+;; Only for Emacs 19
+(defun dired-find-file-other-frame ()
+ "In dired, visit this file or directory in another frame."
+ (interactive)
+ (find-file-other-frame (dired-get-filename)))
+(defun dired-view-file ()
+ "In dired, examine a file in view mode, returning to dired when done.
+When file is a directory, show it in this buffer if it is inserted;
+otherwise, display it in another buffer."
+ (interactive)
+ (let ((file (dired-get-filename)))
+ (if (file-directory-p file)
+ (or (dired-goto-subdir file)
+ (dired file))
+ (view-file file))))
(defun dired-display-file (file)
"In dired, displays this file or directory in the other window."
diff -aruN /home/acc1/ichiro/tmp/efs-1.10/efs-dired-mule.el /home/acc1/ichiro/tmp/efs-1.10-local/efs-dired-mule.el
--- /home/acc1/ichiro/tmp/efs-1.10/efs-dired-mule.el Thu Jan 1 09:00:00 1970
+++ /home/acc1/ichiro/tmp/efs-1.10-local/efs-dired-mule.el Sat Aug 20 11:07:40 1994
@@ -0,0 +1,25 @@
+;; MULE support for efs-dired.
+
+(require 'efs-dired)
+
+(defun efs-dired-find-file (&optional coding-system)
+ "Documented as original."
+ (interactive "ZCoding-system: ")
+ (find-file
+ (if (memq efs-dired-host-type efs-version-host-types)
+ (efs-internal-file-name-sans-versions
+ efs-dired-host-type (dired-get-filename) t)
+ (dired-get-filename))
+ coding-system))
+
+(defun efs-dired-find-file-other-window (&optional coding-system)
+ "Documented as original."
+ (interactive "ZCoding-system: ")
+ (find-file-other-window
+ (if (memq efs-dired-host-type efs-version-host-types)
+ (efs-internal-file-name-sans-versions
+ efs-dired-host-type (dired-get-filename) t)
+ (dired-get-filename))
+ coding-system))
+
+(provide 'efs-dired-mule)
diff -aruN /home/acc1/ichiro/tmp/efs-1.10/efs-dired.el /home/acc1/ichiro/tmp/efs-1.10-local/efs-dired.el
--- /home/acc1/ichiro/tmp/efs-1.10/efs-dired.el Wed Aug 17 06:15:54 1994
+++ /home/acc1/ichiro/tmp/efs-1.10-local/efs-dired.el Sat Aug 20 11:07:18 1994
@@ -423,23 +423,27 @@
"Documented as original."
(efs-real-dired-get-filename localp no-error-if-not-filep))
-(defun efs-dired-find-file ()
- "Documented as original."
- (interactive)
- (find-file
- (if (memq efs-dired-host-type efs-version-host-types)
- (efs-internal-file-name-sans-versions
- efs-dired-host-type (dired-get-filename) t)
- (dired-get-filename))))
+(if (boundp 'MULE)
+ ;; For mule, these functions get defined in dired-mule.el
+ (require 'efs-dired-mule)
-(defun efs-dired-find-file-other-window ()
- "Documented as original."
- (interactive)
- (find-file-other-window
- (if (memq efs-dired-host-type efs-version-host-types)
- (efs-internal-file-name-sans-versions
- efs-dired-host-type (dired-get-filename) t)
- (dired-get-filename))))
+ (defun efs-dired-find-file ()
+ "Documented as original."
+ (interactive)
+ (find-file
+ (if (memq efs-dired-host-type efs-version-host-types)
+ (efs-internal-file-name-sans-versions
+ efs-dired-host-type (dired-get-filename) t)
+ (dired-get-filename))))
+
+ (defun efs-dired-find-file-other-window ()
+ "Documented as original."
+ (interactive)
+ (find-file-other-window
+ (if (memq efs-dired-host-type efs-version-host-types)
+ (efs-internal-file-name-sans-versions
+ efs-dired-host-type (dired-get-filename) t)
+ (dired-get-filename)))))
(defun efs-dired-find-file-other-frame ()
"Documented as original."