aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog82
-rw-r--r--src/alloc.c23
-rw-r--r--src/bytecode.c15
-rw-r--r--src/config.in16
-rw-r--r--src/eval.c30
-rw-r--r--src/insdel.c1
-rw-r--r--src/keyboard.c3
-rw-r--r--src/lisp.h6
-rw-r--r--src/mac.c58
-rw-r--r--src/macfns.c318
-rw-r--r--src/macmenu.c57
-rw-r--r--src/macselect.c12
-rw-r--r--src/s/cygwin.h4
-rw-r--r--src/w32fns.c8
-rw-r--r--src/w32menu.c7
-rw-r--r--src/w32term.c16
16 files changed, 337 insertions, 319 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5f04eec4768..e23f9bdacbf 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,85 @@
12005-07-28 Juanma Barranquero <lekktu@gmail.com>
2
3 * w32fns.c (my_set_window_pos, my_show_window): Don't declare.
4 (my_create_window, my_create_tip_window): Make static.
5
6 * w32term.c (my_show_window, my_set_window_pos, my_set_focus)
7 (my_set_foreground_window, my_destroy_window): Make static.
8
92005-07-26 Paul Eggert <eggert@cs.ucla.edu>
10
11 Merge gnulib getopt implementation into Emacs.
12
13 * s/cygwin.h (C_SWITCH_SYSTEM): Remove, since gettext.h is
14 now part of lib-src.
15
162005-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
17
18 * eval.c (Fdefvar): Allow (defvar enable-multibyte-characters).
19
202005-07-25 Jason Rumney <jasonr@gnu.org>
21
22 * w32menu.c (w32_menu_display_help): Suppress tooltip when
23 navigating menus with the keyboard.
24
252005-07-23 Richard M. Stallman <rms@gnu.org>
26
27 * insdel.c (syms_of_insdel): staticpro combine_after_change_buffer.
28
29 * bytecode.c (MAYBE_GC): Test gc_cons_threshold and
30 gc_relative_threshold, one by one.
31
32 * keyboard.c (read_char): Test gc_cons_threshold.
33 (syms_of_keyboard): staticpro Qecho_area_clear_hook.
34
35 * eval.c (Feval, Ffuncall): Test gc_cons_threshold and
36 gc_relative_threshold, one by one.
37
38 * alloc.c (gc_cons_threshold): Not static.
39 (gc_cons_combined_threshold): Var deleted.
40 (gc_relative_threshold): New variable.
41 (Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold
42 instead of gc_cons_combined_threshold.
43
44 * lisp.h (gc_cons_threshold, gc_relative_threshold): Declare.
45 (gc_cons_combined_threshold): Declaration deleted.
46
472005-07-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
48
49 * mac.c: Don't include stdlib.h or string.h.
50 (Fdo_applescript, Fmac_file_name_to_posix)
51 (Fmac_file_name_to_posix): Doc fixes.
52 [TARGET_API_MAC_CARBON] (Fmac_get_preference)
53 (Fmac_code_convert_string): Likewise.
54 [MAC_OSX] (init_mac_osx_environment): Fall back on terminal mode
55 if the executable is not contained in a bundle.
56
57 * macfns.c: Don't include stdlib.h or string.h. Include atimer.h.
58 (gray_width, gray_height): Remove defines.
59 (gray_bits, gray_bitmap_width, gray_bitmap_height)
60 (gray_bitmap_bits): Remove variables.
61 (lispy_function_keys): Remove extern.
62 (free_frame_menubar): Add extern.
63 (x_window_to_frame): Remove function.
64 (unwind_create_tip_frame): Add declaration.
65 (x_set_name_internal): New function.
66 (x_set_name, x_set_title): Use it.
67 (Fx_create_frame, Fx_display_grayscale_p, Fx_display_pixel_width)
68 (Fx_display_pixel_height, Fx_display_planes)
69 (Fx_display_color_cells, Fx_server_max_request_size)
70 (Fx_server_vendor, Fx_server_version, Fx_display_screens)
71 (Fx_display_mm_height, Fx_display_mm_width)
72 (Fx_display_backing_store, Fx_display_visual_class)
73 (Fx_display_save_under, Fx_synchronize, Fx_show_tip): Doc fixes.
74
75 * macmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes.
76
77 * macselect.c (Fx_own_selection_internal): Follow error
78 conventions.
79 (Fx_get_selection_internal, Fx_selection_owner_p)
80 (Fx_selection_exists_p): Doc fixes.
81 (syms_of_macselect) <selection-converter-alist>: Likewise.
82
12005-07-21 Juanma Barranquero <lekktu@gmail.com> 832005-07-21 Juanma Barranquero <lekktu@gmail.com>
2 84
3 * buffer.c (syms_of_buffer) <cursor-type>: Doc fix. 85 * buffer.c (syms_of_buffer) <cursor-type>: Doc fix.
diff --git a/src/alloc.c b/src/alloc.c
index 5c5252b1ba1..35bdfc8a93a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -172,10 +172,14 @@ EMACS_INT misc_objects_consed;
172EMACS_INT intervals_consed; 172EMACS_INT intervals_consed;
173EMACS_INT strings_consed; 173EMACS_INT strings_consed;
174 174
175/* Number of bytes of consing since GC before another GC should be done. */ 175/* Minimum number of bytes of consing since GC before next GC. */
176
177EMACS_INT gc_cons_threshold;
178
179/* Similar minimum, computed from Vgc_cons_percentage. */
180
181EMACS_INT gc_relative_threshold;
176 182
177static EMACS_INT gc_cons_threshold;
178EMACS_INT gc_cons_combined_threshold;
179static Lisp_Object Vgc_cons_percentage; 183static Lisp_Object Vgc_cons_percentage;
180 184
181/* Nonzero during GC. */ 185/* Nonzero during GC. */
@@ -4856,12 +4860,10 @@ returns nil, because real GC can't be done. */)
4856 if (gc_cons_threshold < 10000) 4860 if (gc_cons_threshold < 10000)
4857 gc_cons_threshold = 10000; 4861 gc_cons_threshold = 10000;
4858 4862
4859 gc_cons_combined_threshold = gc_cons_threshold;
4860
4861 if (FLOATP (Vgc_cons_percentage)) 4863 if (FLOATP (Vgc_cons_percentage))
4862 { /* Set gc_cons_combined_threshold. */ 4864 { /* Set gc_cons_combined_threshold. */
4863 EMACS_INT total = 0; 4865 EMACS_INT total = 0;
4864 EMACS_INT threshold; 4866
4865 total += total_conses * sizeof (struct Lisp_Cons); 4867 total += total_conses * sizeof (struct Lisp_Cons);
4866 total += total_symbols * sizeof (struct Lisp_Symbol); 4868 total += total_symbols * sizeof (struct Lisp_Symbol);
4867 total += total_markers * sizeof (union Lisp_Misc); 4869 total += total_markers * sizeof (union Lisp_Misc);
@@ -4871,10 +4873,10 @@ returns nil, because real GC can't be done. */)
4871 total += total_intervals * sizeof (struct interval); 4873 total += total_intervals * sizeof (struct interval);
4872 total += total_strings * sizeof (struct Lisp_String); 4874 total += total_strings * sizeof (struct Lisp_String);
4873 4875
4874 threshold = total * XFLOAT_DATA (Vgc_cons_percentage); 4876 gc_relative_threshold = total * XFLOAT_DATA (Vgc_cons_percentage);
4875 if (threshold > gc_cons_combined_threshold)
4876 gc_cons_combined_threshold = threshold;
4877 } 4877 }
4878 else
4879 gc_relative_threshold = 0;
4878 4880
4879 if (garbage_collection_messages) 4881 if (garbage_collection_messages)
4880 { 4882 {
@@ -5965,7 +5967,8 @@ init_alloc_once ()
5965 staticidx = 0; 5967 staticidx = 0;
5966 consing_since_gc = 0; 5968 consing_since_gc = 0;
5967 gc_cons_threshold = 100000 * sizeof (Lisp_Object); 5969 gc_cons_threshold = 100000 * sizeof (Lisp_Object);
5968 gc_cons_combined_threshold = gc_cons_threshold; 5970 gc_relative_threshold = 0;
5971
5969#ifdef VIRT_ADDR_VARIES 5972#ifdef VIRT_ADDR_VARIES
5970 malloc_sbrk_unused = 1<<22; /* A large number */ 5973 malloc_sbrk_unused = 1<<22; /* A large number */
5971 malloc_sbrk_used = 100000; /* as reasonable as any number */ 5974 malloc_sbrk_used = 100000; /* as reasonable as any number */
diff --git a/src/bytecode.c b/src/bytecode.c
index 580fdc67119..c9ab56b18d1 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -355,13 +355,14 @@ unmark_byte_stack ()
355/* Garbage collect if we have consed enough since the last time. 355/* Garbage collect if we have consed enough since the last time.
356 We do this at every branch, to avoid loops that never GC. */ 356 We do this at every branch, to avoid loops that never GC. */
357 357
358#define MAYBE_GC() \ 358#define MAYBE_GC() \
359 if (consing_since_gc > gc_cons_combined_threshold) \ 359 if (consing_since_gc > gc_cons_threshold \
360 { \ 360 && consing_since_gc > gc_relative_threshold) \
361 BEFORE_POTENTIAL_GC (); \ 361 { \
362 Fgarbage_collect (); \ 362 BEFORE_POTENTIAL_GC (); \
363 AFTER_POTENTIAL_GC (); \ 363 Fgarbage_collect (); \
364 } \ 364 AFTER_POTENTIAL_GC (); \
365 } \
365 else 366 else
366 367
367/* Check for jumping out of range. */ 368/* Check for jumping out of range. */
diff --git a/src/config.in b/src/config.in
index d3369641a8f..f2afed2ecb1 100644
--- a/src/config.in
+++ b/src/config.in
@@ -191,6 +191,12 @@ Boston, MA 02110-1301, USA. */
191/* Define to 1 if you have the `getloadavg' function. */ 191/* Define to 1 if you have the `getloadavg' function. */
192#undef HAVE_GETLOADAVG 192#undef HAVE_GETLOADAVG
193 193
194/* Define to 1 if you have the <getopt.h> header file. */
195#undef HAVE_GETOPT_H
196
197/* Define to 1 if you have the `getopt_long_only' function. */
198#undef HAVE_GETOPT_LONG_ONLY
199
194/* Define to 1 if you have the `getpagesize' function. */ 200/* Define to 1 if you have the `getpagesize' function. */
195#undef HAVE_GETPAGESIZE 201#undef HAVE_GETPAGESIZE
196 202
@@ -785,9 +791,9 @@ Boston, MA 02110-1301, USA. */
785/* If using the C implementation of alloca, define if you know the 791/* If using the C implementation of alloca, define if you know the
786 direction of stack growth for your system; otherwise it will be 792 direction of stack growth for your system; otherwise it will be
787 automatically deduced at run-time. 793 automatically deduced at run-time.
788 STACK_DIRECTION > 0 => grows toward higher addresses 794 STACK_DIRECTION > 0 => grows toward higher addresses
789 STACK_DIRECTION < 0 => grows toward lower addresses 795 STACK_DIRECTION < 0 => grows toward lower addresses
790 STACK_DIRECTION = 0 => direction of growth unknown */ 796 STACK_DIRECTION = 0 => direction of growth unknown */
791#undef STACK_DIRECTION 797#undef STACK_DIRECTION
792 798
793/* Define to 1 if you have the ANSI C header files. */ 799/* Define to 1 if you have the ANSI C header files. */
@@ -846,6 +852,10 @@ Boston, MA 02110-1301, USA. */
846/* Define for large files, on AIX-style hosts. */ 852/* Define for large files, on AIX-style hosts. */
847#undef _LARGE_FILES 853#undef _LARGE_FILES
848 854
855/* Define to rpl_ if the getopt replacement functions and variables should be
856 used. */
857#undef __GETOPT_PREFIX
858
849/* Define like PROTOTYPES; this can be used by system headers. */ 859/* Define like PROTOTYPES; this can be used by system headers. */
850#undef __PROTOTYPES 860#undef __PROTOTYPES
851 861
diff --git a/src/eval.c b/src/eval.c
index 26d1ce967a7..56fe670f1b1 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -807,18 +807,6 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
807 register Lisp_Object sym, tem, tail; 807 register Lisp_Object sym, tem, tail;
808 808
809 sym = Fcar (args); 809 sym = Fcar (args);
810 if (SYMBOL_CONSTANT_P (sym))
811 {
812 /* For updward compatibility, allow (defvar :foo (quote :foo)). */
813 tem = Fcar (Fcdr (args));
814 if (! (CONSP (tem)
815 && EQ (XCAR (tem), Qquote)
816 && CONSP (XCDR (tem))
817 && EQ (XCAR (XCDR (tem)), sym)))
818 error ("Constant symbol `%s' specified in defvar",
819 SDATA (SYMBOL_NAME (sym)));
820 }
821
822 tail = Fcdr (args); 810 tail = Fcdr (args);
823 if (!NILP (Fcdr (Fcdr (tail)))) 811 if (!NILP (Fcdr (Fcdr (tail))))
824 error ("Too many arguments"); 812 error ("Too many arguments");
@@ -826,6 +814,18 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
826 tem = Fdefault_boundp (sym); 814 tem = Fdefault_boundp (sym);
827 if (!NILP (tail)) 815 if (!NILP (tail))
828 { 816 {
817 if (SYMBOL_CONSTANT_P (sym))
818 {
819 /* For upward compatibility, allow (defvar :foo (quote :foo)). */
820 Lisp_Object tem = Fcar (tail);
821 if (! (CONSP (tem)
822 && EQ (XCAR (tem), Qquote)
823 && CONSP (XCDR (tem))
824 && EQ (XCAR (XCDR (tem)), sym)))
825 error ("Constant symbol `%s' specified in defvar",
826 SDATA (SYMBOL_NAME (sym)));
827 }
828
829 if (NILP (tem)) 829 if (NILP (tem))
830 Fset_default (sym, Feval (Fcar (tail))); 830 Fset_default (sym, Feval (Fcar (tail)));
831 else 831 else
@@ -2094,7 +2094,8 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
2094 return form; 2094 return form;
2095 2095
2096 QUIT; 2096 QUIT;
2097 if (consing_since_gc > gc_cons_combined_threshold) 2097 if (consing_since_gc > gc_cons_threshold
2098 && consing_since_gc > gc_relative_threshold)
2098 { 2099 {
2099 GCPRO1 (form); 2100 GCPRO1 (form);
2100 Fgarbage_collect (); 2101 Fgarbage_collect ();
@@ -2794,7 +2795,8 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2794 register int i; 2795 register int i;
2795 2796
2796 QUIT; 2797 QUIT;
2797 if (consing_since_gc > gc_cons_combined_threshold) 2798 if (consing_since_gc > gc_cons_threshold
2799 && consing_since_gc > gc_relative_threshold)
2798 Fgarbage_collect (); 2800 Fgarbage_collect ();
2799 2801
2800 if (++lisp_eval_depth > max_lisp_eval_depth) 2802 if (++lisp_eval_depth > max_lisp_eval_depth)
diff --git a/src/insdel.c b/src/insdel.c
index b4ec4d4ee34..981c45c2dbd 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -2426,6 +2426,7 @@ void
2426syms_of_insdel () 2426syms_of_insdel ()
2427{ 2427{
2428 staticpro (&combine_after_change_list); 2428 staticpro (&combine_after_change_list);
2429 staticpro (&combine_after_change_buffer);
2429 combine_after_change_list = Qnil; 2430 combine_after_change_list = Qnil;
2430 combine_after_change_buffer = Qnil; 2431 combine_after_change_buffer = Qnil;
2431 2432
diff --git a/src/keyboard.c b/src/keyboard.c
index 9da6ce92471..87a4ce3c997 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2778,7 +2778,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2778 available, garbage collect if there has been enough 2778 available, garbage collect if there has been enough
2779 consing going on to make it worthwhile. */ 2779 consing going on to make it worthwhile. */
2780 if (!detect_input_pending_run_timers (0) 2780 if (!detect_input_pending_run_timers (0)
2781 && consing_since_gc > gc_cons_combined_threshold / 2) 2781 && consing_since_gc > gc_cons_threshold / 2)
2782 Fgarbage_collect (); 2782 Fgarbage_collect ();
2783 2783
2784 redisplay (); 2784 redisplay ();
@@ -11280,6 +11280,7 @@ might happen repeatedly and make Emacs nonfunctional. */);
11280 doc: /* Normal hook run when clearing the echo area. */); 11280 doc: /* Normal hook run when clearing the echo area. */);
11281#endif 11281#endif
11282 Qecho_area_clear_hook = intern ("echo-area-clear-hook"); 11282 Qecho_area_clear_hook = intern ("echo-area-clear-hook");
11283 staticpro (&Qecho_area_clear_hook);
11283 SET_SYMBOL_VALUE (Qecho_area_clear_hook, Qnil); 11284 SET_SYMBOL_VALUE (Qecho_area_clear_hook, Qnil);
11284 11285
11285 DEFVAR_LISP ("lucid-menu-bar-dirty-flag", &Vlucid_menu_bar_dirty_flag, 11286 DEFVAR_LISP ("lucid-menu-bar-dirty-flag", &Vlucid_menu_bar_dirty_flag,
diff --git a/src/lisp.h b/src/lisp.h
index aaee9dcc879..086cce3ce9f 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1886,9 +1886,11 @@ extern Lisp_Object Vascii_canon_table, Vascii_eqv_table;
1886 1886
1887extern int consing_since_gc; 1887extern int consing_since_gc;
1888 1888
1889/* Threshold for doing another gc. */ 1889/* Thresholds for doing another gc. */
1890 1890
1891extern EMACS_INT gc_cons_combined_threshold; 1891extern EMACS_INT gc_cons_threshold;
1892
1893extern EMACS_INT gc_relative_threshold;
1892 1894
1893/* Structure for recording stack slots that need marking. */ 1895/* Structure for recording stack slots that need marking. */
1894 1896
diff --git a/src/mac.c b/src/mac.c
index 11dd93aa88d..5558cbb797e 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -59,11 +59,9 @@ Boston, MA 02110-1301, USA. */
59#include <dirent.h> 59#include <dirent.h>
60#include <sys/types.h> 60#include <sys/types.h>
61#include <sys/stat.h> 61#include <sys/stat.h>
62#include <string.h>
63#include <pwd.h> 62#include <pwd.h>
64#include <grp.h> 63#include <grp.h>
65#include <sys/param.h> 64#include <sys/param.h>
66#include <stdlib.h>
67#include <fcntl.h> 65#include <fcntl.h>
68#if __MWERKS__ 66#if __MWERKS__
69#include <unistd.h> 67#include <unistd.h>
@@ -3447,7 +3445,7 @@ mac_get_object_from_code(OSType defCode)
3447 3445
3448DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1, 1, 0, 3446DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1, 1, 0,
3449 doc: /* Get the creator code of FILENAME as a four character string. */) 3447 doc: /* Get the creator code of FILENAME as a four character string. */)
3450 (filename) 3448 (filename)
3451 Lisp_Object filename; 3449 Lisp_Object filename;
3452{ 3450{
3453 OSErr status; 3451 OSErr status;
@@ -3502,7 +3500,7 @@ DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1,
3502 3500
3503DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0, 3501DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0,
3504 doc: /* Get the type code of FILENAME as a four character string. */) 3502 doc: /* Get the type code of FILENAME as a four character string. */)
3505 (filename) 3503 (filename)
3506 Lisp_Object filename; 3504 Lisp_Object filename;
3507{ 3505{
3508 OSErr status; 3506 OSErr status;
@@ -3559,7 +3557,7 @@ DEFUN ("mac-set-file-creator", Fmac_set_file_creator, Smac_set_file_creator, 1,
3559 doc: /* Set creator code of file FILENAME to CODE. 3557 doc: /* Set creator code of file FILENAME to CODE.
3560If non-nil, CODE must be a 4-character string. Otherwise, 'EMAx' is 3558If non-nil, CODE must be a 4-character string. Otherwise, 'EMAx' is
3561assumed. Return non-nil if successful. */) 3559assumed. Return non-nil if successful. */)
3562 (filename, code) 3560 (filename, code)
3563 Lisp_Object filename, code; 3561 Lisp_Object filename, code;
3564{ 3562{
3565 OSErr status; 3563 OSErr status;
@@ -3619,7 +3617,7 @@ assumed. Return non-nil if successful. */)
3619DEFUN ("mac-set-file-type", Fmac_set_file_type, Smac_set_file_type, 2, 2, 0, 3617DEFUN ("mac-set-file-type", Fmac_set_file_type, Smac_set_file_type, 2, 2, 0,
3620 doc: /* Set file code of file FILENAME to CODE. 3618 doc: /* Set file code of file FILENAME to CODE.
3621CODE must be a 4-character string. Return non-nil if successful. */) 3619CODE must be a 4-character string. Return non-nil if successful. */)
3622 (filename, code) 3620 (filename, code)
3623 Lisp_Object filename, code; 3621 Lisp_Object filename, code;
3624{ 3622{
3625 OSErr status; 3623 OSErr status;
@@ -3766,12 +3764,12 @@ do_applescript (char *script, char **result)
3766 3764
3767 3765
3768DEFUN ("do-applescript", Fdo_applescript, Sdo_applescript, 1, 1, 0, 3766DEFUN ("do-applescript", Fdo_applescript, Sdo_applescript, 1, 1, 0,
3769 doc: /* Compile and execute AppleScript SCRIPT and retrieve and return the result. 3767 doc: /* Compile and execute AppleScript SCRIPT and return the result.
3770If compilation and execution are successful, the resulting script 3768If compilation and execution are successful, the resulting script
3771value is returned as a string. Otherwise the function aborts and 3769value is returned as a string. Otherwise the function aborts and
3772displays the error message returned by the AppleScript scripting 3770displays the error message returned by the AppleScript scripting
3773component. */) 3771component. */)
3774 (script) 3772 (script)
3775 Lisp_Object script; 3773 Lisp_Object script;
3776{ 3774{
3777 char *result, *temp; 3775 char *result, *temp;
@@ -3811,16 +3809,15 @@ component. */)
3811 3809
3812DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix, 3810DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix,
3813 Smac_file_name_to_posix, 1, 1, 0, 3811 Smac_file_name_to_posix, 1, 1, 0,
3814 doc: /* Convert Macintosh filename to Posix form. */) 3812 doc: /* Convert Macintosh FILENAME to Posix form. */)
3815 (mac_filename) 3813 (filename)
3816 Lisp_Object mac_filename; 3814 Lisp_Object filename;
3817{ 3815{
3818 char posix_filename[MAXPATHLEN+1]; 3816 char posix_filename[MAXPATHLEN+1];
3819 3817
3820 CHECK_STRING (mac_filename); 3818 CHECK_STRING (filename);
3821 3819
3822 if (mac_to_posix_pathname (SDATA (mac_filename), posix_filename, 3820 if (mac_to_posix_pathname (SDATA (filename), posix_filename, MAXPATHLEN))
3823 MAXPATHLEN))
3824 return build_string (posix_filename); 3821 return build_string (posix_filename);
3825 else 3822 else
3826 return Qnil; 3823 return Qnil;
@@ -3829,16 +3826,15 @@ DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix,
3829 3826
3830DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac, 3827DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac,
3831 Sposix_file_name_to_mac, 1, 1, 0, 3828 Sposix_file_name_to_mac, 1, 1, 0,
3832 doc: /* Convert Posix filename to Mac form. */) 3829 doc: /* Convert Posix FILENAME to Mac form. */)
3833 (posix_filename) 3830 (filename)
3834 Lisp_Object posix_filename; 3831 Lisp_Object filename;
3835{ 3832{
3836 char mac_filename[MAXPATHLEN+1]; 3833 char mac_filename[MAXPATHLEN+1];
3837 3834
3838 CHECK_STRING (posix_filename); 3835 CHECK_STRING (filename);
3839 3836
3840 if (posix_to_mac_pathname (SDATA (posix_filename), mac_filename, 3837 if (posix_to_mac_pathname (SDATA (filename), mac_filename, MAXPATHLEN))
3841 MAXPATHLEN))
3842 return build_string (mac_filename); 3838 return build_string (mac_filename);
3843 else 3839 else
3844 return Qnil; 3840 return Qnil;
@@ -3853,8 +3849,8 @@ DEFUN ("mac-get-preference", Fmac_get_preference, Smac_get_preference, 1, 4, 0,
3853 doc: /* Return the application preference value for KEY. 3849 doc: /* Return the application preference value for KEY.
3854KEY is either a string specifying a preference key, or a list of key 3850KEY is either a string specifying a preference key, or a list of key
3855strings. If it is a list, the (i+1)-th element is used as a key for 3851strings. If it is a list, the (i+1)-th element is used as a key for
3856the CFDictionary value obtained by the i-th element. If lookup is 3852the CFDictionary value obtained by the i-th element. Return nil if
3857failed at some stage, nil is returned. 3853lookup is failed at some stage.
3858 3854
3859Optional arg APPLICATION is an application ID string. If omitted or 3855Optional arg APPLICATION is an application ID string. If omitted or
3860nil, that stands for the current application. 3856nil, that stands for the current application.
@@ -3885,7 +3881,7 @@ CFDictionary. If HASH-BOUND is a negative integer or nil, always
3885generate alists. If HASH-BOUND >= 0, generate an alist if the number 3881generate alists. If HASH-BOUND >= 0, generate an alist if the number
3886of keys in the dictionary is smaller than HASH-BOUND, and a hash table 3882of keys in the dictionary is smaller than HASH-BOUND, and a hash table
3887otherwise. */) 3883otherwise. */)
3888 (key, application, format, hash_bound) 3884 (key, application, format, hash_bound)
3889 Lisp_Object key, application, format, hash_bound; 3885 Lisp_Object key, application, format, hash_bound;
3890{ 3886{
3891 CFStringRef app_id, key_str; 3887 CFStringRef app_id, key_str;
@@ -4122,9 +4118,8 @@ charset string, or an integer as a CFStringEncoding value.
4122On Mac OS X 10.2 and later, you can do Unicode Normalization by 4118On Mac OS X 10.2 and later, you can do Unicode Normalization by
4123specifying the optional argument NORMALIZATION-FORM with a symbol NFD, 4119specifying the optional argument NORMALIZATION-FORM with a symbol NFD,
4124NFKD, NFC, NFKC, HFS+D, or HFS+C. 4120NFKD, NFC, NFKC, HFS+D, or HFS+C.
4125On successful conversion, returns the result string, else returns 4121On successful conversion, return the result string, else return nil. */)
4126nil. */) 4122 (string, source, target, normalization_form)
4127 (string, source, target, normalization_form)
4128 Lisp_Object string, source, target, normalization_form; 4123 Lisp_Object string, source, target, normalization_form;
4129{ 4124{
4130 Lisp_Object result = Qnil; 4125 Lisp_Object result = Qnil;
@@ -4183,7 +4178,7 @@ nil. */)
4183 4178
4184DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, Smac_clear_font_name_table, 0, 0, 0, 4179DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, Smac_clear_font_name_table, 0, 0, 0,
4185 doc: /* Clear the font name table. */) 4180 doc: /* Clear the font name table. */)
4186 () 4181 ()
4187{ 4182{
4188 check_mac (); 4183 check_mac ();
4189 mac_clear_font_name_table (); 4184 mac_clear_font_name_table ();
@@ -4483,8 +4478,13 @@ init_mac_osx_environment ()
4483 app_bundle_pathname. */ 4478 app_bundle_pathname. */
4484 4479
4485 bundle = CFBundleGetMainBundle (); 4480 bundle = CFBundleGetMainBundle ();
4486 if (!bundle) 4481 if (!bundle || CFBundleGetIdentifier (bundle) == NULL)
4487 return; 4482 {
4483 /* We could not find the bundle identifier. For now, prevent
4484 the fatal error by bringing it up in the terminal. */
4485 inhibit_window_system = 1;
4486 return;
4487 }
4488 4488
4489 bundleURL = CFBundleCopyBundleURL (bundle); 4489 bundleURL = CFBundleCopyBundleURL (bundle);
4490 if (!bundleURL) 4490 if (!bundleURL)
diff --git a/src/macfns.c b/src/macfns.c
index a37ddde3458..615c312f3ac 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -21,58 +21,34 @@ Boston, MA 02110-1301, USA. */
21/* Contributed by Andrew Choi (akochoi@mac.com). */ 21/* Contributed by Andrew Choi (akochoi@mac.com). */
22 22
23#include <config.h> 23#include <config.h>
24
25#include <stdio.h> 24#include <stdio.h>
26#include <math.h> 25#include <math.h>
27#include <limits.h>
28#include <errno.h>
29 26
30#include "lisp.h" 27#include "lisp.h"
31#include "charset.h"
32#include "macterm.h" 28#include "macterm.h"
33#include "frame.h" 29#include "frame.h"
34#include "window.h" 30#include "window.h"
35#include "buffer.h" 31#include "buffer.h"
36#include "dispextern.h"
37#include "fontset.h"
38#include "intervals.h" 32#include "intervals.h"
33#include "dispextern.h"
39#include "keyboard.h" 34#include "keyboard.h"
40#include "blockinput.h" 35#include "blockinput.h"
41#include "epaths.h" 36#include <epaths.h>
42#include "termhooks.h" 37#include "charset.h"
43#include "coding.h" 38#include "coding.h"
39#include "fontset.h"
44#include "systime.h" 40#include "systime.h"
41#include "termhooks.h"
42#include "atimer.h"
45 43
46/* #include "bitmaps/gray.xbm" */
47#define gray_width 2
48#define gray_height 2
49static unsigned char gray_bits[] = {
50 0x01, 0x02};
51
52/*#include <commdlg.h>
53#include <shellapi.h>*/
54#include <ctype.h> 44#include <ctype.h>
55#include <sys/types.h> 45#include <sys/types.h>
56#include <sys/stat.h> 46#include <sys/stat.h>
47#include <limits.h>
48#include <errno.h>
57#include <sys/param.h> 49#include <sys/param.h>
58 50
59#include <stdlib.h> 51extern void free_frame_menubar ();
60#include <string.h>
61
62/*extern void free_frame_menubar ();
63extern double atof ();
64extern int w32_console_toggle_lock_key (int vk_code, Lisp_Object new_state);
65extern int quit_char;*/
66
67extern char *lispy_function_keys[];
68
69/* The gray bitmap `bitmaps/gray'. This is done because macterm.c uses
70 it, and including `bitmaps/gray' more than once is a problem when
71 config.h defines `static' as an empty replacement string. */
72
73int gray_bitmap_width = gray_width;
74int gray_bitmap_height = gray_height;
75unsigned char *gray_bitmap_bits = gray_bits;
76 52
77/* Non-zero means we're allowed to display an hourglass cursor. */ 53/* Non-zero means we're allowed to display an hourglass cursor. */
78 54
@@ -109,46 +85,13 @@ Lisp_Object Vx_no_window_manager;
109 85
110Lisp_Object Vx_pixel_size_width_font_regexp; 86Lisp_Object Vx_pixel_size_width_font_regexp;
111 87
112/* Evaluate this expression to rebuild the section of syms_of_macfns
113 that initializes and staticpros the symbols declared below. Note
114 that Emacs 18 has a bug that keeps C-x C-e from being able to
115 evaluate this expression.
116
117(progn
118 ;; Accumulate a list of the symbols we want to initialize from the
119 ;; declarations at the top of the file.
120 (goto-char (point-min))
121 (search-forward "/\*&&& symbols declared here &&&*\/\n")
122 (let (symbol-list)
123 (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)")
124 (setq symbol-list
125 (cons (buffer-substring (match-beginning 1) (match-end 1))
126 symbol-list))
127 (forward-line 1))
128 (setq symbol-list (nreverse symbol-list))
129 ;; Delete the section of syms_of_... where we initialize the symbols.
130 (search-forward "\n /\*&&& init symbols here &&&*\/\n")
131 (let ((start (point)))
132 (while (looking-at "^ Q")
133 (forward-line 2))
134 (kill-region start (point)))
135 ;; Write a new symbol initialization section.
136 (while symbol-list
137 (insert (format " %s = intern (\"" (car symbol-list)))
138 (let ((start (point)))
139 (insert (substring (car symbol-list) 1))
140 (subst-char-in-region start (point) ?_ ?-))
141 (insert (format "\");\n staticpro (&%s);\n" (car symbol-list)))
142 (setq symbol-list (cdr symbol-list)))))
143
144 */
145
146/*&&& symbols declared here &&&*/
147Lisp_Object Qnone; 88Lisp_Object Qnone;
148Lisp_Object Qsuppress_icon; 89Lisp_Object Qsuppress_icon;
149Lisp_Object Qundefined_color; 90Lisp_Object Qundefined_color;
150Lisp_Object Qcancel_timer; 91Lisp_Object Qcancel_timer;
151 92
93/* In dispnew.c */
94
152extern Lisp_Object Vwindow_system_version; 95extern Lisp_Object Vwindow_system_version;
153 96
154#if 0 /* Use xstricmp instead. */ 97#if 0 /* Use xstricmp instead. */
@@ -243,40 +186,11 @@ check_x_display_info (frame)
243 186
244 return dpyinfo; 187 return dpyinfo;
245} 188}
246
247/* Return the Emacs frame-object corresponding to a mac window.
248 It could be the frame's main window or an icon window. */
249
250/* This function can be called during GC, so use GC_xxx type test macros. */
251
252struct frame *
253x_window_to_frame (dpyinfo, wdesc)
254 struct mac_display_info *dpyinfo;
255 WindowPtr wdesc;
256{
257 Lisp_Object tail, frame;
258 struct frame *f;
259
260 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
261 {
262 frame = XCAR (tail);
263 if (!GC_FRAMEP (frame))
264 continue;
265 f = XFRAME (frame);
266 if (!FRAME_W32_P (f) || FRAME_MAC_DISPLAY_INFO (f) != dpyinfo)
267 continue;
268 /*if (f->output_data.w32->hourglass_window == wdesc)
269 return f;*/
270
271 /* MAC_TODO: Check tooltips when supported. */
272 if (FRAME_MAC_WINDOW (f) == wdesc)
273 return f;
274 }
275 return 0;
276}
277 189
278 190
191
279static Lisp_Object unwind_create_frame P_ ((Lisp_Object)); 192static Lisp_Object unwind_create_frame P_ ((Lisp_Object));
193static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object));
280 194
281void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 195void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
282void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 196void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
@@ -302,6 +216,8 @@ static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *,
302 216
303extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *)); 217extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *));
304 218
219
220
305/* Store the screen positions of frame F into XPTR and YPTR. 221/* Store the screen positions of frame F into XPTR and YPTR.
306 These are the positions of the containing window manager window, 222 These are the positions of the containing window manager window,
307 not Emacs's own window. */ 223 not Emacs's own window. */
@@ -1834,8 +1750,49 @@ x_set_tool_bar_lines (f, value, oldval)
1834} 1750}
1835 1751
1836 1752
1753
1754/* Set the Mac window title to NAME for frame F. */
1755
1756static void
1757x_set_name_internal (f, name)
1758 FRAME_PTR f;
1759 Lisp_Object name;
1760{
1761 if (FRAME_MAC_WINDOW (f))
1762 {
1763 if (STRING_MULTIBYTE (name))
1764#if TARGET_API_MAC_CARBON
1765 name = ENCODE_UTF_8 (name);
1766#else
1767 name = ENCODE_SYSTEM (name);
1768#endif
1769
1770 BLOCK_INPUT;
1771
1772 {
1773#if TARGET_API_MAC_CARBON
1774 CFStringRef windowTitle =
1775 cfstring_create_with_utf8_cstring (SDATA (name));
1776
1777 SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle);
1778 CFRelease (windowTitle);
1779#else
1780 Str255 windowTitle;
1781 if (strlen (SDATA (name)) < 255)
1782 {
1783 strcpy (windowTitle, SDATA (name));
1784 c2pstr (windowTitle);
1785 SetWTitle (FRAME_MAC_WINDOW (f), windowTitle);
1786 }
1787#endif
1788 }
1789
1790 UNBLOCK_INPUT;
1791 }
1792}
1793
1837/* Change the name of frame F to NAME. If NAME is nil, set F's name to 1794/* Change the name of frame F to NAME. If NAME is nil, set F's name to
1838 w32_id_name. 1795 mac_id_name.
1839 1796
1840 If EXPLICIT is non-zero, that indicates that lisp code is setting the 1797 If EXPLICIT is non-zero, that indicates that lisp code is setting the
1841 name; if NAME is a string, set F's name to NAME and set 1798 name; if NAME is a string, set F's name to NAME and set
@@ -1865,7 +1822,7 @@ x_set_name (f, name, explicit)
1865 else if (f->explicit_name) 1822 else if (f->explicit_name)
1866 return; 1823 return;
1867 1824
1868 /* If NAME is nil, set the name to the w32_id_name. */ 1825 /* If NAME is nil, set the name to the mac_id_name. */
1869 if (NILP (name)) 1826 if (NILP (name))
1870 { 1827 {
1871 /* Check for no change needed in this very common case 1828 /* Check for no change needed in this very common case
@@ -1889,37 +1846,7 @@ x_set_name (f, name, explicit)
1889 if (! NILP (f->title)) 1846 if (! NILP (f->title))
1890 name = f->title; 1847 name = f->title;
1891 1848
1892 if (FRAME_MAC_WINDOW (f)) 1849 x_set_name_internal (f, name);
1893 {
1894 if (STRING_MULTIBYTE (name))
1895#if TARGET_API_MAC_CARBON
1896 name = ENCODE_UTF_8 (name);
1897#else
1898 name = ENCODE_SYSTEM (name);
1899#endif
1900
1901 BLOCK_INPUT;
1902
1903 {
1904#if TARGET_API_MAC_CARBON
1905 CFStringRef windowTitle =
1906 cfstring_create_with_utf8_cstring (SDATA (name));
1907
1908 SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle);
1909 CFRelease (windowTitle);
1910#else
1911 Str255 windowTitle;
1912 if (strlen (SDATA (name)) < 255)
1913 {
1914 strcpy (windowTitle, SDATA (name));
1915 c2pstr (windowTitle);
1916 SetWTitle (FRAME_MAC_WINDOW (f), windowTitle);
1917 }
1918#endif
1919 }
1920
1921 UNBLOCK_INPUT;
1922 }
1923} 1850}
1924 1851
1925/* This function should be called when the user's lisp code has 1852/* This function should be called when the user's lisp code has
@@ -1970,38 +1897,10 @@ x_set_title (f, name, old_name)
1970 1897
1971 if (NILP (name)) 1898 if (NILP (name))
1972 name = f->name; 1899 name = f->name;
1900 else
1901 CHECK_STRING (name);
1973 1902
1974 if (FRAME_MAC_WINDOW (f)) 1903 x_set_name_internal (f, name);
1975 {
1976 if (STRING_MULTIBYTE (name))
1977#if TARGET_API_MAC_CARBON
1978 name = ENCODE_UTF_8 (name);
1979#else
1980 name = ENCODE_SYSTEM (name);
1981#endif
1982
1983 BLOCK_INPUT;
1984
1985 {
1986#if TARGET_API_MAC_CARBON
1987 CFStringRef windowTitle =
1988 cfstring_create_with_utf8_cstring (SDATA (name));
1989
1990 SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle);
1991 CFRelease (windowTitle);
1992#else
1993 Str255 windowTitle;
1994 if (strlen (SDATA (name)) < 255)
1995 {
1996 strcpy (windowTitle, SDATA (name));
1997 c2pstr (windowTitle);
1998 SetWTitle (FRAME_MAC_WINDOW (f), windowTitle);
1999 }
2000#endif
2001 }
2002
2003 UNBLOCK_INPUT;
2004 }
2005} 1904}
2006 1905
2007void 1906void
@@ -2470,7 +2369,7 @@ unwind_create_frame (frame)
2470 2369
2471DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, 2370DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
2472 1, 1, 0, 2371 1, 1, 0,
2473 doc: /* Make a new window, which is called a \"frame\" in Emacs terms. 2372 doc: /* Make a new window, which is called a "frame" in Emacs terms.
2474Returns an Emacs frame object. 2373Returns an Emacs frame object.
2475ALIST is an alist of frame parameters. 2374ALIST is an alist of frame parameters.
2476If the parameters specify that the frame should not have a minibuffer, 2375If the parameters specify that the frame should not have a minibuffer,
@@ -2479,7 +2378,7 @@ then `default-minibuffer-frame' must be a frame whose minibuffer can
2479be shared by the new frame. 2378be shared by the new frame.
2480 2379
2481This function is an internal primitive--use `make-frame' instead. */) 2380This function is an internal primitive--use `make-frame' instead. */)
2482 (parms) 2381 (parms)
2483 Lisp_Object parms; 2382 Lisp_Object parms;
2484{ 2383{
2485 struct frame *f; 2384 struct frame *f;
@@ -2804,7 +2703,7 @@ x_get_focus_frame (frame)
2804 2703
2805DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, 2704DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
2806 doc: /* Internal function called by `color-defined-p', which see. */) 2705 doc: /* Internal function called by `color-defined-p', which see. */)
2807 (color, frame) 2706 (color, frame)
2808 Lisp_Object color, frame; 2707 Lisp_Object color, frame;
2809{ 2708{
2810 XColor foo; 2709 XColor foo;
@@ -2820,7 +2719,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
2820 2719
2821DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, 2720DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
2822 doc: /* Internal function called by `color-values', which see. */) 2721 doc: /* Internal function called by `color-values', which see. */)
2823 (color, frame) 2722 (color, frame)
2824 Lisp_Object color, frame; 2723 Lisp_Object color, frame;
2825{ 2724{
2826 XColor foo; 2725 XColor foo;
@@ -2843,7 +2742,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
2843 2742
2844DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, 2743DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
2845 doc: /* Internal function called by `display-color-p', which see. */) 2744 doc: /* Internal function called by `display-color-p', which see. */)
2846 (display) 2745 (display)
2847 Lisp_Object display; 2746 Lisp_Object display;
2848{ 2747{
2849 struct mac_display_info *dpyinfo = check_x_display_info (display); 2748 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2856,12 +2755,12 @@ DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
2856 2755
2857DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, 2756DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p,
2858 0, 1, 0, 2757 0, 1, 0,
2859 doc: /* Return t if the X display supports shades of gray. 2758 doc: /* Return t if DISPLAY supports shades of gray.
2860Note that color displays do support shades of gray. 2759Note that color displays do support shades of gray.
2861The optional argument DISPLAY specifies which display to ask about. 2760The optional argument DISPLAY specifies which display to ask about.
2862DISPLAY should be either a frame or a display name (a string). 2761DISPLAY should be either a frame or a display name (a string).
2863If omitted or nil, that stands for the selected frame's display. */) 2762If omitted or nil, that stands for the selected frame's display. */)
2864 (display) 2763 (display)
2865 Lisp_Object display; 2764 Lisp_Object display;
2866{ 2765{
2867 struct mac_display_info *dpyinfo = check_x_display_info (display); 2766 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2874,11 +2773,11 @@ If omitted or nil, that stands for the selected frame's display. */)
2874 2773
2875DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width, 2774DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,
2876 0, 1, 0, 2775 0, 1, 0,
2877 doc: /* Returns the width in pixels of the X display DISPLAY. 2776 doc: /* Returns the width in pixels of DISPLAY.
2878The optional argument DISPLAY specifies which display to ask about. 2777The optional argument DISPLAY specifies which display to ask about.
2879DISPLAY should be either a frame or a display name (a string). 2778DISPLAY should be either a frame or a display name (a string).
2880If omitted or nil, that stands for the selected frame's display. */) 2779If omitted or nil, that stands for the selected frame's display. */)
2881 (display) 2780 (display)
2882 Lisp_Object display; 2781 Lisp_Object display;
2883{ 2782{
2884 struct mac_display_info *dpyinfo = check_x_display_info (display); 2783 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2888,11 +2787,11 @@ If omitted or nil, that stands for the selected frame's display. */)
2888 2787
2889DEFUN ("x-display-pixel-height", Fx_display_pixel_height, 2788DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
2890 Sx_display_pixel_height, 0, 1, 0, 2789 Sx_display_pixel_height, 0, 1, 0,
2891 doc: /* Returns the height in pixels of the X display DISPLAY. 2790 doc: /* Returns the height in pixels of DISPLAY.
2892The optional argument DISPLAY specifies which display to ask about. 2791The optional argument DISPLAY specifies which display to ask about.
2893DISPLAY should be either a frame or a display name (a string). 2792DISPLAY should be either a frame or a display name (a string).
2894If omitted or nil, that stands for the selected frame's display. */) 2793If omitted or nil, that stands for the selected frame's display. */)
2895 (display) 2794 (display)
2896 Lisp_Object display; 2795 Lisp_Object display;
2897{ 2796{
2898 struct mac_display_info *dpyinfo = check_x_display_info (display); 2797 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2902,11 +2801,11 @@ If omitted or nil, that stands for the selected frame's display. */)
2902 2801
2903DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes, 2802DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
2904 0, 1, 0, 2803 0, 1, 0,
2905 doc: /* Returns the number of bitplanes of the display DISPLAY. 2804 doc: /* Returns the number of bitplanes of DISPLAY.
2906The optional argument DISPLAY specifies which display to ask about. 2805The optional argument DISPLAY specifies which display to ask about.
2907DISPLAY should be either a frame or a display name (a string). 2806DISPLAY should be either a frame or a display name (a string).
2908If omitted or nil, that stands for the selected frame's display. */) 2807If omitted or nil, that stands for the selected frame's display. */)
2909 (display) 2808 (display)
2910 Lisp_Object display; 2809 Lisp_Object display;
2911{ 2810{
2912 struct mac_display_info *dpyinfo = check_x_display_info (display); 2811 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2916,11 +2815,11 @@ If omitted or nil, that stands for the selected frame's display. */)
2916 2815
2917DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells, 2816DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells,
2918 0, 1, 0, 2817 0, 1, 0,
2919 doc: /* Returns the number of color cells of the display DISPLAY. 2818 doc: /* Returns the number of color cells of DISPLAY.
2920The optional argument DISPLAY specifies which display to ask about. 2819The optional argument DISPLAY specifies which display to ask about.
2921DISPLAY should be either a frame or a display name (a string). 2820DISPLAY should be either a frame or a display name (a string).
2922If omitted or nil, that stands for the selected frame's display. */) 2821If omitted or nil, that stands for the selected frame's display. */)
2923 (display) 2822 (display)
2924 Lisp_Object display; 2823 Lisp_Object display;
2925{ 2824{
2926 struct mac_display_info *dpyinfo = check_x_display_info (display); 2825 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2932,11 +2831,11 @@ If omitted or nil, that stands for the selected frame's display. */)
2932DEFUN ("x-server-max-request-size", Fx_server_max_request_size, 2831DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
2933 Sx_server_max_request_size, 2832 Sx_server_max_request_size,
2934 0, 1, 0, 2833 0, 1, 0,
2935 doc: /* Returns the maximum request size of the server of display DISPLAY. 2834 doc: /* Returns the maximum request size of the server of DISPLAY.
2936The optional argument DISPLAY specifies which display to ask about. 2835The optional argument DISPLAY specifies which display to ask about.
2937DISPLAY should be either a frame or a display name (a string). 2836DISPLAY should be either a frame or a display name (a string).
2938If omitted or nil, that stands for the selected frame's display. */) 2837If omitted or nil, that stands for the selected frame's display. */)
2939 (display) 2838 (display)
2940 Lisp_Object display; 2839 Lisp_Object display;
2941{ 2840{
2942 struct mac_display_info *dpyinfo = check_x_display_info (display); 2841 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2945,18 +2844,18 @@ If omitted or nil, that stands for the selected frame's display. */)
2945} 2844}
2946 2845
2947DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, 2846DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
2948 doc: /* Returns the vendor ID string of the Mac OS system (Apple). 2847 doc: /* Returns the "vendor ID" string of the Mac OS system (Apple).
2949The optional argument DISPLAY specifies which display to ask about. 2848The optional argument DISPLAY specifies which display to ask about.
2950DISPLAY should be either a frame or a display name (a string). 2849DISPLAY should be either a frame or a display name (a string).
2951If omitted or nil, that stands for the selected frame's display. */) 2850If omitted or nil, that stands for the selected frame's display. */)
2952 (display) 2851 (display)
2953 Lisp_Object display; 2852 Lisp_Object display;
2954{ 2853{
2955 return build_string ("Apple Computers"); 2854 return build_string ("Apple Computers");
2956} 2855}
2957 2856
2958DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, 2857DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
2959 doc: /* Returns the version numbers of the server of display DISPLAY. 2858 doc: /* Returns the version numbers of the Mac OS system.
2960The value is a list of three integers: the major and minor 2859The value is a list of three integers: the major and minor
2961version numbers, and the vendor-specific release 2860version numbers, and the vendor-specific release
2962number. See also the function `x-server-vendor'. 2861number. See also the function `x-server-vendor'.
@@ -2964,7 +2863,7 @@ number. See also the function `x-server-vendor'.
2964The optional argument DISPLAY specifies which display to ask about. 2863The optional argument DISPLAY specifies which display to ask about.
2965DISPLAY should be either a frame or a display name (a string). 2864DISPLAY should be either a frame or a display name (a string).
2966If omitted or nil, that stands for the selected frame's display. */) 2865If omitted or nil, that stands for the selected frame's display. */)
2967 (display) 2866 (display)
2968 Lisp_Object display; 2867 Lisp_Object display;
2969{ 2868{
2970 int mac_major_version; 2869 int mac_major_version;
@@ -2989,22 +2888,22 @@ If omitted or nil, that stands for the selected frame's display. */)
2989} 2888}
2990 2889
2991DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, 2890DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
2992 doc: /* Return the number of screens on the server of display DISPLAY. 2891 doc: /* Return the number of screens on the server of DISPLAY.
2993The optional argument DISPLAY specifies which display to ask about. 2892The optional argument DISPLAY specifies which display to ask about.
2994DISPLAY should be either a frame or a display name (a string). 2893DISPLAY should be either a frame or a display name (a string).
2995If omitted or nil, that stands for the selected frame's display. */) 2894If omitted or nil, that stands for the selected frame's display. */)
2996 (display) 2895 (display)
2997 Lisp_Object display; 2896 Lisp_Object display;
2998{ 2897{
2999 return make_number (1); 2898 return make_number (1);
3000} 2899}
3001 2900
3002DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0, 2901DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0,
3003 doc: /* Return the height in millimeters of the X display DISPLAY. 2902 doc: /* Return the height in millimeters of DISPLAY.
3004The optional argument DISPLAY specifies which display to ask about. 2903The optional argument DISPLAY specifies which display to ask about.
3005DISPLAY should be either a frame or a display name (a string). 2904DISPLAY should be either a frame or a display name (a string).
3006If omitted or nil, that stands for the selected frame's display. */) 2905If omitted or nil, that stands for the selected frame's display. */)
3007 (display) 2906 (display)
3008 Lisp_Object display; 2907 Lisp_Object display;
3009{ 2908{
3010 /* MAC_TODO: this is an approximation, and only of the main display */ 2909 /* MAC_TODO: this is an approximation, and only of the main display */
@@ -3015,11 +2914,11 @@ If omitted or nil, that stands for the selected frame's display. */)
3015} 2914}
3016 2915
3017DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, 2916DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
3018 doc: /* Return the width in millimeters of the X display DISPLAY. 2917 doc: /* Return the width in millimeters of DISPLAY.
3019The optional argument DISPLAY specifies which display to ask about. 2918The optional argument DISPLAY specifies which display to ask about.
3020DISPLAY should be either a frame or a display name (a string). 2919DISPLAY should be either a frame or a display name (a string).
3021If omitted or nil, that stands for the selected frame's display. */) 2920If omitted or nil, that stands for the selected frame's display. */)
3022 (display) 2921 (display)
3023 Lisp_Object display; 2922 Lisp_Object display;
3024{ 2923{
3025 /* MAC_TODO: this is an approximation, and only of the main display */ 2924 /* MAC_TODO: this is an approximation, and only of the main display */
@@ -3031,12 +2930,12 @@ If omitted or nil, that stands for the selected frame's display. */)
3031 2930
3032DEFUN ("x-display-backing-store", Fx_display_backing_store, 2931DEFUN ("x-display-backing-store", Fx_display_backing_store,
3033 Sx_display_backing_store, 0, 1, 0, 2932 Sx_display_backing_store, 0, 1, 0,
3034 doc: /* Returns an indication of whether display DISPLAY does backing store. 2933 doc: /* Returns an indication of whether DISPLAY does backing store.
3035The value may be `always', `when-mapped', or `not-useful'. 2934The value may be `always', `when-mapped', or `not-useful'.
3036The optional argument DISPLAY specifies which display to ask about. 2935The optional argument DISPLAY specifies which display to ask about.
3037DISPLAY should be either a frame or a display name (a string). 2936DISPLAY should be either a frame or a display name (a string).
3038If omitted or nil, that stands for the selected frame's display. */) 2937If omitted or nil, that stands for the selected frame's display. */)
3039 (display) 2938 (display)
3040 Lisp_Object display; 2939 Lisp_Object display;
3041{ 2940{
3042 return intern ("not-useful"); 2941 return intern ("not-useful");
@@ -3044,14 +2943,14 @@ If omitted or nil, that stands for the selected frame's display. */)
3044 2943
3045DEFUN ("x-display-visual-class", Fx_display_visual_class, 2944DEFUN ("x-display-visual-class", Fx_display_visual_class,
3046 Sx_display_visual_class, 0, 1, 0, 2945 Sx_display_visual_class, 0, 1, 0,
3047 doc: /* Returns the visual class of the display DISPLAY. 2946 doc: /* Returns the visual class of DISPLAY.
3048The value is one of the symbols `static-gray', `gray-scale', 2947The value is one of the symbols `static-gray', `gray-scale',
3049`static-color', `pseudo-color', `true-color', or `direct-color'. 2948`static-color', `pseudo-color', `true-color', or `direct-color'.
3050 2949
3051The optional argument DISPLAY specifies which display to ask about. 2950The optional argument DISPLAY specifies which display to ask about.
3052DISPLAY should be either a frame or a display name (a string). 2951DISPLAY should be either a frame or a display name (a string).
3053If omitted or nil, that stands for the selected frame's display. */) 2952If omitted or nil, that stands for the selected frame's display. */)
3054 (display) 2953 (display)
3055 Lisp_Object display; 2954 Lisp_Object display;
3056{ 2955{
3057 struct mac_display_info *dpyinfo = check_x_display_info (display); 2956 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -3075,11 +2974,11 @@ If omitted or nil, that stands for the selected frame's display. */)
3075 2974
3076DEFUN ("x-display-save-under", Fx_display_save_under, 2975DEFUN ("x-display-save-under", Fx_display_save_under,
3077 Sx_display_save_under, 0, 1, 0, 2976 Sx_display_save_under, 0, 1, 0,
3078 doc: /* Returns t if the display DISPLAY supports the save-under feature. 2977 doc: /* Returns t if DISPLAY supports the save-under feature.
3079The optional argument DISPLAY specifies which display to ask about. 2978The optional argument DISPLAY specifies which display to ask about.
3080DISPLAY should be either a frame or a display name (a string). 2979DISPLAY should be either a frame or a display name (a string).
3081If omitted or nil, that stands for the selected frame's display. */) 2980If omitted or nil, that stands for the selected frame's display. */)
3082 (display) 2981 (display)
3083 Lisp_Object display; 2982 Lisp_Object display;
3084{ 2983{
3085 return Qnil; 2984 return Qnil;
@@ -3169,7 +3068,7 @@ DISPLAY is the name of the display to connect to.
3169Optional second arg XRM-STRING is a string of resources in xrdb format. 3068Optional second arg XRM-STRING is a string of resources in xrdb format.
3170If the optional third arg MUST-SUCCEED is non-nil, 3069If the optional third arg MUST-SUCCEED is non-nil,
3171terminate Emacs if we can't open the connection. */) 3070terminate Emacs if we can't open the connection. */)
3172 (display, xrm_string, must_succeed) 3071 (display, xrm_string, must_succeed)
3173 Lisp_Object display, xrm_string, must_succeed; 3072 Lisp_Object display, xrm_string, must_succeed;
3174{ 3073{
3175 unsigned char *xrm_option; 3074 unsigned char *xrm_option;
@@ -3214,8 +3113,8 @@ DEFUN ("x-close-connection", Fx_close_connection,
3214 doc: /* Close the connection to DISPLAY's server. 3113 doc: /* Close the connection to DISPLAY's server.
3215For DISPLAY, specify either a frame or a display name (a string). 3114For DISPLAY, specify either a frame or a display name (a string).
3216If DISPLAY is nil, that stands for the selected frame's display. */) 3115If DISPLAY is nil, that stands for the selected frame's display. */)
3217 (display) 3116 (display)
3218 Lisp_Object display; 3117 Lisp_Object display;
3219{ 3118{
3220 struct mac_display_info *dpyinfo = check_x_display_info (display); 3119 struct mac_display_info *dpyinfo = check_x_display_info (display);
3221 int i; 3120 int i;
@@ -3241,7 +3140,7 @@ If DISPLAY is nil, that stands for the selected frame's display. */)
3241 3140
3242DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, 3141DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
3243 doc: /* Return the list of display names that Emacs has connections to. */) 3142 doc: /* Return the list of display names that Emacs has connections to. */)
3244 () 3143 ()
3245{ 3144{
3246 Lisp_Object tail, result; 3145 Lisp_Object tail, result;
3247 3146
@@ -3253,13 +3152,8 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
3253} 3152}
3254 3153
3255DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0, 3154DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0,
3256 doc: /* If ON is non-nil, report errors as soon as the erring request is made. 3155 doc: /* This is a noop on Mac OS systems. */)
3257If ON is nil, allow buffering of requests. 3156 (on, display)
3258This is a noop on Mac OS systems.
3259The optional second argument DISPLAY specifies which display to act on.
3260DISPLAY should be either a frame or a display name (a string).
3261If DISPLAY is omitted or nil, that stands for the selected frame's display. */)
3262 (on, display)
3263 Lisp_Object display, on; 3157 Lisp_Object display, on;
3264{ 3158{
3265 return Qnil; 3159 return Qnil;
@@ -3318,7 +3212,7 @@ DEFUN ("x-delete-window-property", Fx_delete_window_property,
3318 Sx_delete_window_property, 1, 2, 0, 3212 Sx_delete_window_property, 1, 2, 0,
3319 doc: /* Remove window property PROP from X window of FRAME. 3213 doc: /* Remove window property PROP from X window of FRAME.
3320FRAME nil or omitted means use the selected frame. Value is PROP. */) 3214FRAME nil or omitted means use the selected frame. Value is PROP. */)
3321 (prop, frame) 3215 (prop, frame)
3322 Lisp_Object prop, frame; 3216 Lisp_Object prop, frame;
3323{ 3217{
3324#if 0 /* MAC_TODO : port window properties to Mac */ 3218#if 0 /* MAC_TODO : port window properties to Mac */
@@ -3346,7 +3240,7 @@ DEFUN ("x-window-property", Fx_window_property, Sx_window_property,
3346If FRAME is nil or omitted, use the selected frame. Value is nil 3240If FRAME is nil or omitted, use the selected frame. Value is nil
3347if FRAME hasn't a property with name PROP or if PROP has no string 3241if FRAME hasn't a property with name PROP or if PROP has no string
3348value. */) 3242value. */)
3349 (prop, frame) 3243 (prop, frame)
3350 Lisp_Object prop, frame; 3244 Lisp_Object prop, frame;
3351{ 3245{
3352#if 0 /* MAC_TODO : port window properties to Mac */ 3246#if 0 /* MAC_TODO : port window properties to Mac */
@@ -3948,7 +3842,7 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
3948 3842
3949DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, 3843DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
3950 doc: /* Show STRING in a "tooltip" window on frame FRAME. 3844 doc: /* Show STRING in a "tooltip" window on frame FRAME.
3951A tooltip window is a small X window displaying a string. 3845A tooltip window is a small window displaying a string.
3952 3846
3953FRAME nil or omitted means use the selected frame. 3847FRAME nil or omitted means use the selected frame.
3954 3848
@@ -3958,7 +3852,7 @@ change the tooltip's appearance.
3958Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil 3852Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil
3959means use the default timeout of 5 seconds. 3853means use the default timeout of 5 seconds.
3960 3854
3961If the list of frame parameters PARAMS contains a `left' parameters, 3855If the list of frame parameters PARMS contains a `left' parameter,
3962the tooltip is displayed at that x-position. Otherwise it is 3856the tooltip is displayed at that x-position. Otherwise it is
3963displayed at the mouse position, with offset DX added (default is 5 if 3857displayed at the mouse position, with offset DX added (default is 5 if
3964DX isn't specified). Likewise for the y-position; if a `top' frame 3858DX isn't specified). Likewise for the y-position; if a `top' frame
@@ -4216,7 +4110,7 @@ Use a file selection dialog.
4216Select DEFAULT-FILENAME in the dialog's file selection box, if 4110Select DEFAULT-FILENAME in the dialog's file selection box, if
4217specified. Ensure that file exists if MUSTMATCH is non-nil. 4111specified. Ensure that file exists if MUSTMATCH is non-nil.
4218If ONLY-DIR-P is non-nil, the user can only select directories. */) 4112If ONLY-DIR-P is non-nil, the user can only select directories. */)
4219 (prompt, dir, default_filename, mustmatch, only_dir_p) 4113 (prompt, dir, default_filename, mustmatch, only_dir_p)
4220 Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p; 4114 Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
4221{ 4115{
4222 struct frame *f = SELECTED_FRAME (); 4116 struct frame *f = SELECTED_FRAME ();
diff --git a/src/macmenu.c b/src/macmenu.c
index ab266f6f0b5..c7ee0dfaf21 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -611,37 +611,48 @@ cleanup_popup_menu (arg)
611 611
612DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, 612DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0,
613 doc: /* Pop up a deck-of-cards menu and return user's selection. 613 doc: /* Pop up a deck-of-cards menu and return user's selection.
614POSITION is a position specification. This is either a mouse button 614POSITION is a position specification. This is either a mouse button event
615event or a list ((XOFFSET YOFFSET) WINDOW) where XOFFSET and YOFFSET 615or a list ((XOFFSET YOFFSET) WINDOW)
616are positions in pixels from the top left corner of WINDOW's frame 616where XOFFSET and YOFFSET are positions in pixels from the top left
617\(WINDOW may be a frame object instead of a window). This controls the 617corner of WINDOW. (WINDOW may be a window or a frame object.)
618position of the center of the first line in the first pane of the 618This controls the position of the top left of the menu as a whole.
619menu, not the top left of the menu as a whole. If POSITION is t, it 619If POSITION is t, it means to use the current mouse position.
620means to use the current mouse position.
621 620
622MENU is a specifier for a menu. For the simplest case, MENU is a keymap. 621MENU is a specifier for a menu. For the simplest case, MENU is a keymap.
623The menu items come from key bindings that have a menu string as well as 622The menu items come from key bindings that have a menu string as well as
624a definition; actually, the \"definition\" in such a key binding looks like 623a definition; actually, the "definition" in such a key binding looks like
625\(STRING . REAL-DEFINITION). To give the menu a title, put a string into 624\(STRING . REAL-DEFINITION). To give the menu a title, put a string into
626the keymap as a top-level element. 625the keymap as a top-level element.
627 626
628If REAL-DEFINITION is nil, that puts a nonselectable string in the menu. 627If REAL-DEFINITION is nil, that puts a nonselectable string in the menu.
629Otherwise, REAL-DEFINITION should be a valid key binding definition. 628Otherwise, REAL-DEFINITION should be a valid key binding definition.
630 629
631You can also use a list of keymaps as MENU. Then each keymap makes a 630You can also use a list of keymaps as MENU.
632separate pane. When MENU is a keymap or a list of keymaps, the return 631 Then each keymap makes a separate pane.
633value is a list of events.
634 632
635Alternatively, you can specify a menu of multiple panes with a list of 633When MENU is a keymap or a list of keymaps, the return value is the
636the form (TITLE PANE1 PANE2...), where each pane is a list of 634list of events corresponding to the user's choice. Note that
637form (TITLE ITEM1 ITEM2...). 635`x-popup-menu' does not actually execute the command bound to that
638Each ITEM is normally a cons cell (STRING . VALUE); but a string can 636sequence of events.
639appear as an item--that makes a nonselectable line in the menu. 637
638Alternatively, you can specify a menu of multiple panes
639 with a list of the form (TITLE PANE1 PANE2...),
640where each pane is a list of form (TITLE ITEM1 ITEM2...).
641Each ITEM is normally a cons cell (STRING . VALUE);
642but a string can appear as an item--that makes a nonselectable line
643in the menu.
640With this form of menu, the return value is VALUE from the chosen item. 644With this form of menu, the return value is VALUE from the chosen item.
641 645
642If POSITION is nil, don't display the menu at all, just precalculate the 646If POSITION is nil, don't display the menu at all, just precalculate the
643cached information about equivalent key sequences. */) 647cached information about equivalent key sequences.
644 (position, menu) 648
649If the user gets rid of the menu without making a valid choice, for
650instance by clicking the mouse away from a valid choice or by typing
651keyboard input, then this normally results in a quit and
652`x-popup-menu' does not return. But if POSITION is a mouse button
653event (indicating that the user invoked the menu with the mouse) then
654no quit occurs and `x-popup-menu' returns nil. */)
655 (position, menu)
645 Lisp_Object position, menu; 656 Lisp_Object position, menu;
646{ 657{
647 Lisp_Object keymap, tem; 658 Lisp_Object keymap, tem;
@@ -840,7 +851,7 @@ If POSITION is t, it means to use the frame the mouse is on.
840The dialog box appears in the middle of the specified frame. 851The dialog box appears in the middle of the specified frame.
841 852
842CONTENTS specifies the alternatives to display in the dialog box. 853CONTENTS specifies the alternatives to display in the dialog box.
843It is a list of the form (TITLE ITEM1 ITEM2...). 854It is a list of the form (DIALOG ITEM1 ITEM2...).
844Each ITEM is a cons cell (STRING . VALUE). 855Each ITEM is a cons cell (STRING . VALUE).
845The return value is VALUE from the chosen item. 856The return value is VALUE from the chosen item.
846 857
@@ -850,8 +861,12 @@ on the left of the dialog box and all following items on the right.
850\(By default, approximately half appear on each side.) 861\(By default, approximately half appear on each side.)
851 862
852If HEADER is non-nil, the frame title for the box is "Information", 863If HEADER is non-nil, the frame title for the box is "Information",
853otherwise it is "Question". */) 864otherwise it is "Question".
854 (position, contents, header) 865
866If the user gets rid of the dialog box without making a valid choice,
867for instance using the window manager, then this produces a quit and
868`x-popup-dialog' does not return. */)
869 (position, contents, header)
855 Lisp_Object position, contents, header; 870 Lisp_Object position, contents, header;
856{ 871{
857 FRAME_PTR f = NULL; 872 FRAME_PTR f = NULL;
diff --git a/src/macselect.c b/src/macselect.c
index 94fe591a206..63221ba3a90 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -712,7 +712,7 @@ anything that the functions on `selection-converter-alist' know about. */)
712{ 712{
713 check_mac (); 713 check_mac ();
714 CHECK_SYMBOL (selection_name); 714 CHECK_SYMBOL (selection_name);
715 if (NILP (selection_value)) error ("selection-value may not be nil"); 715 if (NILP (selection_value)) error ("SELECTION-VALUE may not be nil");
716 x_own_selection (selection_name, selection_value); 716 x_own_selection (selection_name, selection_value);
717 return selection_value; 717 return selection_value;
718} 718}
@@ -724,11 +724,11 @@ anything that the functions on `selection-converter-alist' know about. */)
724 724
725DEFUN ("x-get-selection-internal", Fx_get_selection_internal, 725DEFUN ("x-get-selection-internal", Fx_get_selection_internal,
726 Sx_get_selection_internal, 2, 3, 0, 726 Sx_get_selection_internal, 2, 3, 0,
727 doc: /* Return text selected from some Mac window. 727 doc: /* Return text selected from some Mac application.
728SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. 728SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
729TYPE is the type of data desired, typically `STRING'. 729TYPE is the type of data desired, typically `STRING'.
730TIME_STAMP is ignored on Mac. */) 730TIME_STAMP is ignored on Mac. */)
731 (selection_symbol, target_type, time_stamp) 731 (selection_symbol, target_type, time_stamp)
732 Lisp_Object selection_symbol, target_type, time_stamp; 732 Lisp_Object selection_symbol, target_type, time_stamp;
733{ 733{
734 Lisp_Object val = Qnil; 734 Lisp_Object val = Qnil;
@@ -821,7 +821,7 @@ Disowning it means there is no such selection. */)
821 821
822DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p, 822DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p,
823 0, 1, 0, 823 0, 1, 0,
824 doc: /* Whether the current Emacs process owns the given Selection. 824 doc: /* Whether the current Emacs process owns the given SELECTION.
825The arg should be the name of the selection in question, typically one of 825The arg should be the name of the selection in question, typically one of
826the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. 826the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
827For convenience, the symbol nil is the same as `PRIMARY', 827For convenience, the symbol nil is the same as `PRIMARY',
@@ -866,7 +866,7 @@ and t is the same as `SECONDARY'. */)
866 866
867DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p, 867DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
868 0, 1, 0, 868 0, 1, 0,
869 doc: /* Whether there is an owner for the given Selection. 869 doc: /* Whether there is an owner for the given SELECTION.
870The arg should be the name of the selection in question, typically one of 870The arg should be the name of the selection in question, typically one of
871the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. 871the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
872For convenience, the symbol nil is the same as `PRIMARY', 872For convenience, the symbol nil is the same as `PRIMARY',
@@ -1077,7 +1077,7 @@ a desired type to which the selection should be converted;
1077and the local selection value (whatever was given to `x-own-selection'). 1077and the local selection value (whatever was given to `x-own-selection').
1078 1078
1079The function should return the value to send to the Scrap Manager 1079The function should return the value to send to the Scrap Manager
1080\(a string). A return value of nil 1080\(must be a string). A return value of nil
1081means that the conversion could not be done. 1081means that the conversion could not be done.
1082A return value which is the symbol `NULL' 1082A return value which is the symbol `NULL'
1083means that a side-effect was executed, 1083means that a side-effect was executed,
diff --git a/src/s/cygwin.h b/src/s/cygwin.h
index 0094ef793dc..ac977b8cb52 100644
--- a/src/s/cygwin.h
+++ b/src/s/cygwin.h
@@ -1,7 +1,7 @@
1/* Template for system description header files. 1/* Template for system description header files.
2 This file describes the parameters that system description files 2 This file describes the parameters that system description files
3 should define or not. 3 should define or not.
4 Copyright (C) 1985, 1986, 1992, 1999 Free Software Foundation, Inc. 4 Copyright (C) 1985, 1986, 1992, 1999, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
@@ -123,8 +123,6 @@ Boston, MA 02110-1301, USA. */
123 emacs lisp pointers */ 123 emacs lisp pointers */
124#define DATA_SEG_BITS 0x20000000 124#define DATA_SEG_BITS 0x20000000
125#define LINKER $(CC) -Wl,--image-base,DATA_SEG_BITS 125#define LINKER $(CC) -Wl,--image-base,DATA_SEG_BITS
126/* gettext.h is in a strange place */
127#define C_SWITCH_SYSTEM -I/usr/share/gettext
128 126
129/* Use terminfo instead of termcap. Fewer environment variables to 127/* Use terminfo instead of termcap. Fewer environment variables to
130 go wrong, more terminal types. */ 128 go wrong, more terminal types. */
diff --git a/src/w32fns.c b/src/w32fns.c
index 6bcb668aa8b..063b71cf293 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -396,10 +396,10 @@ x_window_to_frame (dpyinfo, wdesc)
396} 396}
397 397
398 398
399BOOL my_show_window P_ ((struct frame *, HWND, int));
400void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT));
401static Lisp_Object unwind_create_frame P_ ((Lisp_Object)); 399static Lisp_Object unwind_create_frame P_ ((Lisp_Object));
402static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object)); 400static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object));
401static void my_create_window P_ ((struct frame *));
402static void my_create_tip_window P_ ((struct frame *));
403 403
404/* TODO: Native Input Method support; see x_create_im. */ 404/* TODO: Native Input Method support; see x_create_im. */
405void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 405void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
@@ -3848,7 +3848,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
3848 return 0; 3848 return 0;
3849} 3849}
3850 3850
3851void 3851static void
3852my_create_window (f) 3852my_create_window (f)
3853 struct frame * f; 3853 struct frame * f;
3854{ 3854{
@@ -3864,7 +3864,7 @@ my_create_window (f)
3864 indirectly via the Window thread, as we do not need to process Window 3864 indirectly via the Window thread, as we do not need to process Window
3865 messages for the tooltip. Creating tooltips indirectly also creates 3865 messages for the tooltip. Creating tooltips indirectly also creates
3866 deadlocks when tooltips are created for menu items. */ 3866 deadlocks when tooltips are created for menu items. */
3867void 3867static void
3868my_create_tip_window (f) 3868my_create_tip_window (f)
3869 struct frame *f; 3869 struct frame *f;
3870{ 3870{
diff --git a/src/w32menu.c b/src/w32menu.c
index 065355f8755..0e4902b6ce4 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -2418,8 +2418,11 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags)
2418 struct frame *f = x_window_to_frame (&one_w32_display_info, owner); 2418 struct frame *f = x_window_to_frame (&one_w32_display_info, owner);
2419 Lisp_Object frame, help; 2419 Lisp_Object frame, help;
2420 2420
2421 /* No help echo on owner-draw menu items. */ 2421 /* No help echo on owner-draw menu items, or when the keyboard is used
2422 if (flags & MF_OWNERDRAW || flags & MF_POPUP) 2422 to navigate the menus, since tooltips are distracting if they pop
2423 up elsewhere. */
2424 if (flags & MF_OWNERDRAW || flags & MF_POPUP
2425 || !(flags & MF_MOUSESELECT))
2423 help = Qnil; 2426 help = Qnil;
2424 else 2427 else
2425 { 2428 {
diff --git a/src/w32term.c b/src/w32term.c
index 543b5883bc2..fa9f05ef57c 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -299,6 +299,11 @@ static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
299static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, 299static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,
300 enum text_cursor_kinds)); 300 enum text_cursor_kinds));
301static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, int, HDC)); 301static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, int, HDC));
302static BOOL my_show_window P_ ((struct frame *, HWND, int));
303static void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT));
304static void my_set_focus P_ ((struct frame *, HWND));
305static void my_set_foreground_window P_ ((HWND));
306static void my_destroy_window P_ ((struct frame *, HWND));
302 307
303static Lisp_Object Qvendor_specific_keysyms; 308static Lisp_Object Qvendor_specific_keysyms;
304 309
@@ -3783,7 +3788,7 @@ my_create_scrollbar (f, bar)
3783 3788
3784/*#define ATTACH_THREADS*/ 3789/*#define ATTACH_THREADS*/
3785 3790
3786BOOL 3791static BOOL
3787my_show_window (FRAME_PTR f, HWND hwnd, int how) 3792my_show_window (FRAME_PTR f, HWND hwnd, int how)
3788{ 3793{
3789#ifndef ATTACH_THREADS 3794#ifndef ATTACH_THREADS
@@ -3794,7 +3799,7 @@ my_show_window (FRAME_PTR f, HWND hwnd, int how)
3794#endif 3799#endif
3795} 3800}
3796 3801
3797void 3802static void
3798my_set_window_pos (HWND hwnd, HWND hwndAfter, 3803my_set_window_pos (HWND hwnd, HWND hwndAfter,
3799 int x, int y, int cx, int cy, UINT flags) 3804 int x, int y, int cx, int cy, UINT flags)
3800{ 3805{
@@ -3812,7 +3817,7 @@ my_set_window_pos (HWND hwnd, HWND hwndAfter,
3812#endif 3817#endif
3813} 3818}
3814 3819
3815void 3820static void
3816my_set_focus (f, hwnd) 3821my_set_focus (f, hwnd)
3817 struct frame * f; 3822 struct frame * f;
3818 HWND hwnd; 3823 HWND hwnd;
@@ -3821,14 +3826,15 @@ my_set_focus (f, hwnd)
3821 (WPARAM) hwnd, 0); 3826 (WPARAM) hwnd, 0);
3822} 3827}
3823 3828
3824void 3829static void
3825my_set_foreground_window (hwnd) 3830my_set_foreground_window (hwnd)
3826 HWND hwnd; 3831 HWND hwnd;
3827{ 3832{
3828 SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0); 3833 SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0);
3829} 3834}
3830 3835
3831void 3836
3837static void
3832my_destroy_window (f, hwnd) 3838my_destroy_window (f, hwnd)
3833 struct frame * f; 3839 struct frame * f;
3834 HWND hwnd; 3840 HWND hwnd;