aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero2007-11-14 20:25:02 +0000
committerJuanma Barranquero2007-11-14 20:25:02 +0000
commitcca3fd48cde8c0fb92c9f7c912c5bb98783df5de (patch)
treeaded2581f152b3b1240cf14d82f70f32535bdf62 /src
parent262452334c27b061364456d41f67c3868b14aa1c (diff)
downloademacs-cca3fd48cde8c0fb92c9f7c912c5bb98783df5de.tar.gz
emacs-cca3fd48cde8c0fb92c9f7c912c5bb98783df5de.zip
(Fw32_registered_hot_keys): Don't return the nil values corresponding
to deleted entries; they are an implementation detail. (gray_bitmap_width, gray_bitmap_height, gray_bitmap_bits): Remove variables. (Fw32_define_rgb_color, Fw32_load_color_file): Fix typos in docstrings. (Fx_server_version): Reflow docstring. (Fw32_shell_execute): Doc fixes.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/w32fns.c213
2 files changed, 113 insertions, 110 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 186ae87bf5c..8b7c9a985e4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12007-11-14 Juanma Barranquero <lekktu@gmail.com>
2
3 * w32fns.c (Fw32_registered_hot_keys): Don't return the nil values
4 corresponding to deleted entries; they are an implementation detail.
5 (gray_bitmap_width, gray_bitmap_height, gray_bitmap_bits):
6 Remove variables.
7 (Fw32_define_rgb_color, Fw32_load_color_file): Fix typos in docstrings.
8 (Fx_server_version): Reflow docstring.
9 (Fw32_shell_execute): Doc fixes.
10
12007-11-13 Juanma Barranquero <lekktu@gmail.com> 112007-11-13 Juanma Barranquero <lekktu@gmail.com>
2 12
3 * w32fns.c (Fw32_register_hot_key): Don't try to register hot key 13 * w32fns.c (Fw32_register_hot_key): Don't try to register hot key
diff --git a/src/w32fns.c b/src/w32fns.c
index 96c3ef3f7bc..d86d2f1e39a 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -73,14 +73,6 @@ extern int quit_char;
73 73
74extern char *lispy_function_keys[]; 74extern char *lispy_function_keys[];
75 75
76/* The gray bitmap `bitmaps/gray'. This is done because w32term.c uses
77 it, and including `bitmaps/gray' more than once is a problem when
78 config.h defines `static' as an empty replacement string. */
79
80int gray_bitmap_width = gray_width;
81int gray_bitmap_height = gray_height;
82unsigned char *gray_bitmap_bits = gray_bits;
83
84/* The colormap for converting color names to RGB values */ 76/* The colormap for converting color names to RGB values */
85Lisp_Object Vw32_color_map; 77Lisp_Object Vw32_color_map;
86 78
@@ -460,7 +452,7 @@ x_real_positions (f, xptr, yptr)
460DEFUN ("w32-define-rgb-color", Fw32_define_rgb_color, 452DEFUN ("w32-define-rgb-color", Fw32_define_rgb_color,
461 Sw32_define_rgb_color, 4, 4, 0, 453 Sw32_define_rgb_color, 4, 4, 0,
462 doc: /* Convert RGB numbers to a windows color reference and associate with NAME. 454 doc: /* Convert RGB numbers to a windows color reference and associate with NAME.
463This adds or updates a named color to w32-color-map, making it 455This adds or updates a named color to `w32-color-map', making it
464available for use. The original entry's RGB ref is returned, or nil 456available for use. The original entry's RGB ref is returned, or nil
465if the entry is new. */) 457if the entry is new. */)
466 (red, green, blue, name) 458 (red, green, blue, name)
@@ -475,7 +467,7 @@ if the entry is new. */)
475 CHECK_NUMBER (blue); 467 CHECK_NUMBER (blue);
476 CHECK_STRING (name); 468 CHECK_STRING (name);
477 469
478 XSETINT (rgb, RGB(XUINT (red), XUINT (green), XUINT (blue))); 470 XSETINT (rgb, RGB (XUINT (red), XUINT (green), XUINT (blue)));
479 471
480 BLOCK_INPUT; 472 BLOCK_INPUT;
481 473
@@ -500,7 +492,7 @@ if the entry is new. */)
500DEFUN ("w32-load-color-file", Fw32_load_color_file, 492DEFUN ("w32-load-color-file", Fw32_load_color_file,
501 Sw32_load_color_file, 1, 1, 0, 493 Sw32_load_color_file, 1, 1, 0,
502 doc: /* Create an alist of color entries from an external file. 494 doc: /* Create an alist of color entries from an external file.
503Assign this value to w32-color-map to replace the existing color map. 495Assign this value to `w32-color-map' to replace the existing color map.
504 496
505The file should define one named RGB color per line like so: 497The file should define one named RGB color per line like so:
506 R G B name 498 R G B name
@@ -935,7 +927,7 @@ x_to_w32_color (colorname)
935 int size; 927 int size;
936 color = colorname + 1; 928 color = colorname + 1;
937 929
938 size = strlen(color); 930 size = strlen (color);
939 if (size == 3 || size == 6 || size == 9 || size == 12) 931 if (size == 3 || size == 6 || size == 9 || size == 12)
940 { 932 {
941 UINT colorval; 933 UINT colorval;
@@ -953,11 +945,11 @@ x_to_w32_color (colorname)
953 /* The check for 'x' in the following conditional takes into 945 /* The check for 'x' in the following conditional takes into
954 account the fact that strtol allows a "0x" in front of 946 account the fact that strtol allows a "0x" in front of
955 our numbers, and we don't. */ 947 our numbers, and we don't. */
956 if (!isxdigit(color[0]) || color[1] == 'x') 948 if (!isxdigit (color[0]) || color[1] == 'x')
957 break; 949 break;
958 t = color[size]; 950 t = color[size];
959 color[size] = '\0'; 951 color[size] = '\0';
960 value = strtoul(color, &end, 16); 952 value = strtoul (color, &end, 16);
961 color[size] = t; 953 color[size] = t;
962 if (errno == ERANGE || end - color != size) 954 if (errno == ERANGE || end - color != size)
963 break; 955 break;
@@ -987,7 +979,7 @@ x_to_w32_color (colorname)
987 } 979 }
988 } 980 }
989 } 981 }
990 else if (strnicmp(colorname, "rgb:", 4) == 0) 982 else if (strnicmp (colorname, "rgb:", 4) == 0)
991 { 983 {
992 char *color; 984 char *color;
993 UINT colorval; 985 UINT colorval;
@@ -1004,9 +996,9 @@ x_to_w32_color (colorname)
1004 /* The check for 'x' in the following conditional takes into 996 /* The check for 'x' in the following conditional takes into
1005 account the fact that strtol allows a "0x" in front of 997 account the fact that strtol allows a "0x" in front of
1006 our numbers, and we don't. */ 998 our numbers, and we don't. */
1007 if (!isxdigit(color[0]) || color[1] == 'x') 999 if (!isxdigit (color[0]) || color[1] == 'x')
1008 break; 1000 break;
1009 value = strtoul(color, &end, 16); 1001 value = strtoul (color, &end, 16);
1010 if (errno == ERANGE) 1002 if (errno == ERANGE)
1011 break; 1003 break;
1012 switch (end - color) 1004 switch (end - color)
@@ -1042,7 +1034,7 @@ x_to_w32_color (colorname)
1042 color = end + 1; 1034 color = end + 1;
1043 } 1035 }
1044 } 1036 }
1045 else if (strnicmp(colorname, "rgbi:", 5) == 0) 1037 else if (strnicmp (colorname, "rgbi:", 5) == 0)
1046 { 1038 {
1047 /* This is an RGB Intensity specification. */ 1039 /* This is an RGB Intensity specification. */
1048 char *color; 1040 char *color;
@@ -1058,7 +1050,7 @@ x_to_w32_color (colorname)
1058 double value; 1050 double value;
1059 UINT val; 1051 UINT val;
1060 1052
1061 value = strtod(color, &end); 1053 value = strtod (color, &end);
1062 if (errno == ERANGE) 1054 if (errno == ERANGE)
1063 break; 1055 break;
1064 if (value < 0.0 || value > 1.0) 1056 if (value < 0.0 || value > 1.0)
@@ -1556,7 +1548,6 @@ x_set_mouse_color (f, arg, oldval)
1556#endif /* TODO */ 1548#endif /* TODO */
1557} 1549}
1558 1550
1559/* Defined in w32term.c. */
1560void 1551void
1561x_set_cursor_color (f, arg, oldval) 1552x_set_cursor_color (f, arg, oldval)
1562 struct frame *f; 1553 struct frame *f;
@@ -1910,7 +1901,7 @@ x_set_name (f, name, explicit)
1910 name = ENCODE_SYSTEM (name); 1901 name = ENCODE_SYSTEM (name);
1911 1902
1912 BLOCK_INPUT; 1903 BLOCK_INPUT;
1913 SetWindowText(FRAME_W32_WINDOW (f), SDATA (name)); 1904 SetWindowText (FRAME_W32_WINDOW (f), SDATA (name));
1914 UNBLOCK_INPUT; 1905 UNBLOCK_INPUT;
1915 } 1906 }
1916} 1907}
@@ -1962,7 +1953,7 @@ x_set_title (f, name, old_name)
1962 name = ENCODE_SYSTEM (name); 1953 name = ENCODE_SYSTEM (name);
1963 1954
1964 BLOCK_INPUT; 1955 BLOCK_INPUT;
1965 SetWindowText(FRAME_W32_WINDOW (f), SDATA (name)); 1956 SetWindowText (FRAME_W32_WINDOW (f), SDATA (name));
1966 UNBLOCK_INPUT; 1957 UNBLOCK_INPUT;
1967 } 1958 }
1968} 1959}
@@ -2009,7 +2000,7 @@ Cursor
2009w32_load_cursor (LPCTSTR name) 2000w32_load_cursor (LPCTSTR name)
2010{ 2001{
2011 /* Try first to load cursor from application resource. */ 2002 /* Try first to load cursor from application resource. */
2012 Cursor cursor = LoadImage ((HINSTANCE) GetModuleHandle(NULL), 2003 Cursor cursor = LoadImage ((HINSTANCE) GetModuleHandle (NULL),
2013 name, IMAGE_CURSOR, 0, 0, 2004 name, IMAGE_CURSOR, 0, 0,
2014 LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED); 2005 LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED);
2015 if (!cursor) 2006 if (!cursor)
@@ -2050,10 +2041,10 @@ w32_createscrollbar (f, bar)
2050{ 2041{
2051 return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE, 2042 return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE,
2052 /* Position and size of scroll bar. */ 2043 /* Position and size of scroll bar. */
2053 XINT(bar->left) + VERTICAL_SCROLL_BAR_WIDTH_TRIM, 2044 XINT (bar->left) + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
2054 XINT(bar->top), 2045 XINT (bar->top),
2055 XINT(bar->width) - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, 2046 XINT (bar->width) - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
2056 XINT(bar->height), 2047 XINT (bar->height),
2057 FRAME_W32_WINDOW (f), 2048 FRAME_W32_WINDOW (f),
2058 NULL, 2049 NULL,
2059 hinst, 2050 hinst,
@@ -2433,12 +2424,12 @@ map_keypad_keys (unsigned int virt_key, unsigned int extended)
2433} 2424}
2434 2425
2435/* List of special key combinations which w32 would normally capture, 2426/* List of special key combinations which w32 would normally capture,
2436 but emacs should grab instead. Not directly visible to lisp, to 2427 but Emacs should grab instead. Not directly visible to lisp, to
2437 simplify synchronization. Each item is an integer encoding a virtual 2428 simplify synchronization. Each item is an integer encoding a virtual
2438 key code and modifier combination to capture. */ 2429 key code and modifier combination to capture. */
2439Lisp_Object w32_grabbed_keys; 2430Lisp_Object w32_grabbed_keys;
2440 2431
2441#define HOTKEY(vk,mods) make_number (((vk) & 255) | ((mods) << 8)) 2432#define HOTKEY(vk, mods) make_number (((vk) & 255) | ((mods) << 8))
2442#define HOTKEY_ID(k) (XFASTINT (k) & 0xbfff) 2433#define HOTKEY_ID(k) (XFASTINT (k) & 0xbfff)
2443#define HOTKEY_VK_CODE(k) (XFASTINT (k) & 255) 2434#define HOTKEY_VK_CODE(k) (XFASTINT (k) & 255)
2444#define HOTKEY_MODIFIERS(k) (XFASTINT (k) >> 8) 2435#define HOTKEY_MODIFIERS(k) (XFASTINT (k) >> 8)
@@ -2665,7 +2656,7 @@ complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result)
2665 deferred_msg * msg_buf = find_deferred_msg (hwnd, msg); 2656 deferred_msg * msg_buf = find_deferred_msg (hwnd, msg);
2666 2657
2667 if (msg_buf == NULL) 2658 if (msg_buf == NULL)
2668 /* Message may have been cancelled, so don't abort(). */ 2659 /* Message may have been cancelled, so don't abort. */
2669 return; 2660 return;
2670 2661
2671 msg_buf->result = result; 2662 msg_buf->result = result;
@@ -2753,7 +2744,7 @@ post_character_message (hwnd, msg, wParam, lParam, modifiers)
2753 2744
2754 /* Detect quit_char and set quit-flag directly. Note that we 2745 /* Detect quit_char and set quit-flag directly. Note that we
2755 still need to post a message to ensure the main thread will be 2746 still need to post a message to ensure the main thread will be
2756 woken up if blocked in sys_select(), but we do NOT want to post 2747 woken up if blocked in sys_select, but we do NOT want to post
2757 the quit_char message itself (because it will usually be as if 2748 the quit_char message itself (because it will usually be as if
2758 the user had typed quit_char twice). Instead, we post a dummy 2749 the user had typed quit_char twice). Instead, we post a dummy
2759 message that has no particular effect. */ 2750 message that has no particular effect. */
@@ -2908,7 +2899,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
2908 2899
2909 /* If GetUpdateRect returns 0 (meaning there is no update 2900 /* If GetUpdateRect returns 0 (meaning there is no update
2910 region), assume the whole window needs to be repainted. */ 2901 region), assume the whole window needs to be repainted. */
2911 GetClientRect(hwnd, &wmsg.rect); 2902 GetClientRect (hwnd, &wmsg.rect);
2912 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 2903 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
2913 return 0; 2904 return 0;
2914 } 2905 }
@@ -3694,7 +3685,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
3694 DWORD scrollbar_extra; 3685 DWORD scrollbar_extra;
3695 RECT wr; 3686 RECT wr;
3696 3687
3697 wp.length = sizeof(wp); 3688 wp.length = sizeof (wp);
3698 GetWindowRect (hwnd, &wr); 3689 GetWindowRect (hwnd, &wr);
3699 3690
3700 enter_crit (); 3691 enter_crit ();
@@ -4472,11 +4463,12 @@ DEFUN ("w32-focus-frame", Fw32_focus_frame, Sw32_focus_frame, 1, 1, 0,
4472 4463
4473 4464
4474/* Return the charset portion of a font name. */ 4465/* Return the charset portion of a font name. */
4475char * xlfd_charset_of_font (char * fontname) 4466char *
4467xlfd_charset_of_font (char * fontname)
4476{ 4468{
4477 char *charset, *encoding; 4469 char *charset, *encoding;
4478 4470
4479 encoding = strrchr(fontname, '-'); 4471 encoding = strrchr (fontname, '-');
4480 if (!encoding || encoding == fontname) 4472 if (!encoding || encoding == fontname)
4481 return NULL; 4473 return NULL;
4482 4474
@@ -4484,7 +4476,7 @@ char * xlfd_charset_of_font (char * fontname)
4484 if (*charset == '-') 4476 if (*charset == '-')
4485 break; 4477 break;
4486 4478
4487 if (charset == fontname || strcmp(charset, "-*-*") == 0) 4479 if (charset == fontname || strcmp (charset, "-*-*") == 0)
4488 return NULL; 4480 return NULL;
4489 4481
4490 return charset + 1; 4482 return charset + 1;
@@ -4498,7 +4490,7 @@ static BOOL w32_to_x_font (LOGFONT * lplf, char * lpxstr, int len,
4498static BOOL x_to_w32_font (char *lpxstr, LOGFONT *lplogfont); 4490static BOOL x_to_w32_font (char *lpxstr, LOGFONT *lplogfont);
4499 4491
4500static struct font_info * 4492static struct font_info *
4501w32_load_system_font (f,fontname,size) 4493w32_load_system_font (f, fontname, size)
4502 struct frame *f; 4494 struct frame *f;
4503 char * fontname; 4495 char * fontname;
4504 int size; 4496 int size;
@@ -4601,7 +4593,7 @@ w32_load_system_font (f,fontname,size)
4601 GetFontLanguageInfo, we check the properties of the 4593 GetFontLanguageInfo, we check the properties of the
4602 codepage directly, since that is ultimately what we are 4594 codepage directly, since that is ultimately what we are
4603 working from anyway. */ 4595 working from anyway. */
4604 /* font->double_byte_p = GetFontLanguageInfo(hdc) & GCP_DBCS; */ 4596 /* font->double_byte_p = GetFontLanguageInfo (hdc) & GCP_DBCS; */
4605 CPINFO cpi = {0}; 4597 CPINFO cpi = {0};
4606 GetCPInfo (codepage, &cpi); 4598 GetCPInfo (codepage, &cpi);
4607 font->double_byte_p = cpi.MaxCharSize > 1; 4599 font->double_byte_p = cpi.MaxCharSize > 1;
@@ -4737,10 +4729,10 @@ w32_load_system_font (f,fontname,size)
4737 pointer to the structure font_info while allocating it dynamically. 4729 pointer to the structure font_info while allocating it dynamically.
4738 If loading fails, return NULL. */ 4730 If loading fails, return NULL. */
4739struct font_info * 4731struct font_info *
4740w32_load_font (f,fontname,size) 4732w32_load_font (f, fontname, size)
4741struct frame *f; 4733 struct frame *f;
4742char * fontname; 4734 char * fontname;
4743int size; 4735 int size;
4744{ 4736{
4745 Lisp_Object bdf_fonts; 4737 Lisp_Object bdf_fonts;
4746 struct font_info *retval = NULL; 4738 struct font_info *retval = NULL;
@@ -4776,7 +4768,7 @@ int size;
4776 if (retval) 4768 if (retval)
4777 return retval; 4769 return retval;
4778 4770
4779 return w32_load_system_font(f, fontname, size); 4771 return w32_load_system_font (f, fontname, size);
4780} 4772}
4781 4773
4782 4774
@@ -4790,7 +4782,7 @@ w32_unload_font (dpyinfo, font)
4790 if (font->per_char) xfree (font->per_char); 4782 if (font->per_char) xfree (font->per_char);
4791 if (font->bdf) w32_free_bdf_font (font->bdf); 4783 if (font->bdf) w32_free_bdf_font (font->bdf);
4792 4784
4793 if (font->hfont) DeleteObject(font->hfont); 4785 if (font->hfont) DeleteObject (font->hfont);
4794 xfree (font); 4786 xfree (font);
4795 } 4787 }
4796} 4788}
@@ -4824,16 +4816,16 @@ x_to_w32_weight (lpw)
4824{ 4816{
4825 if (!lpw) return (FW_DONTCARE); 4817 if (!lpw) return (FW_DONTCARE);
4826 4818
4827 if (stricmp (lpw,"heavy") == 0) return FW_HEAVY; 4819 if (stricmp (lpw, "heavy") == 0) return FW_HEAVY;
4828 else if (stricmp (lpw,"extrabold") == 0) return FW_EXTRABOLD; 4820 else if (stricmp (lpw, "extrabold") == 0) return FW_EXTRABOLD;
4829 else if (stricmp (lpw,"bold") == 0) return FW_BOLD; 4821 else if (stricmp (lpw, "bold") == 0) return FW_BOLD;
4830 else if (stricmp (lpw,"demibold") == 0) return FW_SEMIBOLD; 4822 else if (stricmp (lpw, "demibold") == 0) return FW_SEMIBOLD;
4831 else if (stricmp (lpw,"semibold") == 0) return FW_SEMIBOLD; 4823 else if (stricmp (lpw, "semibold") == 0) return FW_SEMIBOLD;
4832 else if (stricmp (lpw,"medium") == 0) return FW_MEDIUM; 4824 else if (stricmp (lpw, "medium") == 0) return FW_MEDIUM;
4833 else if (stricmp (lpw,"normal") == 0) return FW_NORMAL; 4825 else if (stricmp (lpw, "normal") == 0) return FW_NORMAL;
4834 else if (stricmp (lpw,"light") == 0) return FW_LIGHT; 4826 else if (stricmp (lpw, "light") == 0) return FW_LIGHT;
4835 else if (stricmp (lpw,"extralight") == 0) return FW_EXTRALIGHT; 4827 else if (stricmp (lpw, "extralight") == 0) return FW_EXTRALIGHT;
4836 else if (stricmp (lpw,"thin") == 0) return FW_THIN; 4828 else if (stricmp (lpw, "thin") == 0) return FW_THIN;
4837 else 4829 else
4838 return FW_DONTCARE; 4830 return FW_DONTCARE;
4839} 4831}
@@ -4879,12 +4871,12 @@ x_to_w32_charset (lpcs)
4879 Format of each entry is 4871 Format of each entry is
4880 (CHARSET_NAME . (WINDOWS_CHARSET . CODEPAGE)). 4872 (CHARSET_NAME . (WINDOWS_CHARSET . CODEPAGE)).
4881 */ 4873 */
4882 this_entry = Fassoc (build_string(charset), Vw32_charset_info_alist); 4874 this_entry = Fassoc (build_string (charset), Vw32_charset_info_alist);
4883 4875
4884 if (NILP(this_entry)) 4876 if (NILP (this_entry))
4885 { 4877 {
4886 /* At startup, we want iso8859-1 fonts to come up properly. */ 4878 /* At startup, we want iso8859-1 fonts to come up properly. */
4887 if (stricmp(charset, "iso8859-1") == 0) 4879 if (stricmp (charset, "iso8859-1") == 0)
4888 return ANSI_CHARSET; 4880 return ANSI_CHARSET;
4889 else 4881 else
4890 return DEFAULT_CHARSET; 4882 return DEFAULT_CHARSET;
@@ -4952,7 +4944,7 @@ w32_to_x_charset (fncharset)
4952 case ANSI_CHARSET: 4944 case ANSI_CHARSET:
4953 /* Handle startup case of w32-charset-info-alist not 4945 /* Handle startup case of w32-charset-info-alist not
4954 being set up yet. */ 4946 being set up yet. */
4955 if (NILP(Vw32_charset_info_alist)) 4947 if (NILP (Vw32_charset_info_alist))
4956 return "iso8859-1"; 4948 return "iso8859-1";
4957 charset_type = Qw32_charset_ansi; 4949 charset_type = Qw32_charset_ansi;
4958 break; 4950 break;
@@ -5091,7 +5083,7 @@ w32_to_x_charset (fncharset)
5091 return buf; 5083 return buf;
5092 } 5084 }
5093 5085
5094 strncpy(buf, best_match, 31); 5086 strncpy (buf, best_match, 31);
5095 buf[31] = '\0'; 5087 buf[31] = '\0';
5096 return buf; 5088 return buf;
5097 } 5089 }
@@ -5112,7 +5104,7 @@ w32_to_all_x_charsets (fncharset)
5112 case ANSI_CHARSET: 5104 case ANSI_CHARSET:
5113 /* Handle startup case of w32-charset-info-alist not 5105 /* Handle startup case of w32-charset-info-alist not
5114 being set up yet. */ 5106 being set up yet. */
5115 if (NILP(Vw32_charset_info_alist)) 5107 if (NILP (Vw32_charset_info_alist))
5116 return Fcons (build_string ("iso8859-1"), Qnil); 5108 return Fcons (build_string ("iso8859-1"), Qnil);
5117 5109
5118 charset_type = Qw32_charset_ansi; 5110 charset_type = Qw32_charset_ansi;
@@ -5272,7 +5264,7 @@ w32_codepage_for_font (char *fontname)
5272 *end = '\0'; 5264 *end = '\0';
5273 } 5265 }
5274 5266
5275 entry = Fassoc (build_string(charset), Vw32_charset_info_alist); 5267 entry = Fassoc (build_string (charset), Vw32_charset_info_alist);
5276 if (NILP (entry)) 5268 if (NILP (entry))
5277 return CP_UNKNOWN; 5269 return CP_UNKNOWN;
5278 5270
@@ -5329,9 +5321,9 @@ w32_to_x_font (lplogfont, lpxstr, len, specific_charset)
5329 coding.composing = COMPOSITION_DISABLED; 5321 coding.composing = COMPOSITION_DISABLED;
5330 bufsz = decoding_buffer_size (&coding, LF_FACESIZE); 5322 bufsz = decoding_buffer_size (&coding, LF_FACESIZE);
5331 5323
5332 fontname = alloca(sizeof(*fontname) * bufsz); 5324 fontname = alloca (sizeof (*fontname) * bufsz);
5333 decode_coding (&coding, lplogfont->lfFaceName, fontname, 5325 decode_coding (&coding, lplogfont->lfFaceName, fontname,
5334 strlen(lplogfont->lfFaceName), bufsz - 1); 5326 strlen (lplogfont->lfFaceName), bufsz - 1);
5335 *(fontname + coding.produced) = '\0'; 5327 *(fontname + coding.produced) = '\0';
5336 5328
5337 /* Replace dashes with underscores so the dashes are not 5329 /* Replace dashes with underscores so the dashes are not
@@ -5542,7 +5534,7 @@ x_to_w32_font (lpxstr, lplogfont)
5542 5534
5543 if (fields > 0) 5535 if (fields > 0)
5544 { 5536 {
5545 strncpy (lplogfont->lfFaceName,name, LF_FACESIZE); 5537 strncpy (lplogfont->lfFaceName, name, LF_FACESIZE);
5546 lplogfont->lfFaceName[LF_FACESIZE-1] = 0; 5538 lplogfont->lfFaceName[LF_FACESIZE-1] = 0;
5547 } 5539 }
5548 else 5540 else
@@ -5741,7 +5733,7 @@ w32_font_match (fontname, pattern)
5741 } 5733 }
5742 5734
5743 return (fast_string_match_ignore_case (build_string (regex), 5735 return (fast_string_match_ignore_case (build_string (regex),
5744 build_string(font_name_copy)) >= 0); 5736 build_string (font_name_copy)) >= 0);
5745} 5737}
5746 5738
5747/* Callback functions, and a structure holding info they need, for 5739/* Callback functions, and a structure holding info they need, for
@@ -5976,7 +5968,8 @@ enum_fontex_cb1 (lplf, lptm, font_type, lpef)
5976/* Interface to fontset handler. (adapted from mw32font.c in Meadow 5968/* Interface to fontset handler. (adapted from mw32font.c in Meadow
5977 and xterm.c in Emacs 20.3) */ 5969 and xterm.c in Emacs 20.3) */
5978 5970
5979static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names) 5971static Lisp_Object
5972w32_list_bdf_fonts (Lisp_Object pattern, int max_names)
5980{ 5973{
5981 char *fontname, *ptnstr; 5974 char *fontname, *ptnstr;
5982 Lisp_Object list, tem, newlist = Qnil; 5975 Lisp_Object list, tem, newlist = Qnil;
@@ -6047,7 +6040,7 @@ w32_list_fonts (f, pattern, size, maxnames)
6047 codepage = w32_codepage_for_font (SDATA (tpat)); 6040 codepage = w32_codepage_for_font (SDATA (tpat));
6048 if (codepage != CP_8BIT && codepage != CP_UNICODE 6041 if (codepage != CP_8BIT && codepage != CP_UNICODE
6049 && codepage != CP_DEFAULT && codepage != CP_UNKNOWN 6042 && codepage != CP_DEFAULT && codepage != CP_UNKNOWN
6050 && !IsValidCodePage(codepage)) 6043 && !IsValidCodePage (codepage))
6051 continue; 6044 continue;
6052 6045
6053 /* See if we cached the result for this particular query. 6046 /* See if we cached the result for this particular query.
@@ -6158,7 +6151,7 @@ w32_list_fonts (f, pattern, size, maxnames)
6158 XSETCDR (tem, make_number (0)); 6151 XSETCDR (tem, make_number (0));
6159 SelectObject (hdc, oldobj); 6152 SelectObject (hdc, oldobj);
6160 ReleaseDC (dpyinfo->root_window, hdc); 6153 ReleaseDC (dpyinfo->root_window, hdc);
6161 DeleteObject(thisinfo.hfont); 6154 DeleteObject (thisinfo.hfont);
6162 UNBLOCK_INPUT; 6155 UNBLOCK_INPUT;
6163 } 6156 }
6164 found_size = XINT (XCDR (tem)); 6157 found_size = XINT (XCDR (tem));
@@ -6207,7 +6200,7 @@ w32_list_fonts (f, pattern, size, maxnames)
6207 Lisp_Object combined[2]; 6200 Lisp_Object combined[2];
6208 combined[0] = w32_list_bdf_fonts (pattern, maxnames - n_fonts); 6201 combined[0] = w32_list_bdf_fonts (pattern, maxnames - n_fonts);
6209 combined[1] = newlist; 6202 combined[1] = newlist;
6210 newlist = Fnconc(2, combined); 6203 newlist = Fnconc (2, combined);
6211 } 6204 }
6212 6205
6213 return newlist; 6206 return newlist;
@@ -6234,7 +6227,7 @@ w32_query_font (struct frame *f, char *fontname)
6234 6227
6235 for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++) 6228 for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++)
6236 { 6229 {
6237 if (stricmp(pfi->name, fontname) == 0) return pfi; 6230 if (stricmp (pfi->name, fontname) == 0) return pfi;
6238 } 6231 }
6239 6232
6240 return NULL; 6233 return NULL;
@@ -6271,7 +6264,7 @@ w32_find_ccl_program (fontp)
6271} 6264}
6272 6265
6273/* directory-files from dired.c. */ 6266/* directory-files from dired.c. */
6274Lisp_Object Fdirectory_files P_((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object)); 6267Lisp_Object Fdirectory_files P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
6275 6268
6276 6269
6277/* Find BDF files in a specified directory. (use GCPRO when calling, 6270/* Find BDF files in a specified directory. (use GCPRO when calling,
@@ -6282,13 +6275,13 @@ w32_find_bdf_fonts_in_dir (Lisp_Object directory)
6282 Lisp_Object filelist, list = Qnil; 6275 Lisp_Object filelist, list = Qnil;
6283 char fontname[100]; 6276 char fontname[100];
6284 6277
6285 if (!STRINGP(directory)) 6278 if (!STRINGP (directory))
6286 return Qnil; 6279 return Qnil;
6287 6280
6288 filelist = Fdirectory_files (directory, Qt, 6281 filelist = Fdirectory_files (directory, Qt,
6289 build_string (".*\\.[bB][dD][fF]"), Qt); 6282 build_string (".*\\.[bB][dD][fF]"), Qt);
6290 6283
6291 for ( ; CONSP(filelist); filelist = XCDR (filelist)) 6284 for ( ; CONSP (filelist); filelist = XCDR (filelist))
6292 { 6285 {
6293 Lisp_Object filename = XCAR (filelist); 6286 Lisp_Object filename = XCAR (filelist);
6294 if (w32_BDF_to_x_font (SDATA (filename), fontname, 100)) 6287 if (w32_BDF_to_x_font (SDATA (filename), fontname, 100))
@@ -6318,8 +6311,8 @@ in the list. DIRECTORY may be a list of directories. */)
6318 pair[0] = list; 6311 pair[0] = list;
6319 pair[1] = Qnil; 6312 pair[1] = Qnil;
6320 GCPRO2 (directory, list); 6313 GCPRO2 (directory, list);
6321 pair[1] = w32_find_bdf_fonts_in_dir( XCAR (directory) ); 6314 pair[1] = w32_find_bdf_fonts_in_dir ( XCAR (directory) );
6322 list = Fnconc( 2, pair ); 6315 list = Fnconc ( 2, pair );
6323 UNGCPRO; 6316 UNGCPRO;
6324 } 6317 }
6325 return list; 6318 return list;
@@ -6458,7 +6451,7 @@ If omitted or nil, that stands for the selected frame's display. */)
6458 /* We force 24+ bit depths to 24-bit, both to prevent an overflow 6451 /* We force 24+ bit depths to 24-bit, both to prevent an overflow
6459 and because probably is more meaningful on Windows anyway */ 6452 and because probably is more meaningful on Windows anyway */
6460 if (cap < 0) 6453 if (cap < 0)
6461 cap = 1 << min(dpyinfo->n_planes * dpyinfo->n_cbits, 24); 6454 cap = 1 << min (dpyinfo->n_planes * dpyinfo->n_cbits, 24);
6462 6455
6463 ReleaseDC (dpyinfo->root_window, hdc); 6456 ReleaseDC (dpyinfo->root_window, hdc);
6464 6457
@@ -6494,8 +6487,8 @@ If omitted or nil, that stands for the selected frame's display. */)
6494DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, 6487DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
6495 doc: /* Returns the version numbers of the server of DISPLAY. 6488 doc: /* Returns the version numbers of the server of DISPLAY.
6496The value is a list of three integers: the major and minor 6489The value is a list of three integers: the major and minor
6497version numbers of the X Protocol in use, and the distributor-specific release 6490version numbers of the X Protocol in use, and the distributor-specific
6498number. See also the function `x-server-vendor'. 6491release number. See also the function `x-server-vendor'.
6499 6492
6500The optional argument DISPLAY specifies which display to ask about. 6493The optional argument DISPLAY specifies which display to ask about.
6501DISPLAY should be either a frame or a display name (a string). 6494DISPLAY should be either a frame or a display name (a string).
@@ -6719,7 +6712,7 @@ terminate Emacs if we can't open the connection. */)
6719 Lisp_Object color_file; 6712 Lisp_Object color_file;
6720 struct gcpro gcpro1; 6713 struct gcpro gcpro1;
6721 6714
6722 color_file = build_string("~/rgb.txt"); 6715 color_file = build_string ("~/rgb.txt");
6723 6716
6724 GCPRO1 (color_file); 6717 GCPRO1 (color_file);
6725 6718
@@ -7955,7 +7948,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
7955 *last = '\0'; 7948 *last = '\0';
7956 } 7949 }
7957 7950
7958 file = DECODE_FILE(build_string (filename)); 7951 file = DECODE_FILE (build_string (filename));
7959 } 7952 }
7960 /* User cancelled the dialog without making a selection. */ 7953 /* User cancelled the dialog without making a selection. */
7961 else if (!CommDlgExtendedError ()) 7954 else if (!CommDlgExtendedError ())
@@ -8090,13 +8083,13 @@ DOCUMENT is typically the name of a document file or a URL, but can
8090also be a program executable to run, or a directory to open in the 8083also be a program executable to run, or a directory to open in the
8091Windows Explorer. 8084Windows Explorer.
8092 8085
8093If DOCUMENT is a program executable, the optional arg PARAMETERS can 8086If DOCUMENT is a program executable, the optional third arg PARAMETERS
8094be a string containing command line parameters that will be passed to 8087can be a string containing command line parameters that will be passed
8095the program; otherwise, PARAMETERS should be nil or unspecified. 8088to the program; otherwise, PARAMETERS should be nil or unspecified.
8096 8089
8097Second optional argument SHOW-FLAG can be used to control how the 8090Optional fourth argument SHOW-FLAG can be used to control how the
8098application will be displayed when it is invoked. If SHOW-FLAG is nil 8091application will be displayed when it is invoked. If SHOW-FLAG is nil
8099or unspceified, the application is displayed normally, otherwise it is 8092or unspecified, the application is displayed normally, otherwise it is
8100an integer representing a ShowWindow flag: 8093an integer representing a ShowWindow flag:
8101 8094
8102 0 - start hidden 8095 0 - start hidden
@@ -8281,7 +8274,6 @@ DEFUN ("w32-unregister-hot-key", Fw32_unregister_hot_key,
8281#else 8274#else
8282 if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY, 8275 if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY,
8283 (WPARAM) XINT (XCAR (item)), (LPARAM) item)) 8276 (WPARAM) XINT (XCAR (item)), (LPARAM) item))
8284
8285#endif 8277#endif
8286 { 8278 {
8287 MSG msg; 8279 MSG msg;
@@ -8297,7 +8289,7 @@ DEFUN ("w32-registered-hot-keys", Fw32_registered_hot_keys,
8297 doc: /* Return list of registered hot-key IDs. */) 8289 doc: /* Return list of registered hot-key IDs. */)
8298 () 8290 ()
8299{ 8291{
8300 return Fcopy_sequence (w32_grabbed_keys); 8292 return Fdelq (Qnil, Fcopy_sequence (w32_grabbed_keys));
8301} 8293}
8302 8294
8303DEFUN ("w32-reconstruct-hot-key", Fw32_reconstruct_hot_key, 8295DEFUN ("w32-reconstruct-hot-key", Fw32_reconstruct_hot_key,
@@ -8460,10 +8452,10 @@ If the underlying system call fails, value is nil. */)
8460 LARGE_INTEGER freebytes; 8452 LARGE_INTEGER freebytes;
8461 LARGE_INTEGER totalbytes; 8453 LARGE_INTEGER totalbytes;
8462 8454
8463 if (pfn_GetDiskFreeSpaceEx(rootname, 8455 if (pfn_GetDiskFreeSpaceEx (rootname,
8464 (ULARGE_INTEGER *)&availbytes, 8456 (ULARGE_INTEGER *)&availbytes,
8465 (ULARGE_INTEGER *)&totalbytes, 8457 (ULARGE_INTEGER *)&totalbytes,
8466 (ULARGE_INTEGER *)&freebytes)) 8458 (ULARGE_INTEGER *)&freebytes))
8467 value = list3 (make_float ((double) totalbytes.QuadPart), 8459 value = list3 (make_float ((double) totalbytes.QuadPart),
8468 make_float ((double) freebytes.QuadPart), 8460 make_float ((double) freebytes.QuadPart),
8469 make_float ((double) availbytes.QuadPart)); 8461 make_float ((double) availbytes.QuadPart));
@@ -8475,11 +8467,11 @@ If the underlying system call fails, value is nil. */)
8475 DWORD free_clusters; 8467 DWORD free_clusters;
8476 DWORD total_clusters; 8468 DWORD total_clusters;
8477 8469
8478 if (GetDiskFreeSpace(rootname, 8470 if (GetDiskFreeSpace (rootname,
8479 &sectors_per_cluster, 8471 &sectors_per_cluster,
8480 &bytes_per_sector, 8472 &bytes_per_sector,
8481 &free_clusters, 8473 &free_clusters,
8482 &total_clusters)) 8474 &total_clusters))
8483 value = list3 (make_float ((double) total_clusters 8475 value = list3 (make_float ((double) total_clusters
8484 * sectors_per_cluster * bytes_per_sector), 8476 * sectors_per_cluster * bytes_per_sector),
8485 make_float ((double) free_clusters 8477 make_float ((double) free_clusters
@@ -8525,12 +8517,12 @@ DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name,
8525 ClosePrinter (hPrn); 8517 ClosePrinter (hPrn);
8526 return Qnil; 8518 return Qnil;
8527 } 8519 }
8528 /* Call GetPrinter() again with big enouth memory block */ 8520 /* Call GetPrinter again with big enouth memory block */
8529 err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned); 8521 err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned);
8530 ClosePrinter (hPrn); 8522 ClosePrinter (hPrn);
8531 if (!err) 8523 if (!err)
8532 { 8524 {
8533 xfree(ppi2); 8525 xfree (ppi2);
8534 return Qnil; 8526 return Qnil;
8535 } 8527 }
8536 8528
@@ -8540,23 +8532,23 @@ DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name,
8540 { 8532 {
8541 /* a remote printer */ 8533 /* a remote printer */
8542 if (*ppi2->pServerName == '\\') 8534 if (*ppi2->pServerName == '\\')
8543 _snprintf(pname_buf, sizeof (pname_buf), "%s\\%s", ppi2->pServerName, 8535 _snprintf (pname_buf, sizeof (pname_buf), "%s\\%s", ppi2->pServerName,
8544 ppi2->pShareName); 8536 ppi2->pShareName);
8545 else 8537 else
8546 _snprintf(pname_buf, sizeof (pname_buf), "\\\\%s\\%s", ppi2->pServerName, 8538 _snprintf (pname_buf, sizeof (pname_buf), "\\\\%s\\%s", ppi2->pServerName,
8547 ppi2->pShareName); 8539 ppi2->pShareName);
8548 pname_buf[sizeof (pname_buf) - 1] = '\0'; 8540 pname_buf[sizeof (pname_buf) - 1] = '\0';
8549 } 8541 }
8550 else 8542 else
8551 { 8543 {
8552 /* a local printer */ 8544 /* a local printer */
8553 strncpy(pname_buf, ppi2->pPortName, sizeof (pname_buf)); 8545 strncpy (pname_buf, ppi2->pPortName, sizeof (pname_buf));
8554 pname_buf[sizeof (pname_buf) - 1] = '\0'; 8546 pname_buf[sizeof (pname_buf) - 1] = '\0';
8555 /* `pPortName' can include several ports, delimited by ','. 8547 /* `pPortName' can include several ports, delimited by ','.
8556 * we only use the first one. */ 8548 * we only use the first one. */
8557 strtok(pname_buf, ","); 8549 strtok (pname_buf, ",");
8558 } 8550 }
8559 xfree(ppi2); 8551 xfree (ppi2);
8560 } 8552 }
8561 8553
8562 return build_string (pname_buf); 8554 return build_string (pname_buf);
@@ -8817,14 +8809,14 @@ Value must be an integer or float. */);
8817 Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); 8809 Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY);
8818 8810
8819 DEFVAR_LISP ("x-sensitive-text-pointer-shape", 8811 DEFVAR_LISP ("x-sensitive-text-pointer-shape",
8820 &Vx_sensitive_text_pointer_shape, 8812 &Vx_sensitive_text_pointer_shape,
8821 doc: /* The shape of the pointer when over mouse-sensitive text. 8813 doc: /* The shape of the pointer when over mouse-sensitive text.
8822This variable takes effect when you create a new frame 8814This variable takes effect when you create a new frame
8823or when you set the mouse color. */); 8815or when you set the mouse color. */);
8824 Vx_sensitive_text_pointer_shape = Qnil; 8816 Vx_sensitive_text_pointer_shape = Qnil;
8825 8817
8826 DEFVAR_LISP ("x-window-horizontal-drag-cursor", 8818 DEFVAR_LISP ("x-window-horizontal-drag-cursor",
8827 &Vx_window_horizontal_drag_shape, 8819 &Vx_window_horizontal_drag_shape,
8828 doc: /* Pointer shape to use for indicating a window can be dragged horizontally. 8820 doc: /* Pointer shape to use for indicating a window can be dragged horizontally.
8829This variable takes effect when you create a new frame 8821This variable takes effect when you create a new frame
8830or when you set the mouse color. */); 8822or when you set the mouse color. */);
@@ -9050,7 +9042,8 @@ versions of Windows) characters. */);
9050 variable initialized is 0 and directly from main when initialized 9042 variable initialized is 0 and directly from main when initialized
9051 is non zero. 9043 is non zero.
9052 */ 9044 */
9053void globals_of_w32fns () 9045void
9046globals_of_w32fns ()
9054{ 9047{
9055 HMODULE user32_lib = GetModuleHandle ("user32.dll"); 9048 HMODULE user32_lib = GetModuleHandle ("user32.dll");
9056 /* 9049 /*
@@ -9077,7 +9070,7 @@ void globals_of_w32fns ()
9077void w32_abort (void) NO_RETURN; 9070void w32_abort (void) NO_RETURN;
9078 9071
9079void 9072void
9080w32_abort() 9073w32_abort ()
9081{ 9074{
9082 int button; 9075 int button;
9083 button = MessageBox (NULL, 9076 button = MessageBox (NULL,
@@ -9105,7 +9098,7 @@ w32_abort()
9105 9098
9106/* For convenience when debugging. */ 9099/* For convenience when debugging. */
9107int 9100int
9108w32_last_error() 9101w32_last_error ()
9109{ 9102{
9110 return GetLastError (); 9103 return GetLastError ();
9111} 9104}