54
54
55
55
; ;;; File handling.
56
56
57
- (defun x-file-dialog (prompt dir default_filename mustmatch only_dir_p )
58
- " Read file name, prompting with PROMPT in directory DIR.
59
- Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file
60
- selection box, if specified. If MUSTMATCH is non-nil, the returned file
61
- or directory must exist.
62
-
63
- This function is only defined on PGTK, MS Windows, and X Windows with the
64
- Motif or Gtk toolkits. With the Motif toolkit, ONLY-DIR-P is ignored.
65
- Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories."
66
- (pgtk-read-file-name prompt dir mustmatch default_filename only_dir_p))
67
-
68
- (defun pgtk-open-file-using-panel ()
69
- " Pop up open-file panel, and load the result in a buffer."
70
- (interactive )
71
- ; ; Prompt dir defaultName isLoad initial.
72
- (setq pgtk-input-file (pgtk-read-file-name " Select File to Load" nil t nil ))
73
- (if pgtk-input-file
74
- (and (setq pgtk-input-file (list pgtk-input-file)) (pgtk-find-file))))
75
-
76
- (defun pgtk-write-file-using-panel ()
77
- " Pop up save-file panel, and save buffer in resulting name."
78
- (interactive )
79
- (let (pgtk-output-file)
80
- ; ; Prompt dir defaultName isLoad initial.
81
- (setq pgtk-output-file (pgtk-read-file-name " Save As" nil nil nil ))
82
- (message pgtk-output-file)
83
- (if pgtk-output-file (write-file pgtk-output-file))))
84
-
85
57
(defcustom pgtk-pop-up-frames 'fresh
86
58
" Non-nil means open files upon request from the Workspace in a new frame.
87
59
If t, always do so. Any other non-nil value means open a new frame
@@ -94,33 +66,6 @@ unless the current buffer is a scratch buffer."
94
66
95
67
(declare-function pgtk-hide-emacs " pgtkfns.c" (on))
96
68
97
- (defun pgtk-find-file ()
98
- " Do a `find-file' with the `pgtk-input-file' as argument."
99
- (interactive )
100
- (let* ((f (file-truename
101
- (expand-file-name (pop pgtk-input-file)
102
- command-line-default-directory)))
103
- (file (find-file-noselect f))
104
- (bufwin1 (get-buffer-window file 'visible ))
105
- (bufwin2 (get-buffer-window " *scratch*" 'visible )))
106
- (cond
107
- (bufwin1
108
- (select-frame (window-frame bufwin1))
109
- (raise-frame (window-frame bufwin1))
110
- (select-window bufwin1))
111
- ((and (eq pgtk-pop-up-frames 'fresh ) bufwin2)
112
- (pgtk-hide-emacs 'activate )
113
- (select-frame (window-frame bufwin2))
114
- (raise-frame (window-frame bufwin2))
115
- (select-window bufwin2)
116
- (find-file f))
117
- (pgtk-pop-up-frames
118
- (pgtk-hide-emacs 'activate )
119
- (let ((pop-up-frames t )) (pop-to-buffer file nil )))
120
- (t
121
- (pgtk-hide-emacs 'activate )
122
- (find-file f)))))
123
-
124
69
125
70
(defun pgtk-drag-n-drop (event &optional new-frame force-text )
126
71
" Edit the files listed in the drag-n-drop EVENT.
0 commit comments