Mercurial > emacs
diff src/w32fns.c @ 90043:e24e2e78deda
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-69
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-643
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-649
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-651
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-655
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-656
Update from CVS: lisp/man.el (Man-xref-normal-file): Fix help-echo.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-657
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-658
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-659
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-660
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-661
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-667
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-668
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-61
- miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-68
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 04 Nov 2004 08:55:40 +0000 |
parents | f3ec05478165 71ea49de0560 |
children | cb67264d6096 |
line wrap: on
line diff
--- a/src/w32fns.c Fri Oct 29 00:25:02 2004 +0000 +++ b/src/w32fns.c Thu Nov 04 08:55:40 2004 +0000 @@ -5667,14 +5667,12 @@ char * fontname; char * pattern; { + char *ptr; char *font_name_copy; - char *ptr; - Lisp_Object encoded_font_name; char *regex = alloca (strlen (pattern) * 2 + 3); - /* Convert fontname to unibyte for match. */ - encoded_font_name = string_make_unibyte (build_string (fontname)); - font_name_copy = SDATA (encoded_font_name); + font_name_copy = alloca (strlen (fontname) + 1); + strcpy (font_name_copy, fontname); ptr = regex; *ptr++ = '^'; @@ -5712,8 +5710,8 @@ return FALSE; } - return (fast_c_string_match_ignore_case (build_string (regex), - font_name_copy) >= 0); + return (fast_string_match_ignore_case (build_string (regex), + build_string(font_name_copy)) >= 0); } /* Callback functions, and a structure holding info they need, for @@ -6459,7 +6457,7 @@ } DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, - doc: /* Returns the vendor ID string of the W32 system (Microsoft). + doc: /* Returns the "vendor ID" string of the W32 system (Microsoft). 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. */) @@ -6472,7 +6470,7 @@ DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, doc: /* Returns the version numbers of the server of DISPLAY. The value is a list of three integers: the major and minor -version numbers, and the vendor-specific release +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. @@ -7803,23 +7801,24 @@ return 0; } -DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 4, 0, +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. Ensure that file exists if MUSTMATCH is non-nil. */) - (prompt, dir, default_filename, mustmatch) - Lisp_Object prompt, dir, default_filename, mustmatch; +specified. Ensure that file exists if MUSTMATCH is non-nil. +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; { struct frame *f = SELECTED_FRAME (); Lisp_Object file = Qnil; int count = SPECPDL_INDEX (); - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; char filename[MAX_PATH + 1]; char init_dir[MAX_PATH + 1]; int default_filter_index = 1; /* 1: All Files, 2: Directories only */ - GCPRO5 (prompt, dir, default_filename, mustmatch, file); + GCPRO6 (prompt, dir, default_filename, mustmatch, only_dir_p, file); CHECK_STRING (prompt); CHECK_STRING (dir); @@ -7867,10 +7866,7 @@ file_details.lpstrInitialDir = init_dir; file_details.lpstrTitle = SDATA (prompt); - /* If prompt starts with Dired, default to directories only. */ - /* A bit hacky, but there doesn't seem to be a better way to - DTRT for dired. */ - if (strncmp (file_details.lpstrTitle, "Dired", 5) == 0) + if (! NILP (only_dir_p)) default_filter_index = 2; file_details.nFilterIndex = default_filter_index;