emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/w32fns.c [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/w32fns.c [lexbind]
Date: Thu, 04 Nov 2004 08:28:55 -0500

Index: emacs/src/w32fns.c
diff -c emacs/src/w32fns.c:1.173.2.19 emacs/src/w32fns.c:1.173.2.20
*** emacs/src/w32fns.c:1.173.2.19       Fri Oct 29 02:05:09 2004
--- emacs/src/w32fns.c  Thu Nov  4 13:12:22 2004
***************
*** 5607,5620 ****
      char * fontname;
      char * pattern;
  {
-   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);
  
    ptr = regex;
    *ptr++ = '^';
--- 5607,5618 ----
      char * fontname;
      char * pattern;
  {
    char *ptr;
!   char *font_name_copy;
    char *regex = alloca (strlen (pattern) * 2 + 3);
  
!   font_name_copy = alloca (strlen (fontname) + 1);
!   strcpy (font_name_copy, fontname);
  
    ptr = regex;
    *ptr++ = '^';
***************
*** 5652,5659 ****
        return FALSE;
    }
  
!   return (fast_c_string_match_ignore_case (build_string (regex),
!                                            font_name_copy) >= 0);
  }
  
  /* Callback functions, and a structure holding info they need, for
--- 5650,5657 ----
        return FALSE;
    }
  
!   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
***************
*** 7742,7764 ****
    return 0;
  }
  
! 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.  Ensure that file exists if MUSTMATCH is non-nil.  */)
!   (prompt, dir, default_filename, mustmatch)
!      Lisp_Object prompt, dir, default_filename, mustmatch;
  {
    struct frame *f = SELECTED_FRAME ();
    Lisp_Object file = Qnil;
    int count = SPECPDL_INDEX ();
!   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
    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);
    CHECK_STRING (prompt);
    CHECK_STRING (dir);
  
--- 7740,7763 ----
    return 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.
! 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, gcpro6;
    char filename[MAX_PATH + 1];
    char init_dir[MAX_PATH + 1];
    int default_filter_index = 1; /* 1: All Files, 2: Directories only  */
  
!   GCPRO6 (prompt, dir, default_filename, mustmatch, only_dir_p, file);
    CHECK_STRING (prompt);
    CHECK_STRING (dir);
  
***************
*** 7806,7815 ****
      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)
        default_filter_index = 2;
  
      file_details.nFilterIndex = default_filter_index;
--- 7805,7811 ----
      file_details.lpstrInitialDir = init_dir;
      file_details.lpstrTitle = SDATA (prompt);
  
!     if (! NILP (only_dir_p))
        default_filter_index = 2;
  
      file_details.nFilterIndex = default_filter_index;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]