aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorKaroly Lorentey2005-06-15 12:57:51 +0000
committerKaroly Lorentey2005-06-15 12:57:51 +0000
commitef85512e51f043d73788f00a2aed13cccde0682c (patch)
treefc1fa1378533250f260ef8eaa9a84ae882d9df84 /src/w32fns.c
parent8736257554f49445f7b4402ac7a9436b38ce6452 (diff)
parentef88a9999004e6c26148c8d280d6a41f623d7249 (diff)
downloademacs-ef85512e51f043d73788f00a2aed13cccde0682c.tar.gz
emacs-ef85512e51f043d73788f00a2aed13cccde0682c.zip
Merged from miles@gnu.org--gnu-2005 (patch 80-82, 350-422)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-350 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-351 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-352 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-353 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-354 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-355 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-356 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-357 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-358 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-359 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-360 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-361 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-362 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-363 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-364 Remove "-face" suffix from widget faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365 Remove "-face" suffix from custom faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-366 Remove "-face" suffix from change-log faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-367 Remove "-face" suffix from compilation faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-368 Remove "-face" suffix from diff-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-369 lisp/longlines.el (longlines-visible-face): Face removed * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-370 Remove "-face" suffix from woman faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-371 Remove "-face" suffix from whitespace-highlight face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372 Remove "-face" suffix from ruler-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-373 Remove "-face" suffix from show-paren faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374 Remove "-face" suffix from log-view faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-375 Remove "-face" suffix from smerge faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-376 Remove "-face" suffix from show-tabs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-377 Remove "-face" suffix from highlight-changes faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-378 Remove "-face" suffix from and downcase info faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379 Remove "-face" suffix from pcvs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-380 Update uses of renamed pcvs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-381 Tweak ChangeLog * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-382 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-383 Remove "-face" suffix from strokes-char face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-384 Remove "-face" suffix from compare-windows face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-385 Remove "-face" suffix from calendar faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-386 Remove "-face" suffix from diary-button face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-387 Remove "-face" suffix from testcover faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-388 Remove "-face" suffix from viper faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-389 Remove "-face" suffix from org faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-390 Remove "-face" suffix from sgml-namespace face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-391 Remove "-face" suffix from table-cell face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-392 Remove "-face" suffix from tex-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-393 Remove "-face" suffix from texinfo-heading face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-394 Remove "-face" suffix from flyspell faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-395 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-396 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-397 Remove "-face" suffix from gomoku faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-398 Remove "-face" suffix from mpuz faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-399 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-400 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-401 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-402 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-403 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-404 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-405 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-406 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-407 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-408 Remove "-face" suffix from Buffer-menu-buffer face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-409 Remove "-face" suffix from antlr-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410 Remove "-face" suffix from ebrowse faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-411 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-412 Remove "-face" suffix from flymake faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-413 Remove "-face" suffix from idlwave faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-414 Remove "-face" suffix from sh-script faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-415 Remove "-face" suffix from vhdl-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-416 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-417 Remove "-face" suffix from which-func face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-418 Remove "-face" suffix from cperl-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-419 Remove "-face" suffix from ld-script faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-420 Fix cperl-mode font-lock problem * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-421 Tweak which-func face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-422 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-80 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-81 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-82 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-350
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c82
1 files changed, 57 insertions, 25 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index b7115601553..6a2f98c4c7d 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -7759,6 +7759,19 @@ file_dialog_callback (hwnd, msg, wParam, lParam)
7759 return 0; 7759 return 0;
7760} 7760}
7761 7761
7762/* Since we compile with _WIN32_WINNT set to 0x0400 (for NT4 compatibility)
7763 we end up with the old file dialogs. Define a big enough struct for the
7764 new dialog to trick GetOpenFileName into giving us the new dialogs on
7765 Windows 2000 and XP. */
7766typedef struct
7767{
7768 OPENFILENAME real_details;
7769 void * pReserved;
7770 DWORD dwReserved;
7771 DWORD FlagsEx;
7772} NEWOPENFILENAME;
7773
7774
7762DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0, 7775DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0,
7763 doc: /* Read file name, prompting with PROMPT in directory DIR. 7776 doc: /* Read file name, prompting with PROMPT in directory DIR.
7764Use a file selection dialog. 7777Use a file selection dialog.
@@ -7807,39 +7820,58 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
7807 filename[0] = '\0'; 7820 filename[0] = '\0';
7808 7821
7809 { 7822 {
7810 OPENFILENAME file_details; 7823 NEWOPENFILENAME new_file_details;
7811 7824 BOOL file_opened = FALSE;
7825 OPENFILENAME * file_details = &new_file_details.real_details;
7826
7812 /* Prevent redisplay. */ 7827 /* Prevent redisplay. */
7813 specbind (Qinhibit_redisplay, Qt); 7828 specbind (Qinhibit_redisplay, Qt);
7814 BLOCK_INPUT; 7829 BLOCK_INPUT;
7815 7830
7816 bzero (&file_details, sizeof (file_details)); 7831 bzero (&new_file_details, sizeof (new_file_details));
7817 file_details.lStructSize = sizeof (file_details); 7832 /* Apparently NT4 crashes if you give it an unexpected size.
7818 file_details.hwndOwner = FRAME_W32_WINDOW (f); 7833 I'm not sure about Windows 9x, so play it safe. */
7834 if (w32_major_version > 4 && w32_major_version < 95)
7835 file_details->lStructSize = sizeof (new_file_details);
7836 else
7837 file_details->lStructSize = sizeof (file_details);
7838
7839 file_details->hwndOwner = FRAME_W32_WINDOW (f);
7819 /* Undocumented Bug in Common File Dialog: 7840 /* Undocumented Bug in Common File Dialog:
7820 If a filter is not specified, shell links are not resolved. */ 7841 If a filter is not specified, shell links are not resolved. */
7821 file_details.lpstrFilter = "All Files (*.*)\0*.*\0Directories\0*|*\0\0"; 7842 file_details->lpstrFilter = "All Files (*.*)\0*.*\0Directories\0*|*\0\0";
7822 file_details.lpstrFile = filename; 7843 file_details->lpstrFile = filename;
7823 file_details.nMaxFile = sizeof (filename); 7844 file_details->nMaxFile = sizeof (filename);
7824 file_details.lpstrInitialDir = init_dir; 7845 file_details->lpstrInitialDir = init_dir;
7825 file_details.lpstrTitle = SDATA (prompt); 7846 file_details->lpstrTitle = SDATA (prompt);
7826 7847
7827 if (! NILP (only_dir_p)) 7848 if (! NILP (only_dir_p))
7828 default_filter_index = 2; 7849 default_filter_index = 2;
7829 7850
7830 file_details.nFilterIndex = default_filter_index; 7851 file_details->nFilterIndex = default_filter_index;
7831 7852
7832 file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR 7853 file_details->Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR
7833 | OFN_EXPLORER | OFN_ENABLEHOOK); 7854 | OFN_EXPLORER | OFN_ENABLEHOOK);
7834 if (!NILP (mustmatch)) 7855 if (!NILP (mustmatch))
7835 file_details.Flags |= OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; 7856 {
7857 /* Require that the path to the parent directory exists. */
7858 file_details->Flags |= OFN_PATHMUSTEXIST;
7859 /* If we are looking for a file, require that it exists. */
7860 if (NILP (only_dir_p))
7861 file_details->Flags |= OFN_FILEMUSTEXIST;
7862 }
7863
7864 file_details->lpfnHook = (LPOFNHOOKPROC) file_dialog_callback;
7836 7865
7837 file_details.lpfnHook = (LPOFNHOOKPROC) file_dialog_callback; 7866 file_opened = GetOpenFileName (file_details);
7838 7867
7839 if (GetOpenFileName (&file_details)) 7868 UNBLOCK_INPUT;
7869
7870 if (file_opened)
7840 { 7871 {
7841 dostounix_filename (filename); 7872 dostounix_filename (filename);
7842 if (file_details.nFilterIndex == 2) 7873
7874 if (file_details->nFilterIndex == 2)
7843 { 7875 {
7844 /* "Directories" selected - strip dummy file name. */ 7876 /* "Directories" selected - strip dummy file name. */
7845 char * last = strrchr (filename, '/'); 7877 char * last = strrchr (filename, '/');
@@ -7857,7 +7889,6 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
7857 dir, mustmatch, dir, Qfile_name_history, 7889 dir, mustmatch, dir, Qfile_name_history,
7858 default_filename, Qnil); 7890 default_filename, Qnil);
7859 7891
7860 UNBLOCK_INPUT;
7861 file = unbind_to (count, file); 7892 file = unbind_to (count, file);
7862 } 7893 }
7863 7894
@@ -8698,7 +8729,7 @@ fontsets are automatically created. */);
8698 DEFVAR_BOOL ("w32-strict-painting", 8729 DEFVAR_BOOL ("w32-strict-painting",
8699 &w32_strict_painting, 8730 &w32_strict_painting,
8700 doc: /* Non-nil means use strict rules for repainting frames. 8731 doc: /* Non-nil means use strict rules for repainting frames.
8701Set this to nil to get the old behaviour for repainting; this should 8732Set this to nil to get the old behavior for repainting; this should
8702only be necessary if the default setting causes problems. */); 8733only be necessary if the default setting causes problems. */);
8703 w32_strict_painting = 1; 8734 w32_strict_painting = 1;
8704 8735
@@ -8890,24 +8921,25 @@ void globals_of_w32fns ()
8890 8921
8891#undef abort 8922#undef abort
8892 8923
8924void w32_abort (void) NO_RETURN;
8925
8893void 8926void
8894w32_abort() 8927w32_abort()
8895{ 8928{
8896 int button; 8929 int button;
8897 button = MessageBox (NULL, 8930 button = MessageBox (NULL,
8898 "A fatal error has occurred!\n\n" 8931 "A fatal error has occurred!\n\n"
8899 "Select Abort to exit, Retry to debug, Ignore to continue", 8932 "Would you like to attach a debugger?\n\n"
8933 "Select YES to debug, NO to abort Emacs",
8900 "Emacs Abort Dialog", 8934 "Emacs Abort Dialog",
8901 MB_ICONEXCLAMATION | MB_TASKMODAL 8935 MB_ICONEXCLAMATION | MB_TASKMODAL
8902 | MB_SETFOREGROUND | MB_ABORTRETRYIGNORE); 8936 | MB_SETFOREGROUND | MB_YESNO);
8903 switch (button) 8937 switch (button)
8904 { 8938 {
8905 case IDRETRY: 8939 case IDYES:
8906 DebugBreak (); 8940 DebugBreak ();
8907 break; 8941 exit (2); /* tell the compiler we will never return */
8908 case IDIGNORE: 8942 case IDNO:
8909 break;
8910 case IDABORT:
8911 default: 8943 default:
8912 abort (); 8944 abort ();
8913 break; 8945 break;