Skip to content

Commit 5e194ee

Browse files
author
Yuuki Harano
committed
remove pgtk-read-file-name and related functions.
simplified to x-file-dialog.
1 parent 08d0e5e commit 5e194ee

File tree

2 files changed

+4
-59
lines changed

2 files changed

+4
-59
lines changed

lisp/term/pgtk-win.el

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -54,34 +54,6 @@
5454

5555
;;;; File handling.
5656

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-
8557
(defcustom pgtk-pop-up-frames 'fresh
8658
"Non-nil means open files upon request from the Workspace in a new frame.
8759
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."
9466

9567
(declare-function pgtk-hide-emacs "pgtkfns.c" (on))
9668

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-
12469

12570
(defun pgtk-drag-n-drop (event &optional new-frame force-text)
12671
"Edit the files listed in the drag-n-drop EVENT.

src/pgtkfns.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2915,15 +2915,15 @@ visible. */)
29152915
return Qnil;
29162916
}
29172917

2918-
DEFUN ("pgtk-read-file-name", Fpgtk_read_file_name, Spgtk_read_file_name, 2, 5, 0,
2918+
DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0,
29192919
doc: /* Read file name, prompting with PROMPT in directory DIR.
29202920
Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file
29212921
selection box, if specified. If MUSTMATCH is non-nil, the returned file
29222922
or directory must exist.
29232923
2924-
This function is only defined on NS, MS Windows, and X Windows with the
2924+
This function is defined only on PGTK, NS, MS Windows, and X Windows with the
29252925
Motif or Gtk toolkits. With the Motif toolkit, ONLY-DIR-P is ignored.
2926-
Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories.
2926+
Otherwise, if ONLY-DIR-P is non-nil, the user can select only directories.
29272927
On MS Windows 7 and later, the file selection dialog "remembers" the last
29282928
directory where the user selected a file, and will open that directory
29292929
instead of DIR on subsequent invocations of this function with the same
@@ -3107,7 +3107,7 @@ be used as the image of the icon representing the frame. */);
31073107
defsubr (&Spgtk_print_frames_dialog);
31083108
defsubr (&Spgtk_backend_display_class);
31093109

3110-
defsubr (&Spgtk_read_file_name);
3110+
defsubr (&Sx_file_dialog);
31113111

31123112
as_status = 0;
31133113
as_script = Qnil;

0 commit comments

Comments
 (0)