[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/xfns.c [emacs-unicode-2]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/src/xfns.c [emacs-unicode-2] |
Date: |
Thu, 04 Nov 2004 04:09:42 -0500 |
Index: emacs/src/xfns.c
diff -c emacs/src/xfns.c:1.590.2.10 emacs/src/xfns.c:1.590.2.11
*** emacs/src/xfns.c:1.590.2.10 Wed Oct 27 05:42:01 2004
--- emacs/src/xfns.c Thu Nov 4 08:55:33 2004
***************
*** 3483,3489 ****
}
DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
! doc: /* Returns the vendor ID string of the X server of display
DISPLAY.
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
--- 3483,3491 ----
}
DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
! doc: /* Returns the "vendor ID" string of the X server of display
DISPLAY.
! \(Labelling every distributor as a "vendor" embodies the false assumption
! that operating systems cannot be developed and distributed noncommercially.)
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
***************
*** 3500,3506 ****
DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
doc: /* Returns the version numbers of the X server of display DISPLAY.
The value is a list of three integers: the major and minor
! version numbers of the X Protocol in use, and the vendor-specific release
number. See also the function `x-server-vendor'.
The optional argument DISPLAY specifies which display to ask about.
--- 3502,3508 ----
DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
doc: /* Returns the version numbers of the X server of display DISPLAY.
The value is a list of three integers: the major and minor
! version numbers of the X Protocol in use, and the distributor-specific release
number. See also the function `x-server-vendor'.
The optional argument DISPLAY specifies which display to ask about.
***************
*** 5088,5114 ****
}
! DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 4, 0,
doc: /* Read file name, prompting with PROMPT in directory DIR.
! Use a file selection dialog.
! Select DEFAULT-FILENAME in the dialog's file selection box, if
! specified. Don't let the user enter a file name in the file
! selection dialog's entry field, if MUSTMATCH is non-nil. */)
! (prompt, dir, default_filename, mustmatch)
! Lisp_Object prompt, dir, default_filename, mustmatch;
{
int result;
struct frame *f = SELECTED_FRAME ();
Lisp_Object file = Qnil;
! Widget dialog, text, list, help;
Arg al[10];
int ac = 0;
extern XtAppContext Xt_app_con;
XmString dir_xmstring, pattern_xmstring;
int count = SPECPDL_INDEX ();
! struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
! GCPRO5 (prompt, dir, default_filename, mustmatch, file);
CHECK_STRING (prompt);
CHECK_STRING (dir);
--- 5090,5115 ----
}
! DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0,
doc: /* Read file name, prompting with PROMPT in directory DIR.
! Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file
! selection box, if specified. If MUSTMATCH is non-nil, the returned file
! or directory must exist. ONLY-DIR-P is ignored." */)
! (prompt, dir, default_filename, mustmatch, only_dir_p)
! Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
{
int result;
struct frame *f = SELECTED_FRAME ();
Lisp_Object file = Qnil;
! Widget dialog, text, help;
Arg al[10];
int ac = 0;
extern XtAppContext Xt_app_con;
XmString dir_xmstring, pattern_xmstring;
int count = SPECPDL_INDEX ();
! struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
! GCPRO6 (prompt, dir, default_filename, mustmatch, only_dir_p, file);
CHECK_STRING (prompt);
CHECK_STRING (dir);
***************
*** 5141,5149 ****
XtAddCallback (dialog, XmNunmapCallback, file_dialog_unmap_cb,
(XtPointer) &result);
! /* Disable the help button since we can't display help. */
help = XmFileSelectionBoxGetChild (dialog, XmDIALOG_HELP_BUTTON);
! XtSetSensitive (help, False);
/* Mark OK button as default. */
XtVaSetValues (XmFileSelectionBoxGetChild (dialog, XmDIALOG_OK_BUTTON),
--- 5142,5150 ----
XtAddCallback (dialog, XmNunmapCallback, file_dialog_unmap_cb,
(XtPointer) &result);
! /* Remove the help button since we can't display help. */
help = XmFileSelectionBoxGetChild (dialog, XmDIALOG_HELP_BUTTON);
! XtUnmanageChild (help);
/* Mark OK button as default. */
XtVaSetValues (XmFileSelectionBoxGetChild (dialog, XmDIALOG_OK_BUTTON),
***************
*** 5165,5194 ****
/* Manage the dialog, so that list boxes get filled. */
XtManageChild (dialog);
- /* Select DEFAULT_FILENAME in the files list box. DEFAULT_FILENAME
- must include the path for this to work. */
- list = XmFileSelectionBoxGetChild (dialog, XmDIALOG_LIST);
if (STRINGP (default_filename))
{
XmString default_xmstring;
! int item_pos;
! default_xmstring
! = XmStringCreateLocalized (SDATA (default_filename));
! if (!XmListItemExists (list, default_xmstring))
! {
! /* Add a new item if DEFAULT_FILENAME is not in the list. */
! XmListAddItem (list, default_xmstring, 0);
! item_pos = 0;
! }
! else
! item_pos = XmListItemPos (list, default_xmstring);
! XmStringFree (default_xmstring);
! /* Select the item and scroll it into view. */
! XmListSelectPos (list, item_pos, True);
! XmListSetPos (list, item_pos);
}
/* Process events until the user presses Cancel or OK. */
--- 5166,5195 ----
/* Manage the dialog, so that list boxes get filled. */
XtManageChild (dialog);
if (STRINGP (default_filename))
{
XmString default_xmstring;
! Widget wtext = XmFileSelectionBoxGetChild (dialog, XmDIALOG_TEXT);
! Widget list = XmFileSelectionBoxGetChild (dialog, XmDIALOG_LIST);
! XmTextPosition last_pos = XmTextFieldGetLastPosition (wtext);
! XmTextFieldReplace (wtext, 0, last_pos,
! (SDATA (Ffile_name_nondirectory
(default_filename))));
! /* Select DEFAULT_FILENAME in the files list box. DEFAULT_FILENAME
! must include the path for this to work. */
!
! default_xmstring = XmStringCreateLocalized (SDATA (default_filename));
! if (XmListItemExists (list, default_xmstring))
! {
! int item_pos = XmListItemPos (list, default_xmstring);
! /* Select the item and scroll it into view. */
! XmListSelectPos (list, item_pos, True);
! XmListSetPos (list, item_pos);
! }
!
! XmStringFree (default_xmstring);
}
/* Process events until the user presses Cancel or OK. */
***************
*** 5232,5254 ****
#ifdef USE_GTK
! DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 4, 0,
! "Read file name, prompting with PROMPT in directory DIR.\n\
! Use a file selection dialog.\n\
! Select DEFAULT-FILENAME in the dialog's file selection box, if\n\
! specified. Don't let the user enter a file name in the file\n\
! selection dialog's entry field, if MUSTMATCH is non-nil.")
! (prompt, dir, default_filename, mustmatch)
! Lisp_Object prompt, dir, default_filename, mustmatch;
{
FRAME_PTR f = SELECTED_FRAME ();
char *fn;
Lisp_Object file = Qnil;
int count = specpdl_ptr - specpdl;
! struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
char *cdef_file;
! GCPRO5 (prompt, dir, default_filename, mustmatch, file);
CHECK_STRING (prompt);
CHECK_STRING (dir);
--- 5233,5255 ----
#ifdef USE_GTK
! DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0,
! doc: /* Read file name, prompting with PROMPT in directory DIR.
! Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file
! selection box, if specified. If MUSTMATCH is non-nil, the returned file
! or directory must exist. If ONLY-DIR-P is non-nil, the user can only select
! directories. */)
! (prompt, dir, default_filename, mustmatch, only_dir_p)
! Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
{
FRAME_PTR f = SELECTED_FRAME ();
char *fn;
Lisp_Object file = Qnil;
int count = specpdl_ptr - specpdl;
! struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
char *cdef_file;
! GCPRO6 (prompt, dir, default_filename, mustmatch, only_dir_p, file);
CHECK_STRING (prompt);
CHECK_STRING (dir);
***************
*** 5262,5268 ****
else
cdef_file = SDATA (dir);
! fn = xg_get_file_name (f, SDATA (prompt), cdef_file, ! NILP (mustmatch));
if (fn)
{
--- 5263,5271 ----
else
cdef_file = SDATA (dir);
! fn = xg_get_file_name (f, SDATA (prompt), cdef_file,
! ! NILP (mustmatch),
! ! NILP (only_dir_p));
if (fn)
{
- [Emacs-diffs] Changes to emacs/src/xfns.c [emacs-unicode-2],
Miles Bader <=