/[emacs]/emacs/src/w32fns.c
ViewVC logotype

Diff of /emacs/src/w32fns.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.219.2.11 by miles, Fri Oct 22 10:13:34 2004 UTC revision 1.219.2.12 by miles, Thu Nov 4 08:55:31 2004 UTC
# Line 5667  w32_font_match (fontname, pattern) Line 5667  w32_font_match (fontname, pattern)
5667      char * fontname;      char * fontname;
5668      char * pattern;      char * pattern;
5669  {  {
   char *font_name_copy;  
5670    char *ptr;    char *ptr;
5671    Lisp_Object encoded_font_name;    char *font_name_copy;
5672    char *regex = alloca (strlen (pattern) * 2 + 3);    char *regex = alloca (strlen (pattern) * 2 + 3);
5673    
5674    /* Convert fontname to unibyte for match.  */    font_name_copy = alloca (strlen (fontname) + 1);
5675    encoded_font_name = string_make_unibyte (build_string (fontname));    strcpy (font_name_copy, fontname);
   font_name_copy = SDATA (encoded_font_name);  
5676    
5677    ptr = regex;    ptr = regex;
5678    *ptr++ = '^';    *ptr++ = '^';
# Line 5712  w32_font_match (fontname, pattern) Line 5710  w32_font_match (fontname, pattern)
5710        return FALSE;        return FALSE;
5711    }    }
5712    
5713    return (fast_c_string_match_ignore_case (build_string (regex),    return (fast_string_match_ignore_case (build_string (regex),
5714                                             font_name_copy) >= 0);                                           build_string(font_name_copy)) >= 0);
5715  }  }
5716    
5717  /* Callback functions, and a structure holding info they need, for  /* Callback functions, and a structure holding info they need, for
# Line 6459  If omitted or nil, that stands for the s Line 6457  If omitted or nil, that stands for the s
6457  }  }
6458    
6459  DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,  DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
6460         doc: /* Returns the vendor ID string of the W32 system (Microsoft).         doc: /* Returns the "vendor ID" string of the W32 system (Microsoft).
6461  The optional argument DISPLAY specifies which display to ask about.  The optional argument DISPLAY specifies which display to ask about.
6462  DISPLAY should be either a frame or a display name (a string).  DISPLAY should be either a frame or a display name (a string).
6463  If omitted or nil, that stands for the selected frame's display.  */)  If omitted or nil, that stands for the selected frame's display.  */)
# Line 6472  If omitted or nil, that stands for the s Line 6470  If omitted or nil, that stands for the s
6470  DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,  DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
6471         doc: /* Returns the version numbers of the server of DISPLAY.         doc: /* Returns the version numbers of the server of DISPLAY.
6472  The value is a list of three integers: the major and minor  The value is a list of three integers: the major and minor
6473  version numbers, and the vendor-specific release  version numbers of the X Protocol in use, and the distributor-specific release
6474  number.  See also the function `x-server-vendor'.  number.  See also the function `x-server-vendor'.
6475    
6476  The optional argument DISPLAY specifies which display to ask about.  The optional argument DISPLAY specifies which display to ask about.
# Line 7803  file_dialog_callback (hwnd, msg, wParam, Line 7801  file_dialog_callback (hwnd, msg, wParam,
7801    return 0;    return 0;
7802  }  }
7803    
7804  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,
7805         doc: /* Read file name, prompting with PROMPT in directory DIR.         doc: /* Read file name, prompting with PROMPT in directory DIR.
7806  Use a file selection dialog.  Use a file selection dialog.
7807  Select DEFAULT-FILENAME in the dialog's file selection box, if  Select DEFAULT-FILENAME in the dialog's file selection box, if
7808  specified.  Ensure that file exists if MUSTMATCH is non-nil.  */)  specified.  Ensure that file exists if MUSTMATCH is non-nil.
7809    (prompt, dir, default_filename, mustmatch)  If ONLY-DIR-P is non-nil, the user can only select directories.  */)
7810       Lisp_Object prompt, dir, default_filename, mustmatch;    (prompt, dir, default_filename, mustmatch, only_dir_p)
7811         Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
7812  {  {
7813    struct frame *f = SELECTED_FRAME ();    struct frame *f = SELECTED_FRAME ();
7814    Lisp_Object file = Qnil;    Lisp_Object file = Qnil;
7815    int count = SPECPDL_INDEX ();    int count = SPECPDL_INDEX ();
7816    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
7817    char filename[MAX_PATH + 1];    char filename[MAX_PATH + 1];
7818    char init_dir[MAX_PATH + 1];    char init_dir[MAX_PATH + 1];
7819    int default_filter_index = 1; /* 1: All Files, 2: Directories only  */    int default_filter_index = 1; /* 1: All Files, 2: Directories only  */
7820    
7821    GCPRO5 (prompt, dir, default_filename, mustmatch, file);    GCPRO6 (prompt, dir, default_filename, mustmatch, only_dir_p, file);
7822    CHECK_STRING (prompt);    CHECK_STRING (prompt);
7823    CHECK_STRING (dir);    CHECK_STRING (dir);
7824    
# Line 7867  specified.  Ensure that file exists if M Line 7866  specified.  Ensure that file exists if M
7866      file_details.lpstrInitialDir = init_dir;      file_details.lpstrInitialDir = init_dir;
7867      file_details.lpstrTitle = SDATA (prompt);      file_details.lpstrTitle = SDATA (prompt);
7868    
7869      /* If prompt starts with Dired, default to directories only.  */      if (! NILP (only_dir_p))
     /* 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)  
7870        default_filter_index = 2;        default_filter_index = 2;
7871    
7872      file_details.nFilterIndex = default_filter_index;      file_details.nFilterIndex = default_filter_index;

Legend:
Removed from v.1.219.2.11  
changed lines
  Added in v.1.219.2.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26