diff options
| author | Miles Bader | 2005-05-26 05:42:19 +0000 |
|---|---|---|
| committer | Miles Bader | 2005-05-26 05:42:19 +0000 |
| commit | d2eeec7fb90dc54c4b08e85f452a23317c0ee65d (patch) | |
| tree | cd13677b902ee91ff96c5f43ca30ae2aba828312 /src | |
| parent | 5611ba87dd81c98d2cc00a4d01e19db3d26cf9d5 (diff) | |
| parent | c0e9b2d0ec9cb343733243371efecf77722b067f (diff) | |
| download | emacs-d2eeec7fb90dc54c4b08e85f452a23317c0ee65d.tar.gz emacs-d2eeec7fb90dc54c4b08e85f452a23317c0ee65d.zip | |
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-55
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 320-323)
- Update from CVS
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 66 | ||||
| -rw-r--r-- | src/alloc.c | 2 | ||||
| -rw-r--r-- | src/editfns.c | 2 | ||||
| -rw-r--r-- | src/fileio.c | 10 | ||||
| -rw-r--r-- | src/fns.c | 4 | ||||
| -rw-r--r-- | src/image.c | 17 | ||||
| -rw-r--r-- | src/lisp.h | 2 | ||||
| -rw-r--r-- | src/macmenu.c | 29 | ||||
| -rw-r--r-- | src/process.c | 3 | ||||
| -rw-r--r-- | src/termcap.c | 1 | ||||
| -rw-r--r-- | src/w32menu.c | 29 | ||||
| -rw-r--r-- | src/window.c | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 133 | ||||
| -rw-r--r-- | src/xmenu.c | 46 |
14 files changed, 279 insertions, 69 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 10d3bd31bda..c2cd2dde5f7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,6 +1,70 @@ | |||
| 1 | 2005-05-24 Masatake YAMATO <jet@gyve.org> | ||
| 2 | |||
| 3 | * xdisp.c (note_mode_line_or_margin_highlight): Use b and e | ||
| 4 | as loop sentinels. | ||
| 5 | |||
| 6 | 2005-05-24 Nick Roberts <nickrob@snap.net.nz> | ||
| 7 | |||
| 8 | * xmenu.c (Fx_popup_dialog): Add a third boolean argument to | ||
| 9 | select frame title ("Question"/"Information"). | ||
| 10 | (xdialog_show): Use it. | ||
| 11 | |||
| 12 | * macmenu.c (Fx_popup_dialog, mac_dialog_show): As for xmenu.c. | ||
| 13 | |||
| 14 | * w32menu.c (Fx_popup_dialog, w32_dialog_show): As for xmenu.c. | ||
| 15 | |||
| 16 | * fns.c (Fyes_or_no_p, Fy_or_n_p): Call Fx_popup_dialog with | ||
| 17 | a third argument (Qnil). | ||
| 18 | |||
| 19 | * lisp.h: x-popup-dialog can have three arguments. | ||
| 20 | |||
| 21 | * editfns.c (Fmessage_box): Use "Information" for frame title. | ||
| 22 | |||
| 23 | 2005-05-23 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 24 | |||
| 25 | * termcap.c [VMS]: Include <starlet.h>. | ||
| 26 | |||
| 27 | 2005-05-23 Masatake YAMATO <jet@gyve.org> | ||
| 28 | |||
| 29 | * xdisp.c (note_mode_line_or_margin_highlight): Added code | ||
| 30 | for mouse-face. Change the type of the first argument from `window' | ||
| 31 | to `List_Object'. | ||
| 32 | (note_mouse_highlight): Call note_mode_line_or_margin_highlight with | ||
| 33 | window instead of w. | ||
| 34 | |||
| 35 | 2005-05-22 Andreas Schwab <schwab@suse.de> | ||
| 36 | |||
| 37 | * process.c (send_process): Move misplaced volatile. | ||
| 38 | |||
| 39 | 2005-05-21 Richard M. Stallman <rms@gnu.org> | ||
| 40 | |||
| 41 | * xdisp.c (display_mode_element): If we're processing a list and | ||
| 42 | padding is specified, put it after the last element. | ||
| 43 | |||
| 44 | 2005-05-21 Eli Zaretskii <eliz@gnu.org> | ||
| 45 | |||
| 46 | * fileio.c (Fexpand_file_name) [DOS_NT]: Don't try to support | ||
| 47 | "superroot" on DOS_NT systems. | ||
| 48 | |||
| 49 | 2005-05-21 David Hunter <hunterd42@comcast.net> (tiny change) | ||
| 50 | |||
| 51 | * process.c (send_process): Restore the SIGPIPE handler if we | ||
| 52 | catch a SIGPIPE. | ||
| 53 | |||
| 54 | 2005-05-20 Juanma Barranquero <lekktu@gmail.com> | ||
| 55 | |||
| 56 | * image.c (lookup_image, png_read_from_memory): Remove hacks (and | ||
| 57 | misleading comments). | ||
| 58 | (DEF_IMGLIB_FN): Use C calling convention for image libraries. | ||
| 59 | |||
| 60 | 2005-05-20 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> | ||
| 61 | |||
| 62 | * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges): | ||
| 63 | Correct the right value. | ||
| 64 | |||
| 1 | 2005-05-19 Nick Roberts <nickrob@snap.net.nz> | 65 | 2005-05-19 Nick Roberts <nickrob@snap.net.nz> |
| 2 | 66 | ||
| 3 | * keyboard.c (syms_of_keyboard): Remove lisp variables | 67 | * keyboard.c (syms_of_keyboard): Remove Lisp variables |
| 4 | post-command-idle-hook and post-command-idle-delay. | 68 | post-command-idle-hook and post-command-idle-delay. |
| 5 | (command_loop_1): Don't try to execute post-command-idle-hook. | 69 | (command_loop_1): Don't try to execute post-command-idle-hook. |
| 6 | 70 | ||
diff --git a/src/alloc.c b/src/alloc.c index 1eeea72ea7e..a491185a4ed 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1684,7 +1684,7 @@ static int total_string_size; | |||
| 1684 | 1684 | ||
| 1685 | /* We check for overrun in string data blocks by appending a small | 1685 | /* We check for overrun in string data blocks by appending a small |
| 1686 | "cookie" after each allocated string data block, and check for the | 1686 | "cookie" after each allocated string data block, and check for the |
| 1687 | presense of this cookie during GC. */ | 1687 | presence of this cookie during GC. */ |
| 1688 | 1688 | ||
| 1689 | #define GC_STRING_OVERRUN_COOKIE_SIZE 4 | 1689 | #define GC_STRING_OVERRUN_COOKIE_SIZE 4 |
| 1690 | static char string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] = | 1690 | static char string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] = |
diff --git a/src/editfns.c b/src/editfns.c index df43937d13a..5c6c459bf9d 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3307,7 +3307,7 @@ usage: (message-box STRING &rest ARGS) */) | |||
| 3307 | pane = Fcons (Fcons (build_string ("OK"), Qt), Qnil); | 3307 | pane = Fcons (Fcons (build_string ("OK"), Qt), Qnil); |
| 3308 | GCPRO1 (pane); | 3308 | GCPRO1 (pane); |
| 3309 | menu = Fcons (val, pane); | 3309 | menu = Fcons (val, pane); |
| 3310 | obj = Fx_popup_dialog (Qt, menu); | 3310 | obj = Fx_popup_dialog (Qt, menu, Qt); |
| 3311 | UNGCPRO; | 3311 | UNGCPRO; |
| 3312 | return val; | 3312 | return val; |
| 3313 | } | 3313 | } |
diff --git a/src/fileio.c b/src/fileio.c index 58912a7cb8c..4a22cc0a59e 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1655,8 +1655,16 @@ See also the function `substitute-in-file-name'. */) | |||
| 1655 | p += 2; | 1655 | p += 2; |
| 1656 | } | 1656 | } |
| 1657 | else if (IS_DIRECTORY_SEP (p[0]) && p[1] == '.' && p[2] == '.' | 1657 | else if (IS_DIRECTORY_SEP (p[0]) && p[1] == '.' && p[2] == '.' |
| 1658 | /* `/../' is the "superroot" on certain file systems. */ | 1658 | /* `/../' is the "superroot" on certain file systems. |
| 1659 | Turned off on DOS_NT systems because they have no | ||
| 1660 | "superroot" and because this causes us to produce | ||
| 1661 | file names like "d:/../foo" which fail file-related | ||
| 1662 | functions of the underlying OS. (To reproduce, try a | ||
| 1663 | long series of "../../" in default_directory, longer | ||
| 1664 | than the number of levels from the root.) */ | ||
| 1665 | #ifndef DOS_NT | ||
| 1659 | && o != target | 1666 | && o != target |
| 1667 | #endif | ||
| 1660 | && (IS_DIRECTORY_SEP (p[3]) || p[3] == 0)) | 1668 | && (IS_DIRECTORY_SEP (p[3]) || p[3] == 0)) |
| 1661 | { | 1669 | { |
| 1662 | while (o != target && (--o) && !IS_DIRECTORY_SEP (*o)) | 1670 | while (o != target && (--o) && !IS_DIRECTORY_SEP (*o)) |
| @@ -2629,7 +2629,7 @@ is nil and `use-dialog-box' is non-nil. */) | |||
| 2629 | Fcons (Fcons (build_string ("No"), Qnil), | 2629 | Fcons (Fcons (build_string ("No"), Qnil), |
| 2630 | Qnil)); | 2630 | Qnil)); |
| 2631 | menu = Fcons (prompt, pane); | 2631 | menu = Fcons (prompt, pane); |
| 2632 | obj = Fx_popup_dialog (Qt, menu); | 2632 | obj = Fx_popup_dialog (Qt, menu, Qnil); |
| 2633 | answer = !NILP (obj); | 2633 | answer = !NILP (obj); |
| 2634 | break; | 2634 | break; |
| 2635 | } | 2635 | } |
| @@ -2761,7 +2761,7 @@ is nil, and `use-dialog-box' is non-nil. */) | |||
| 2761 | Qnil)); | 2761 | Qnil)); |
| 2762 | GCPRO1 (pane); | 2762 | GCPRO1 (pane); |
| 2763 | menu = Fcons (prompt, pane); | 2763 | menu = Fcons (prompt, pane); |
| 2764 | obj = Fx_popup_dialog (Qt, menu); | 2764 | obj = Fx_popup_dialog (Qt, menu, Qnil); |
| 2765 | UNGCPRO; | 2765 | UNGCPRO; |
| 2766 | return obj; | 2766 | return obj; |
| 2767 | } | 2767 | } |
diff --git a/src/image.c b/src/image.c index f03adfdc48f..b61b07876d3 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -1631,11 +1631,6 @@ lookup_image (f, spec) | |||
| 1631 | Lisp_Object spec; | 1631 | Lisp_Object spec; |
| 1632 | { | 1632 | { |
| 1633 | struct image_cache *c = FRAME_X_IMAGE_CACHE (f); | 1633 | struct image_cache *c = FRAME_X_IMAGE_CACHE (f); |
| 1634 | #ifdef _MSC_VER | ||
| 1635 | /* Work around a problem with MinGW builds of graphics libraries | ||
| 1636 | not honoring calling conventions. */ | ||
| 1637 | static | ||
| 1638 | #endif | ||
| 1639 | struct image *img; | 1634 | struct image *img; |
| 1640 | int i; | 1635 | int i; |
| 1641 | unsigned hash; | 1636 | unsigned hash; |
| @@ -1815,7 +1810,7 @@ forall_images_in_image_cache (f, fn) | |||
| 1815 | #ifdef HAVE_NTGUI | 1810 | #ifdef HAVE_NTGUI |
| 1816 | 1811 | ||
| 1817 | /* Macro for defining functions that will be loaded from image DLLs. */ | 1812 | /* Macro for defining functions that will be loaded from image DLLs. */ |
| 1818 | #define DEF_IMGLIB_FN(func) FARPROC fn_##func | 1813 | #define DEF_IMGLIB_FN(func) int (FAR CDECL *fn_##func)() |
| 1819 | 1814 | ||
| 1820 | /* Macro for loading those image functions from the library. */ | 1815 | /* Macro for loading those image functions from the library. */ |
| 1821 | #define LOAD_IMGLIB_FN(lib,func) { \ | 1816 | #define LOAD_IMGLIB_FN(lib,func) { \ |
| @@ -5744,12 +5739,6 @@ struct png_memory_storage | |||
| 5744 | PNG_PTR is a pointer to the PNG control structure. Copy LENGTH | 5739 | PNG_PTR is a pointer to the PNG control structure. Copy LENGTH |
| 5745 | bytes from the input to DATA. */ | 5740 | bytes from the input to DATA. */ |
| 5746 | 5741 | ||
| 5747 | #ifdef _MSC_VER | ||
| 5748 | /* Work around a problem with MinGW builds of graphics libraries | ||
| 5749 | not honoring calling conventions. */ | ||
| 5750 | #pragma optimize("g", off) | ||
| 5751 | #endif | ||
| 5752 | |||
| 5753 | static void | 5742 | static void |
| 5754 | png_read_from_memory (png_ptr, data, length) | 5743 | png_read_from_memory (png_ptr, data, length) |
| 5755 | png_structp png_ptr; | 5744 | png_structp png_ptr; |
| @@ -5766,10 +5755,6 @@ png_read_from_memory (png_ptr, data, length) | |||
| 5766 | tbr->index = tbr->index + length; | 5755 | tbr->index = tbr->index + length; |
| 5767 | } | 5756 | } |
| 5768 | 5757 | ||
| 5769 | #ifdef _MSC_VER | ||
| 5770 | /* Restore normal optimization, as specified on the command line. */ | ||
| 5771 | #pragma optimize("", on) | ||
| 5772 | #endif | ||
| 5773 | 5758 | ||
| 5774 | /* Load PNG image IMG for use on frame F. Value is non-zero if | 5759 | /* Load PNG image IMG for use on frame F. Value is non-zero if |
| 5775 | successful. */ | 5760 | successful. */ |
diff --git a/src/lisp.h b/src/lisp.h index 20270bc357e..fa08ab07dce 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3136,7 +3136,7 @@ extern Lisp_Object next_single_char_property_change P_ ((Lisp_Object, | |||
| 3136 | 3136 | ||
| 3137 | /* defined in xmenu.c */ | 3137 | /* defined in xmenu.c */ |
| 3138 | EXFUN (Fx_popup_menu, 2); | 3138 | EXFUN (Fx_popup_menu, 2); |
| 3139 | EXFUN (Fx_popup_dialog, 2); | 3139 | EXFUN (Fx_popup_dialog, 3); |
| 3140 | extern void syms_of_xmenu P_ ((void)); | 3140 | extern void syms_of_xmenu P_ ((void)); |
| 3141 | 3141 | ||
| 3142 | /* defined in sysdep.c */ | 3142 | /* defined in sysdep.c */ |
diff --git a/src/macmenu.c b/src/macmenu.c index eb870176f12..54393bca594 100644 --- a/src/macmenu.c +++ b/src/macmenu.c | |||
| @@ -823,7 +823,7 @@ cached information about equivalent key sequences. */) | |||
| 823 | 823 | ||
| 824 | #ifdef HAVE_MENUS | 824 | #ifdef HAVE_MENUS |
| 825 | 825 | ||
| 826 | DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 2, 0, | 826 | DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0, |
| 827 | doc: /* Pop up a dialog box and return user's selection. | 827 | doc: /* Pop up a dialog box and return user's selection. |
| 828 | POSITION specifies which frame to use. | 828 | POSITION specifies which frame to use. |
| 829 | This is normally a mouse button event or a window or frame. | 829 | This is normally a mouse button event or a window or frame. |
| @@ -838,9 +838,12 @@ The return value is VALUE from the chosen item. | |||
| 838 | An ITEM may also be just a string--that makes a nonselectable item. | 838 | An ITEM may also be just a string--that makes a nonselectable item. |
| 839 | An ITEM may also be nil--that means to put all preceding items | 839 | An ITEM may also be nil--that means to put all preceding items |
| 840 | on the left of the dialog box and all following items on the right. | 840 | on the left of the dialog box and all following items on the right. |
| 841 | \(By default, approximately half appear on each side.) */) | 841 | \(By default, approximately half appear on each side.) |
| 842 | (position, contents) | 842 | |
| 843 | Lisp_Object position, contents; | 843 | If HEADER is non-nil, the frame title for the box is "Information", |
| 844 | otherwise it is "Question". */) | ||
| 845 | (position, contents, header) | ||
| 846 | Lisp_Object position, contents, header; | ||
| 844 | { | 847 | { |
| 845 | FRAME_PTR f = NULL; | 848 | FRAME_PTR f = NULL; |
| 846 | Lisp_Object window; | 849 | Lisp_Object window; |
| @@ -927,7 +930,7 @@ on the left of the dialog box and all following items on the right. | |||
| 927 | 930 | ||
| 928 | /* Display them in a dialog box. */ | 931 | /* Display them in a dialog box. */ |
| 929 | BLOCK_INPUT; | 932 | BLOCK_INPUT; |
| 930 | selection = mac_dialog_show (f, 0, title, &error_name); | 933 | selection = mac_dialog_show (f, 0, title, header, &error_name); |
| 931 | UNBLOCK_INPUT; | 934 | UNBLOCK_INPUT; |
| 932 | 935 | ||
| 933 | discard_menu_items (); | 936 | discard_menu_items (); |
| @@ -2046,10 +2049,10 @@ static char * button_names [] = { | |||
| 2046 | "button6", "button7", "button8", "button9", "button10" }; | 2049 | "button6", "button7", "button8", "button9", "button10" }; |
| 2047 | 2050 | ||
| 2048 | static Lisp_Object | 2051 | static Lisp_Object |
| 2049 | mac_dialog_show (f, keymaps, title, error) | 2052 | mac_dialog_show (f, keymaps, title, header, error) |
| 2050 | FRAME_PTR f; | 2053 | FRAME_PTR f; |
| 2051 | int keymaps; | 2054 | int keymaps; |
| 2052 | Lisp_Object title; | 2055 | Lisp_Object title, header; |
| 2053 | char **error; | 2056 | char **error; |
| 2054 | { | 2057 | { |
| 2055 | int i, nb_buttons=0; | 2058 | int i, nb_buttons=0; |
| @@ -2152,11 +2155,17 @@ mac_dialog_show (f, keymaps, title, error) | |||
| 2152 | wv->name = dialog_name; | 2155 | wv->name = dialog_name; |
| 2153 | wv->help = Qnil; | 2156 | wv->help = Qnil; |
| 2154 | 2157 | ||
| 2158 | /* Frame title: 'Q' = Question, 'I' = Information. | ||
| 2159 | Can also have 'E' = Error if, one day, we want | ||
| 2160 | a popup for errors. */ | ||
| 2161 | if (NILP(header)) | ||
| 2162 | dialog_name[0] = 'Q'; | ||
| 2163 | else | ||
| 2164 | dialog_name[0] = 'I'; | ||
| 2165 | |||
| 2155 | /* Dialog boxes use a really stupid name encoding | 2166 | /* Dialog boxes use a really stupid name encoding |
| 2156 | which specifies how many buttons to use | 2167 | which specifies how many buttons to use |
| 2157 | and how many buttons are on the right. | 2168 | and how many buttons are on the right. */ |
| 2158 | The Q means something also. */ | ||
| 2159 | dialog_name[0] = 'Q'; | ||
| 2160 | dialog_name[1] = '0' + nb_buttons; | 2169 | dialog_name[1] = '0' + nb_buttons; |
| 2161 | dialog_name[2] = 'B'; | 2170 | dialog_name[2] = 'B'; |
| 2162 | dialog_name[3] = 'R'; | 2171 | dialog_name[3] = 'R'; |
diff --git a/src/process.c b/src/process.c index 84d373ff37b..34966d35160 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5139,6 +5139,7 @@ send_process (proc, buf, len, object) | |||
| 5139 | int rv; | 5139 | int rv; |
| 5140 | struct coding_system *coding; | 5140 | struct coding_system *coding; |
| 5141 | struct gcpro gcpro1; | 5141 | struct gcpro gcpro1; |
| 5142 | SIGTYPE (*volatile old_sigpipe) (); | ||
| 5142 | 5143 | ||
| 5143 | GCPRO1 (object); | 5144 | GCPRO1 (object); |
| 5144 | 5145 | ||
| @@ -5256,7 +5257,6 @@ send_process (proc, buf, len, object) | |||
| 5256 | while (len > 0) | 5257 | while (len > 0) |
| 5257 | { | 5258 | { |
| 5258 | int this = len; | 5259 | int this = len; |
| 5259 | SIGTYPE (*old_sigpipe)(); | ||
| 5260 | 5260 | ||
| 5261 | /* Decide how much data we can send in one batch. | 5261 | /* Decide how much data we can send in one batch. |
| 5262 | Long lines need to be split into multiple batches. */ | 5262 | Long lines need to be split into multiple batches. */ |
| @@ -5399,6 +5399,7 @@ send_process (proc, buf, len, object) | |||
| 5399 | #endif /* not VMS */ | 5399 | #endif /* not VMS */ |
| 5400 | else | 5400 | else |
| 5401 | { | 5401 | { |
| 5402 | signal (SIGPIPE, old_sigpipe); | ||
| 5402 | #ifndef VMS | 5403 | #ifndef VMS |
| 5403 | proc = process_sent_to; | 5404 | proc = process_sent_to; |
| 5404 | p = XPROCESS (proc); | 5405 | p = XPROCESS (proc); |
diff --git a/src/termcap.c b/src/termcap.c index a1c068e0964..aa30aaa0615 100644 --- a/src/termcap.c +++ b/src/termcap.c | |||
| @@ -458,6 +458,7 @@ static int name_match (); | |||
| 458 | #include <rmsdef.h> | 458 | #include <rmsdef.h> |
| 459 | #include <fab.h> | 459 | #include <fab.h> |
| 460 | #include <nam.h> | 460 | #include <nam.h> |
| 461 | #include <starlet.h> | ||
| 461 | 462 | ||
| 462 | static int | 463 | static int |
| 463 | valid_filename_p (fn) | 464 | valid_filename_p (fn) |
diff --git a/src/w32menu.c b/src/w32menu.c index 4553895d829..8a90eae7ec7 100644 --- a/src/w32menu.c +++ b/src/w32menu.c | |||
| @@ -845,7 +845,7 @@ cached information about equivalent key sequences. */) | |||
| 845 | 845 | ||
| 846 | #ifdef HAVE_MENUS | 846 | #ifdef HAVE_MENUS |
| 847 | 847 | ||
| 848 | DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 2, 0, | 848 | DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0, |
| 849 | doc: /* Pop up a dialog box and return user's selection. | 849 | doc: /* Pop up a dialog box and return user's selection. |
| 850 | POSITION specifies which frame to use. | 850 | POSITION specifies which frame to use. |
| 851 | This is normally a mouse button event or a window or frame. | 851 | This is normally a mouse button event or a window or frame. |
| @@ -860,9 +860,12 @@ The return value is VALUE from the chosen item. | |||
| 860 | An ITEM may also be just a string--that makes a nonselectable item. | 860 | An ITEM may also be just a string--that makes a nonselectable item. |
| 861 | An ITEM may also be nil--that means to put all preceding items | 861 | An ITEM may also be nil--that means to put all preceding items |
| 862 | on the left of the dialog box and all following items on the right. | 862 | on the left of the dialog box and all following items on the right. |
| 863 | \(By default, approximately half appear on each side.) */) | 863 | \(By default, approximately half appear on each side.) |
| 864 | (position, contents) | 864 | |
| 865 | Lisp_Object position, contents; | 865 | If HEADER is non-nil, the frame title for the box is "Information", |
| 866 | otherwise it is "Question". */) | ||
| 867 | (position, contents, header) | ||
| 868 | Lisp_Object position, contents, header; | ||
| 866 | { | 869 | { |
| 867 | FRAME_PTR f = NULL; | 870 | FRAME_PTR f = NULL; |
| 868 | Lisp_Object window; | 871 | Lisp_Object window; |
| @@ -949,7 +952,7 @@ on the left of the dialog box and all following items on the right. | |||
| 949 | 952 | ||
| 950 | /* Display them in a dialog box. */ | 953 | /* Display them in a dialog box. */ |
| 951 | BLOCK_INPUT; | 954 | BLOCK_INPUT; |
| 952 | selection = w32_dialog_show (f, 0, title, &error_name); | 955 | selection = w32_dialog_show (f, 0, title, header, &error_name); |
| 953 | UNBLOCK_INPUT; | 956 | UNBLOCK_INPUT; |
| 954 | 957 | ||
| 955 | discard_menu_items (); | 958 | discard_menu_items (); |
| @@ -1995,10 +1998,10 @@ static char * button_names [] = { | |||
| 1995 | "button6", "button7", "button8", "button9", "button10" }; | 1998 | "button6", "button7", "button8", "button9", "button10" }; |
| 1996 | 1999 | ||
| 1997 | static Lisp_Object | 2000 | static Lisp_Object |
| 1998 | w32_dialog_show (f, keymaps, title, error) | 2001 | w32_dialog_show (f, keymaps, title, header, error) |
| 1999 | FRAME_PTR f; | 2002 | FRAME_PTR f; |
| 2000 | int keymaps; | 2003 | int keymaps; |
| 2001 | Lisp_Object title; | 2004 | Lisp_Object title, header; |
| 2002 | char **error; | 2005 | char **error; |
| 2003 | { | 2006 | { |
| 2004 | int i, nb_buttons=0; | 2007 | int i, nb_buttons=0; |
| @@ -2099,11 +2102,17 @@ w32_dialog_show (f, keymaps, title, error) | |||
| 2099 | wv->name = dialog_name; | 2102 | wv->name = dialog_name; |
| 2100 | wv->help = Qnil; | 2103 | wv->help = Qnil; |
| 2101 | 2104 | ||
| 2105 | /* Frame title: 'Q' = Question, 'I' = Information. | ||
| 2106 | Can also have 'E' = Error if, one day, we want | ||
| 2107 | a popup for errors. */ | ||
| 2108 | if (NILP(header)) | ||
| 2109 | dialog_name[0] = 'Q'; | ||
| 2110 | else | ||
| 2111 | dialog_name[0] = 'I'; | ||
| 2112 | |||
| 2102 | /* Dialog boxes use a really stupid name encoding | 2113 | /* Dialog boxes use a really stupid name encoding |
| 2103 | which specifies how many buttons to use | 2114 | which specifies how many buttons to use |
| 2104 | and how many buttons are on the right. | 2115 | and how many buttons are on the right. */ |
| 2105 | The Q means something also. */ | ||
| 2106 | dialog_name[0] = 'Q'; | ||
| 2107 | dialog_name[1] = '0' + nb_buttons; | 2116 | dialog_name[1] = '0' + nb_buttons; |
| 2108 | dialog_name[2] = 'B'; | 2117 | dialog_name[2] = 'B'; |
| 2109 | dialog_name[3] = 'R'; | 2118 | dialog_name[3] = 'R'; |
diff --git a/src/window.c b/src/window.c index 454d712726c..35aeb4411ae 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -544,7 +544,7 @@ display margins, fringes, header line, and/or mode line. */) | |||
| 544 | + WINDOW_LEFT_FRINGE_COLS (w)), | 544 | + WINDOW_LEFT_FRINGE_COLS (w)), |
| 545 | make_number (WINDOW_TOP_EDGE_LINE (w) | 545 | make_number (WINDOW_TOP_EDGE_LINE (w) |
| 546 | + WINDOW_HEADER_LINE_LINES (w)), | 546 | + WINDOW_HEADER_LINE_LINES (w)), |
| 547 | make_number (WINDOW_RIGHT_EDGE_COL (w) | 547 | make_number (WINDOW_BOX_RIGHT_EDGE_COL (w) |
| 548 | - WINDOW_RIGHT_MARGIN_COLS (w) | 548 | - WINDOW_RIGHT_MARGIN_COLS (w) |
| 549 | - WINDOW_RIGHT_FRINGE_COLS (w)), | 549 | - WINDOW_RIGHT_FRINGE_COLS (w)), |
| 550 | make_number (WINDOW_BOTTOM_EDGE_LINE (w) | 550 | make_number (WINDOW_BOTTOM_EDGE_LINE (w) |
| @@ -568,7 +568,7 @@ display margins, fringes, header line, and/or mode line. */) | |||
| 568 | + WINDOW_LEFT_FRINGE_WIDTH (w)), | 568 | + WINDOW_LEFT_FRINGE_WIDTH (w)), |
| 569 | make_number (WINDOW_TOP_EDGE_Y (w) | 569 | make_number (WINDOW_TOP_EDGE_Y (w) |
| 570 | + WINDOW_HEADER_LINE_HEIGHT (w)), | 570 | + WINDOW_HEADER_LINE_HEIGHT (w)), |
| 571 | make_number (WINDOW_RIGHT_EDGE_X (w) | 571 | make_number (WINDOW_BOX_RIGHT_EDGE_X (w) |
| 572 | - WINDOW_RIGHT_MARGIN_WIDTH (w) | 572 | - WINDOW_RIGHT_MARGIN_WIDTH (w) |
| 573 | - WINDOW_RIGHT_FRINGE_WIDTH (w)), | 573 | - WINDOW_RIGHT_FRINGE_WIDTH (w)), |
| 574 | make_number (WINDOW_BOTTOM_EDGE_Y (w) | 574 | make_number (WINDOW_BOTTOM_EDGE_Y (w) |
diff --git a/src/xdisp.c b/src/xdisp.c index 2284c34d3bd..2781d4a1d2c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -16134,7 +16134,12 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16134 | && --limit > 0 | 16134 | && --limit > 0 |
| 16135 | && (precision <= 0 || n < precision)) | 16135 | && (precision <= 0 || n < precision)) |
| 16136 | { | 16136 | { |
| 16137 | n += display_mode_element (it, depth, field_width - n, | 16137 | n += display_mode_element (it, depth, |
| 16138 | /* Do padding only after the last | ||
| 16139 | element in the list. */ | ||
| 16140 | (! CONSP (XCDR (elt)) | ||
| 16141 | ? field_width - n | ||
| 16142 | : 0), | ||
| 16138 | precision - n, XCAR (elt), | 16143 | precision - n, XCAR (elt), |
| 16139 | props, risky); | 16144 | props, risky); |
| 16140 | elt = XCDR (elt); | 16145 | elt = XCDR (elt); |
| @@ -21378,11 +21383,12 @@ define_frame_cursor1 (f, cursor, pointer) | |||
| 21378 | position relative to the start of the mode line. */ | 21383 | position relative to the start of the mode line. */ |
| 21379 | 21384 | ||
| 21380 | static void | 21385 | static void |
| 21381 | note_mode_line_or_margin_highlight (w, x, y, area) | 21386 | note_mode_line_or_margin_highlight (window, x, y, area) |
| 21382 | struct window *w; | 21387 | Lisp_Object window; |
| 21383 | int x, y; | 21388 | int x, y; |
| 21384 | enum window_part area; | 21389 | enum window_part area; |
| 21385 | { | 21390 | { |
| 21391 | struct window *w = XWINDOW (window); | ||
| 21386 | struct frame *f = XFRAME (w->frame); | 21392 | struct frame *f = XFRAME (w->frame); |
| 21387 | Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 21393 | Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 21388 | Cursor cursor = FRAME_X_OUTPUT (f)->nontext_cursor; | 21394 | Cursor cursor = FRAME_X_OUTPUT (f)->nontext_cursor; |
| @@ -21391,9 +21397,38 @@ note_mode_line_or_margin_highlight (w, x, y, area) | |||
| 21391 | Lisp_Object string, object = Qnil; | 21397 | Lisp_Object string, object = Qnil; |
| 21392 | Lisp_Object pos, help; | 21398 | Lisp_Object pos, help; |
| 21393 | 21399 | ||
| 21400 | Lisp_Object mouse_face; | ||
| 21401 | int original_x_pixel = x; | ||
| 21402 | struct glyph * glyph = NULL; | ||
| 21403 | struct glyph_row *row; | ||
| 21404 | |||
| 21394 | if (area == ON_MODE_LINE || area == ON_HEADER_LINE) | 21405 | if (area == ON_MODE_LINE || area == ON_HEADER_LINE) |
| 21395 | string = mode_line_string (w, area, &x, &y, &charpos, | 21406 | { |
| 21396 | &object, &dx, &dy, &width, &height); | 21407 | int x0; |
| 21408 | struct glyph *end; | ||
| 21409 | |||
| 21410 | string = mode_line_string (w, area, &x, &y, &charpos, | ||
| 21411 | &object, &dx, &dy, &width, &height); | ||
| 21412 | |||
| 21413 | row = (area == ON_MODE_LINE | ||
| 21414 | ? MATRIX_MODE_LINE_ROW (w->current_matrix) | ||
| 21415 | : MATRIX_HEADER_LINE_ROW (w->current_matrix)); | ||
| 21416 | |||
| 21417 | /* Find glyph */ | ||
| 21418 | if (row->mode_line_p && row->enabled_p) | ||
| 21419 | { | ||
| 21420 | glyph = row->glyphs[TEXT_AREA]; | ||
| 21421 | end = glyph + row->used[TEXT_AREA]; | ||
| 21422 | |||
| 21423 | for (x0 = original_x_pixel; | ||
| 21424 | glyph < end && x0 >= glyph->pixel_width; | ||
| 21425 | ++glyph) | ||
| 21426 | x0 -= glyph->pixel_width; | ||
| 21427 | |||
| 21428 | if (glyph >= end) | ||
| 21429 | glyph = NULL; | ||
| 21430 | } | ||
| 21431 | } | ||
| 21397 | else | 21432 | else |
| 21398 | { | 21433 | { |
| 21399 | x -= WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w); | 21434 | x -= WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w); |
| @@ -21471,6 +21506,91 @@ note_mode_line_or_margin_highlight (w, x, y, area) | |||
| 21471 | if (!KEYMAPP (map)) | 21506 | if (!KEYMAPP (map)) |
| 21472 | cursor = dpyinfo->vertical_scroll_bar_cursor; | 21507 | cursor = dpyinfo->vertical_scroll_bar_cursor; |
| 21473 | } | 21508 | } |
| 21509 | |||
| 21510 | /* Change the mouse face according to what is under X/Y. */ | ||
| 21511 | mouse_face = Fget_text_property (pos, Qmouse_face, string); | ||
| 21512 | if (!NILP (mouse_face) | ||
| 21513 | && ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE)) | ||
| 21514 | && glyph) | ||
| 21515 | { | ||
| 21516 | Lisp_Object b, e; | ||
| 21517 | |||
| 21518 | struct glyph * tmp_glyph; | ||
| 21519 | |||
| 21520 | int gpos; | ||
| 21521 | int gseq_length; | ||
| 21522 | int total_pixel_width; | ||
| 21523 | int ignore; | ||
| 21524 | |||
| 21525 | |||
| 21526 | if (clear_mouse_face (dpyinfo)) | ||
| 21527 | cursor = No_Cursor; | ||
| 21528 | |||
| 21529 | b = Fprevious_single_property_change (make_number (charpos + 1), | ||
| 21530 | Qmouse_face, string, Qnil); | ||
| 21531 | if (NILP (b)) | ||
| 21532 | b = make_number (0); | ||
| 21533 | |||
| 21534 | e = Fnext_single_property_change (pos, Qmouse_face, string, Qnil); | ||
| 21535 | if (NILP (e)) | ||
| 21536 | e = make_number (SCHARS (string)); | ||
| 21537 | |||
| 21538 | /* Calculate the position(glyph position: GPOS) of GLYPH in | ||
| 21539 | displayed string. GPOS is different from CHARPOS. | ||
| 21540 | |||
| 21541 | CHARPOS is the position of glyph in internal string | ||
| 21542 | object. A mode line string format has structures which | ||
| 21543 | is converted to a flatten by emacs lisp interpreter. | ||
| 21544 | The internal string is an element of the structures. | ||
| 21545 | The displayed string is the flatten string. */ | ||
| 21546 | for (tmp_glyph = glyph - 1, gpos = 0; | ||
| 21547 | tmp_glyph->charpos >= XINT (b); | ||
| 21548 | tmp_glyph--, gpos++) | ||
| 21549 | { | ||
| 21550 | if (tmp_glyph->object != glyph->object) | ||
| 21551 | break; | ||
| 21552 | } | ||
| 21553 | |||
| 21554 | /* Calculate the lenght(glyph sequence length: GSEQ_LENGTH) of | ||
| 21555 | displayed string holding GLYPH. | ||
| 21556 | |||
| 21557 | GSEQ_LENGTH is different from SCHARS (STRING). | ||
| 21558 | SCHARS (STRING) returns the length of the internal string. */ | ||
| 21559 | for (tmp_glyph = glyph, gseq_length = gpos; | ||
| 21560 | tmp_glyph->charpos < XINT (e); | ||
| 21561 | tmp_glyph++, gseq_length++) | ||
| 21562 | { | ||
| 21563 | if (tmp_glyph->object != glyph->object) | ||
| 21564 | break; | ||
| 21565 | } | ||
| 21566 | |||
| 21567 | total_pixel_width = 0; | ||
| 21568 | for (tmp_glyph = glyph - gpos; tmp_glyph != glyph; tmp_glyph++) | ||
| 21569 | total_pixel_width += tmp_glyph->pixel_width; | ||
| 21570 | |||
| 21571 | dpyinfo->mouse_face_beg_col = (x - gpos); | ||
| 21572 | dpyinfo->mouse_face_beg_row = (area == ON_MODE_LINE | ||
| 21573 | ? (w->current_matrix)->nrows - 1 | ||
| 21574 | : 0); | ||
| 21575 | |||
| 21576 | dpyinfo->mouse_face_beg_x = original_x_pixel - (total_pixel_width + dx); | ||
| 21577 | dpyinfo->mouse_face_beg_y = 0; | ||
| 21578 | |||
| 21579 | dpyinfo->mouse_face_end_col = (x - gpos) + gseq_length; | ||
| 21580 | dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_beg_row; | ||
| 21581 | |||
| 21582 | dpyinfo->mouse_face_end_x = 0; | ||
| 21583 | dpyinfo->mouse_face_end_y = 0; | ||
| 21584 | |||
| 21585 | dpyinfo->mouse_face_past_end = 0; | ||
| 21586 | dpyinfo->mouse_face_window = window; | ||
| 21587 | |||
| 21588 | dpyinfo->mouse_face_face_id = face_at_string_position (w, string, | ||
| 21589 | charpos, | ||
| 21590 | 0, 0, 0, &ignore, | ||
| 21591 | glyph->face_id, 1); | ||
| 21592 | show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); | ||
| 21593 | } | ||
| 21474 | } | 21594 | } |
| 21475 | 21595 | ||
| 21476 | define_frame_cursor1 (f, cursor, pointer); | 21596 | define_frame_cursor1 (f, cursor, pointer); |
| @@ -21551,7 +21671,7 @@ note_mouse_highlight (f, x, y) | |||
| 21551 | if (part == ON_MODE_LINE || part == ON_HEADER_LINE | 21671 | if (part == ON_MODE_LINE || part == ON_HEADER_LINE |
| 21552 | || part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN) | 21672 | || part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN) |
| 21553 | { | 21673 | { |
| 21554 | note_mode_line_or_margin_highlight (w, x, y, part); | 21674 | note_mode_line_or_margin_highlight (window, x, y, part); |
| 21555 | return; | 21675 | return; |
| 21556 | } | 21676 | } |
| 21557 | 21677 | ||
| @@ -21811,6 +21931,7 @@ note_mouse_highlight (f, x, y) | |||
| 21811 | b = make_number (0); | 21931 | b = make_number (0); |
| 21812 | if (NILP (e)) | 21932 | if (NILP (e)) |
| 21813 | e = make_number (SCHARS (object) - 1); | 21933 | e = make_number (SCHARS (object) - 1); |
| 21934 | |||
| 21814 | fast_find_string_pos (w, XINT (b), object, | 21935 | fast_find_string_pos (w, XINT (b), object, |
| 21815 | &dpyinfo->mouse_face_beg_col, | 21936 | &dpyinfo->mouse_face_beg_col, |
| 21816 | &dpyinfo->mouse_face_beg_row, | 21937 | &dpyinfo->mouse_face_beg_row, |
diff --git a/src/xmenu.c b/src/xmenu.c index 1ecddf211b4..9103d32e1c9 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -116,7 +116,8 @@ extern Lisp_Object Qmenu_bar_update_hook; | |||
| 116 | extern void set_frame_menubar P_ ((FRAME_PTR, int, int)); | 116 | extern void set_frame_menubar P_ ((FRAME_PTR, int, int)); |
| 117 | extern XtAppContext Xt_app_con; | 117 | extern XtAppContext Xt_app_con; |
| 118 | 118 | ||
| 119 | static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **)); | 119 | static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, Lisp_Object, |
| 120 | char **)); | ||
| 120 | static void popup_get_selection P_ ((XEvent *, struct x_display_info *, | 121 | static void popup_get_selection P_ ((XEvent *, struct x_display_info *, |
| 121 | LWLIB_ID, int)); | 122 | LWLIB_ID, int)); |
| 122 | 123 | ||
| @@ -129,7 +130,8 @@ static void popup_get_selection P_ ((XEvent *, struct x_display_info *, | |||
| 129 | #include "gtkutil.h" | 130 | #include "gtkutil.h" |
| 130 | #define HAVE_BOXES 1 | 131 | #define HAVE_BOXES 1 |
| 131 | extern void set_frame_menubar P_ ((FRAME_PTR, int, int)); | 132 | extern void set_frame_menubar P_ ((FRAME_PTR, int, int)); |
| 132 | static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **)); | 133 | static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, Lisp_Object, |
| 134 | char **)); | ||
| 133 | #endif | 135 | #endif |
| 134 | 136 | ||
| 135 | /* This is how to deal with multibyte text if HAVE_MULTILINGUAL_MENU | 137 | /* This is how to deal with multibyte text if HAVE_MULTILINGUAL_MENU |
| @@ -999,7 +1001,7 @@ no quit occurs and `x-popup-menu' returns nil. */) | |||
| 999 | 1001 | ||
| 1000 | #ifdef HAVE_MENUS | 1002 | #ifdef HAVE_MENUS |
| 1001 | 1003 | ||
| 1002 | DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 2, 0, | 1004 | DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0, |
| 1003 | doc: /* Pop up a dialog box and return user's selection. | 1005 | doc: /* Pop up a dialog box and return user's selection. |
| 1004 | POSITION specifies which frame to use. | 1006 | POSITION specifies which frame to use. |
| 1005 | This is normally a mouse button event or a window or frame. | 1007 | This is normally a mouse button event or a window or frame. |
| @@ -1007,7 +1009,7 @@ If POSITION is t, it means to use the frame the mouse is on. | |||
| 1007 | The dialog box appears in the middle of the specified frame. | 1009 | The dialog box appears in the middle of the specified frame. |
| 1008 | 1010 | ||
| 1009 | CONTENTS specifies the alternatives to display in the dialog box. | 1011 | CONTENTS specifies the alternatives to display in the dialog box. |
| 1010 | It is a list of the form (TITLE ITEM1 ITEM2...). | 1012 | It is a list of the form (DIALOG ITEM1 ITEM2...). |
| 1011 | Each ITEM is a cons cell (STRING . VALUE). | 1013 | Each ITEM is a cons cell (STRING . VALUE). |
| 1012 | The return value is VALUE from the chosen item. | 1014 | The return value is VALUE from the chosen item. |
| 1013 | 1015 | ||
| @@ -1016,11 +1018,14 @@ An ITEM may also be nil--that means to put all preceding items | |||
| 1016 | on the left of the dialog box and all following items on the right. | 1018 | on the left of the dialog box and all following items on the right. |
| 1017 | \(By default, approximately half appear on each side.) | 1019 | \(By default, approximately half appear on each side.) |
| 1018 | 1020 | ||
| 1021 | If HEADER is non-nil, the frame title for the box is "Information", | ||
| 1022 | otherwise it is "Question". | ||
| 1023 | |||
| 1019 | If the user gets rid of the dialog box without making a valid choice, | 1024 | If the user gets rid of the dialog box without making a valid choice, |
| 1020 | for instance using the window manager, then this produces a quit and | 1025 | for instance using the window manager, then this produces a quit and |
| 1021 | `x-popup-dialog' does not return. */) | 1026 | `x-popup-dialog' does not return. */) |
| 1022 | (position, contents) | 1027 | (position, contents, header) |
| 1023 | Lisp_Object position, contents; | 1028 | Lisp_Object position, contents, header; |
| 1024 | { | 1029 | { |
| 1025 | FRAME_PTR f = NULL; | 1030 | FRAME_PTR f = NULL; |
| 1026 | Lisp_Object window; | 1031 | Lisp_Object window; |
| @@ -1115,7 +1120,7 @@ for instance using the window manager, then this produces a quit and | |||
| 1115 | 1120 | ||
| 1116 | /* Display them in a dialog box. */ | 1121 | /* Display them in a dialog box. */ |
| 1117 | BLOCK_INPUT; | 1122 | BLOCK_INPUT; |
| 1118 | selection = xdialog_show (f, 0, title, &error_name); | 1123 | selection = xdialog_show (f, 0, title, header, &error_name); |
| 1119 | UNBLOCK_INPUT; | 1124 | UNBLOCK_INPUT; |
| 1120 | 1125 | ||
| 1121 | unbind_to (specpdl_count, Qnil); | 1126 | unbind_to (specpdl_count, Qnil); |
| @@ -3020,11 +3025,11 @@ static char * button_names [] = { | |||
| 3020 | "button6", "button7", "button8", "button9", "button10" }; | 3025 | "button6", "button7", "button8", "button9", "button10" }; |
| 3021 | 3026 | ||
| 3022 | static Lisp_Object | 3027 | static Lisp_Object |
| 3023 | xdialog_show (f, keymaps, title, error) | 3028 | xdialog_show (f, keymaps, title, header, error_name) |
| 3024 | FRAME_PTR f; | 3029 | FRAME_PTR f; |
| 3025 | int keymaps; | 3030 | int keymaps; |
| 3026 | Lisp_Object title; | 3031 | Lisp_Object title, header; |
| 3027 | char **error; | 3032 | char **error_name; |
| 3028 | { | 3033 | { |
| 3029 | int i, nb_buttons=0; | 3034 | int i, nb_buttons=0; |
| 3030 | char dialog_name[6]; | 3035 | char dialog_name[6]; |
| @@ -3036,11 +3041,11 @@ xdialog_show (f, keymaps, title, error) | |||
| 3036 | /* 1 means we've seen the boundary between left-hand elts and right-hand. */ | 3041 | /* 1 means we've seen the boundary between left-hand elts and right-hand. */ |
| 3037 | int boundary_seen = 0; | 3042 | int boundary_seen = 0; |
| 3038 | 3043 | ||
| 3039 | *error = NULL; | 3044 | *error_name = NULL; |
| 3040 | 3045 | ||
| 3041 | if (menu_items_n_panes > 1) | 3046 | if (menu_items_n_panes > 1) |
| 3042 | { | 3047 | { |
| 3043 | *error = "Multiple panes in dialog box"; | 3048 | *error_name = "Multiple panes in dialog box"; |
| 3044 | return Qnil; | 3049 | return Qnil; |
| 3045 | } | 3050 | } |
| 3046 | 3051 | ||
| @@ -3077,7 +3082,7 @@ xdialog_show (f, keymaps, title, error) | |||
| 3077 | if (NILP (item_name)) | 3082 | if (NILP (item_name)) |
| 3078 | { | 3083 | { |
| 3079 | free_menubar_widget_value_tree (first_wv); | 3084 | free_menubar_widget_value_tree (first_wv); |
| 3080 | *error = "Submenu in dialog items"; | 3085 | *error_name = "Submenu in dialog items"; |
| 3081 | return Qnil; | 3086 | return Qnil; |
| 3082 | } | 3087 | } |
| 3083 | if (EQ (item_name, Qquote)) | 3088 | if (EQ (item_name, Qquote)) |
| @@ -3091,7 +3096,7 @@ xdialog_show (f, keymaps, title, error) | |||
| 3091 | if (nb_buttons >= 9) | 3096 | if (nb_buttons >= 9) |
| 3092 | { | 3097 | { |
| 3093 | free_menubar_widget_value_tree (first_wv); | 3098 | free_menubar_widget_value_tree (first_wv); |
| 3094 | *error = "Too many dialog items"; | 3099 | *error_name = "Too many dialog items"; |
| 3095 | return Qnil; | 3100 | return Qnil; |
| 3096 | } | 3101 | } |
| 3097 | 3102 | ||
| @@ -3121,11 +3126,18 @@ xdialog_show (f, keymaps, title, error) | |||
| 3121 | wv = xmalloc_widget_value (); | 3126 | wv = xmalloc_widget_value (); |
| 3122 | wv->name = dialog_name; | 3127 | wv->name = dialog_name; |
| 3123 | wv->help = Qnil; | 3128 | wv->help = Qnil; |
| 3129 | |||
| 3130 | /* Frame title: 'Q' = Question, 'I' = Information. | ||
| 3131 | Can also have 'E' = Error if, one day, we want | ||
| 3132 | a popup for errors. */ | ||
| 3133 | if (NILP(header)) | ||
| 3134 | dialog_name[0] = 'Q'; | ||
| 3135 | else | ||
| 3136 | dialog_name[0] = 'I'; | ||
| 3137 | |||
| 3124 | /* Dialog boxes use a really stupid name encoding | 3138 | /* Dialog boxes use a really stupid name encoding |
| 3125 | which specifies how many buttons to use | 3139 | which specifies how many buttons to use |
| 3126 | and how many buttons are on the right. | 3140 | and how many buttons are on the right. */ |
| 3127 | The Q means something also. */ | ||
| 3128 | dialog_name[0] = 'Q'; | ||
| 3129 | dialog_name[1] = '0' + nb_buttons; | 3141 | dialog_name[1] = '0' + nb_buttons; |
| 3130 | dialog_name[2] = 'B'; | 3142 | dialog_name[2] = 'B'; |
| 3131 | dialog_name[3] = 'R'; | 3143 | dialog_name[3] = 'R'; |