diff options
| author | Karoly Lorentey | 2005-03-16 16:06:15 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-03-16 16:06:15 +0000 |
| commit | 14c0ac78c48e6bdf832e370ef15ecbef6573dd06 (patch) | |
| tree | ae0aa5371351ec1a2d0bdf7c55e60b8df4b0063c /src | |
| parent | 38d2de214077b4e600d9f9d20d7ec81e1f1c8908 (diff) | |
| parent | a7679889e8213289331577d1d9e6d1187a20d035 (diff) | |
| download | emacs-14c0ac78c48e6bdf832e370ef15ecbef6573dd06.tar.gz emacs-14c0ac78c48e6bdf832e370ef15ecbef6573dd06.zip | |
Merged from miles@gnu.org--gnu-2005 (patch 37-38, 162-182)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-162
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-163
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-164
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-165
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-166
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-167
Tweak obsolete function/variable warning message
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-168
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-169
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-170
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-171
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-172
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-173
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-174
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-175
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-176
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-177
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-178
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-179
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-180
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-181
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-182
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-37
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-38
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-309
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 82 | ||||
| -rw-r--r-- | src/coding.c | 5 | ||||
| -rw-r--r-- | src/dispextern.h | 1 | ||||
| -rw-r--r-- | src/fileio.c | 27 | ||||
| -rw-r--r-- | src/fontset.c | 30 | ||||
| -rw-r--r-- | src/fontset.h | 1 | ||||
| -rw-r--r-- | src/frame.c | 1 | ||||
| -rw-r--r-- | src/gtkutil.c | 9 | ||||
| -rw-r--r-- | src/keyboard.c | 18 | ||||
| -rw-r--r-- | src/macterm.c | 18 | ||||
| -rw-r--r-- | src/xdisp.c | 30 | ||||
| -rw-r--r-- | src/xfns.c | 147 | ||||
| -rw-r--r-- | src/xmenu.c | 43 |
13 files changed, 282 insertions, 130 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 854a8673458..f0f27785e3d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,64 @@ | |||
| 1 | 2005-03-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * macterm.c (keycode_to_xkeysym_table): Change mapping so that it | ||
| 4 | coincide with that in Apple X11 except `clear', `enter' on | ||
| 5 | laptops, and fn + `enter' on laptops. | ||
| 6 | |||
| 7 | 2005-03-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 8 | |||
| 9 | * xmenu.c (ENCODE_MENU_STRING): Explicitly use string_make_unibyte. | ||
| 10 | (list_of_panes, list_of_items, Fx_popup_menu): Use XCAR/XCDR. | ||
| 11 | (digest_single_submenu, xmenu_show): Use ENCODE_MENU_STRING. | ||
| 12 | |||
| 13 | * xfns.c (xic_defaut_fontset): New constant. | ||
| 14 | (xic_create_fontsetname): New function. | ||
| 15 | Extracted from create_frame_xic. Try to generate a slightly | ||
| 16 | better fontset. | ||
| 17 | (xic_create_xfontset): Use it. | ||
| 18 | (create_frame_xic): Simplify. | ||
| 19 | |||
| 20 | 2005-03-11 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 21 | |||
| 22 | * fileio.c (Fmake_symbolic_link): Fix last change. | ||
| 23 | |||
| 24 | 2005-03-11 Richard M. Stallman <rms@gnu.org> | ||
| 25 | |||
| 26 | * fileio.c (Frename_file, Fadd_name_to_file) | ||
| 27 | (Fmake_symbolic_link): If NEWNAME or LINKNAME is a directory, | ||
| 28 | expand the basename of FILE relative to it. | ||
| 29 | |||
| 30 | 2005-03-11 Kenichi Handa <handa@m17n.org> | ||
| 31 | |||
| 32 | * fileio.c (Finsert_file_contents): Call Fcheck_coding_system | ||
| 33 | before calling setup_coding_system so that autoloading of a coding | ||
| 34 | system work. | ||
| 35 | |||
| 36 | 2005-03-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 37 | |||
| 38 | * xfns.c (hourglass_started): New function. | ||
| 39 | |||
| 40 | * dispextern.h: Declare hourglass_started. | ||
| 41 | |||
| 42 | * keyboard.c (Fexecute_extended_command): Restart hourglass | ||
| 43 | after call to Fcompleting_read if already started. | ||
| 44 | |||
| 45 | * gtkutil.c (xg_update_scrollbar_pos): Call x_sync so that the | ||
| 46 | GTK main loop is entered in xterm.c, thus doing the redraw. | ||
| 47 | |||
| 48 | 2005-03-10 Kim F. Storm <storm@cua.dk> | ||
| 49 | |||
| 50 | * xdisp.c (pos_visible_p): Fix X value in last line of buffer. | ||
| 51 | |||
| 52 | 2005-03-08 Kenichi Handa <handa@m17n.org> | ||
| 53 | |||
| 54 | * frame.c (x_set_font): Call set_default_ascii_font if an | ||
| 55 | available font is found. | ||
| 56 | |||
| 57 | * fontset.c (set_default_ascii_font): New function. | ||
| 58 | (syms_of_fontset): Don't set FONTSET_ASCII (Vdefault_fontset) here. | ||
| 59 | |||
| 60 | * fontset.h (set_default_ascii_font): Extern it. | ||
| 61 | |||
| 1 | 2005-03-07 Kim F. Storm <storm@cua.dk> | 62 | 2005-03-07 Kim F. Storm <storm@cua.dk> |
| 2 | 63 | ||
| 3 | * xdisp.c (CLEAR_IMAGE_CACHE_COUNT): New const. | 64 | * xdisp.c (CLEAR_IMAGE_CACHE_COUNT): New const. |
| @@ -55,13 +116,11 @@ | |||
| 55 | * emacs.c (main): Change `#ifdef HAVE_CARBON' to `#if | 116 | * emacs.c (main): Change `#ifdef HAVE_CARBON' to `#if |
| 56 | defined (MAC_OSX) && defined (HAVE_CARBON)'. | 117 | defined (MAC_OSX) && defined (HAVE_CARBON)'. |
| 57 | 118 | ||
| 58 | * image.c [!MAC_OSX && TARGET_API_MAC_CARBON]: Include | 119 | * image.c [!MAC_OSX && TARGET_API_MAC_CARBON]: Include QuickTime.h. |
| 59 | QuickTime.h. | ||
| 60 | 120 | ||
| 61 | * mac.c [!MAC_OSX && HAVE_CARBON]: Include Carbon.h. | 121 | * mac.c [!MAC_OSX && HAVE_CARBON]: Include Carbon.h. |
| 62 | [!MAC_OSX] (select) [TARGET_API_MAC_CARBON]: Use ReceiveNextEvent. | 122 | [!MAC_OSX] (select) [TARGET_API_MAC_CARBON]: Use ReceiveNextEvent. |
| 63 | (posix_pathname_to_fsspec, fsspec_to_posix_pathname): New | 123 | (posix_pathname_to_fsspec, fsspec_to_posix_pathname): New functions. |
| 64 | functions. | ||
| 65 | (mac_clear_font_name_table): Move extern to macterm.h. | 124 | (mac_clear_font_name_table): Move extern to macterm.h. |
| 66 | 125 | ||
| 67 | * macfns.c (install_window_handler): Move extern to macterm.h. | 126 | * macfns.c (install_window_handler): Move extern to macterm.h. |
| @@ -69,16 +128,15 @@ | |||
| 69 | valid. Don't check !NILP (dir) because it is already checked with | 128 | valid. Don't check !NILP (dir) because it is already checked with |
| 70 | CHECK_STRING. | 129 | CHECK_STRING. |
| 71 | (Fx_file_dialog) [!MAC_OSX]: Use FSSpec instead of FSRef for | 130 | (Fx_file_dialog) [!MAC_OSX]: Use FSSpec instead of FSRef for |
| 72 | specifying the default location and obtaining the selected | 131 | specifying the default location and obtaining the selected filename. |
| 73 | filename. | ||
| 74 | 132 | ||
| 75 | * macgui.h [!MAC_OSX && HAVE_CARBON]: Include Carbon.h. | 133 | * macgui.h [!MAC_OSX && HAVE_CARBON]: Include Carbon.h. |
| 76 | 134 | ||
| 77 | * macmenu.c [TARGET_API_MAC_CARBON]: Don't include headers that | 135 | * macmenu.c [TARGET_API_MAC_CARBON]: Don't include headers that |
| 78 | are included via Carbon.h. | 136 | are included via Carbon.h. |
| 79 | 137 | ||
| 80 | * macterm.c [TARGET_API_MAC_CARBON && !MAC_OSX]: Define | 138 | * macterm.c [TARGET_API_MAC_CARBON && !MAC_OSX]: |
| 81 | USE_CARBON_EVENTS to 1. | 139 | Define USE_CARBON_EVENTS to 1. |
| 82 | (qd) [__MRC__ && TARGET_API_MAC_CARBON]: Don't declare. | 140 | (qd) [__MRC__ && TARGET_API_MAC_CARBON]: Don't declare. |
| 83 | (x_free_frame_resources): Call remove_window_handler for | 141 | (x_free_frame_resources): Call remove_window_handler for |
| 84 | non-tooltip windows. | 142 | non-tooltip windows. |
| @@ -91,12 +149,12 @@ | |||
| 91 | (install_window_handler) [TARGET_API_MAC_CARBON]: Create UPPs for | 149 | (install_window_handler) [TARGET_API_MAC_CARBON]: Create UPPs for |
| 92 | drag-and-drop handler functions and register them. | 150 | drag-and-drop handler functions and register them. |
| 93 | (remove_window_handler): New function. | 151 | (remove_window_handler): New function. |
| 94 | (do_ae_open_documents, mac_do_receive_drag) [!MAC_OSX]: Use | 152 | (do_ae_open_documents, mac_do_receive_drag) [!MAC_OSX]: |
| 95 | fsspec_to_posix_pathname. | 153 | Use fsspec_to_posix_pathname. |
| 96 | (main): Change #if !TARGET_API_MAC_CARBON to #ifdef MAC_OS8. | 154 | (main): Change #if !TARGET_API_MAC_CARBON to #ifdef MAC_OS8. |
| 97 | (XTread_socket) [!MAC_OSX]: Don't pass keyboard events to TSM. | 155 | (XTread_socket) [!MAC_OSX]: Don't pass keyboard events to TSM. |
| 98 | [MAC_OS8] (make_mac_terminal_frame) [TARGET_API_MAC_CARBON]: Set | 156 | [MAC_OS8] (make_mac_terminal_frame) [TARGET_API_MAC_CARBON]: |
| 99 | default cursors. | 157 | Set default cursors. |
| 100 | (mac_initialize) [USE_CARBON_EVENTS && !MAC_OSX] : Don't call | 158 | (mac_initialize) [USE_CARBON_EVENTS && !MAC_OSX] : Don't call |
| 101 | init_service_handler or init_quit_char_handler. | 159 | init_service_handler or init_quit_char_handler. |
| 102 | (mac_initialize) [!MAC_OSX]: Don't call MakeMeTheFrontProcess. | 160 | (mac_initialize) [!MAC_OSX]: Don't call MakeMeTheFrontProcess. |
diff --git a/src/coding.c b/src/coding.c index 9cd493ab062..6a3868b016d 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -7819,7 +7819,10 @@ updated by the functions `make-coding-system' and | |||
| 7819 | On detecting a coding system, Emacs tries code detection algorithms | 7819 | On detecting a coding system, Emacs tries code detection algorithms |
| 7820 | associated with each coding-category one by one in this order. When | 7820 | associated with each coding-category one by one in this order. When |
| 7821 | one algorithm agrees with a byte sequence of source text, the coding | 7821 | one algorithm agrees with a byte sequence of source text, the coding |
| 7822 | system bound to the corresponding coding-category is selected. */); | 7822 | system bound to the corresponding coding-category is selected. |
| 7823 | |||
| 7824 | When you modify this variable, `update-coding-systems-internal' must | ||
| 7825 | be called. */); | ||
| 7823 | { | 7826 | { |
| 7824 | int i; | 7827 | int i; |
| 7825 | 7828 | ||
diff --git a/src/dispextern.h b/src/dispextern.h index 60f24feef5b..8861a9705c4 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2808,6 +2808,7 @@ EXFUN (Fx_show_tip, 6); | |||
| 2808 | EXFUN (Fx_hide_tip, 0); | 2808 | EXFUN (Fx_hide_tip, 0); |
| 2809 | extern void start_hourglass P_ ((void)); | 2809 | extern void start_hourglass P_ ((void)); |
| 2810 | extern void cancel_hourglass P_ ((void)); | 2810 | extern void cancel_hourglass P_ ((void)); |
| 2811 | extern int hourglass_started P_ ((void)); | ||
| 2811 | extern int display_hourglass_p; | 2812 | extern int display_hourglass_p; |
| 2812 | 2813 | ||
| 2813 | /* Returns the background color of IMG, calculating one heuristically if | 2814 | /* Returns the background color of IMG, calculating one heuristically if |
diff --git a/src/fileio.c b/src/fileio.c index 3212c51d096..1eaad3192d7 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* File IO for GNU Emacs. | 1 | /* File IO for GNU Emacs. |
| 2 | Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, | 2 | Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, |
| 3 | 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. | 3 | 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -2693,7 +2693,11 @@ This is what happens in interactive use with M-x. */) | |||
| 2693 | CHECK_STRING (file); | 2693 | CHECK_STRING (file); |
| 2694 | CHECK_STRING (newname); | 2694 | CHECK_STRING (newname); |
| 2695 | file = Fexpand_file_name (file, Qnil); | 2695 | file = Fexpand_file_name (file, Qnil); |
| 2696 | newname = Fexpand_file_name (newname, Qnil); | 2696 | |
| 2697 | if (!NILP (Ffile_directory_p (newname))) | ||
| 2698 | newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname); | ||
| 2699 | else | ||
| 2700 | newname = Fexpand_file_name (newname, Qnil); | ||
| 2697 | 2701 | ||
| 2698 | /* If the file name has special constructs in it, | 2702 | /* If the file name has special constructs in it, |
| 2699 | call the corresponding file handler. */ | 2703 | call the corresponding file handler. */ |
| @@ -2776,7 +2780,11 @@ This is what happens in interactive use with M-x. */) | |||
| 2776 | CHECK_STRING (file); | 2780 | CHECK_STRING (file); |
| 2777 | CHECK_STRING (newname); | 2781 | CHECK_STRING (newname); |
| 2778 | file = Fexpand_file_name (file, Qnil); | 2782 | file = Fexpand_file_name (file, Qnil); |
| 2779 | newname = Fexpand_file_name (newname, Qnil); | 2783 | |
| 2784 | if (!NILP (Ffile_directory_p (newname))) | ||
| 2785 | newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname); | ||
| 2786 | else | ||
| 2787 | newname = Fexpand_file_name (newname, Qnil); | ||
| 2780 | 2788 | ||
| 2781 | /* If the file name has special constructs in it, | 2789 | /* If the file name has special constructs in it, |
| 2782 | call the corresponding file handler. */ | 2790 | call the corresponding file handler. */ |
| @@ -2843,7 +2851,11 @@ This happens for interactive use with M-x. */) | |||
| 2843 | we want to permit links to relative file names. */ | 2851 | we want to permit links to relative file names. */ |
| 2844 | if (SREF (filename, 0) == '~') | 2852 | if (SREF (filename, 0) == '~') |
| 2845 | filename = Fexpand_file_name (filename, Qnil); | 2853 | filename = Fexpand_file_name (filename, Qnil); |
| 2846 | linkname = Fexpand_file_name (linkname, Qnil); | 2854 | |
| 2855 | if (!NILP (Ffile_directory_p (linkname))) | ||
| 2856 | linkname = Fexpand_file_name (Ffile_name_nondirectory (filename), linkname); | ||
| 2857 | else | ||
| 2858 | linkname = Fexpand_file_name (linkname, Qnil); | ||
| 2847 | 2859 | ||
| 2848 | /* If the file name has special constructs in it, | 2860 | /* If the file name has special constructs in it, |
| 2849 | call the corresponding file handler. */ | 2861 | call the corresponding file handler. */ |
| @@ -4505,12 +4517,12 @@ actually used. */) | |||
| 4505 | this way, we can run Lisp program safely before decoding | 4517 | this way, we can run Lisp program safely before decoding |
| 4506 | the inserted text. */ | 4518 | the inserted text. */ |
| 4507 | Lisp_Object unwind_data; | 4519 | Lisp_Object unwind_data; |
| 4508 | int count = SPECPDL_INDEX (); | 4520 | int count = SPECPDL_INDEX (); |
| 4509 | 4521 | ||
| 4510 | unwind_data = Fcons (current_buffer->enable_multibyte_characters, | 4522 | unwind_data = Fcons (current_buffer->enable_multibyte_characters, |
| 4511 | Fcons (current_buffer->undo_list, | 4523 | Fcons (current_buffer->undo_list, |
| 4512 | Fcurrent_buffer ())); | 4524 | Fcurrent_buffer ())); |
| 4513 | current_buffer->enable_multibyte_characters = Qnil; | 4525 | current_buffer->enable_multibyte_characters = Qnil; |
| 4514 | current_buffer->undo_list = Qt; | 4526 | current_buffer->undo_list = Qt; |
| 4515 | record_unwind_protect (decide_coding_unwind, unwind_data); | 4527 | record_unwind_protect (decide_coding_unwind, unwind_data); |
| 4516 | 4528 | ||
| @@ -4532,7 +4544,6 @@ actually used. */) | |||
| 4532 | if (CONSP (coding_systems)) | 4544 | if (CONSP (coding_systems)) |
| 4533 | val = XCAR (coding_systems); | 4545 | val = XCAR (coding_systems); |
| 4534 | } | 4546 | } |
| 4535 | |||
| 4536 | unbind_to (count, Qnil); | 4547 | unbind_to (count, Qnil); |
| 4537 | inserted = Z_BYTE - BEG_BYTE; | 4548 | inserted = Z_BYTE - BEG_BYTE; |
| 4538 | } | 4549 | } |
| @@ -4543,7 +4554,7 @@ actually used. */) | |||
| 4543 | on some system. */ | 4554 | on some system. */ |
| 4544 | { | 4555 | { |
| 4545 | struct coding_system temp_coding; | 4556 | struct coding_system temp_coding; |
| 4546 | setup_coding_system (val, &temp_coding); | 4557 | setup_coding_system (Fcheck_coding_system (val), &temp_coding); |
| 4547 | bcopy (&temp_coding, &coding, sizeof coding); | 4558 | bcopy (&temp_coding, &coding, sizeof coding); |
| 4548 | } | 4559 | } |
| 4549 | /* Ensure we set Vlast_coding_system_used. */ | 4560 | /* Ensure we set Vlast_coding_system_used. */ |
diff --git a/src/fontset.c b/src/fontset.c index 7dff29f3ed8..c427b22e379 100644 --- a/src/fontset.c +++ b/src/fontset.c | |||
| @@ -765,6 +765,23 @@ fs_load_font (f, c, fontname, id, face) | |||
| 765 | #pragma optimize("", on) | 765 | #pragma optimize("", on) |
| 766 | #endif | 766 | #endif |
| 767 | 767 | ||
| 768 | /* Set the ASCII font of the default fontset to FONTNAME if that is | ||
| 769 | not yet set. */ | ||
| 770 | void | ||
| 771 | set_default_ascii_font (fontname) | ||
| 772 | Lisp_Object fontname; | ||
| 773 | { | ||
| 774 | if (! CONSP (FONTSET_ASCII (Vdefault_fontset))) | ||
| 775 | { | ||
| 776 | int id = fs_query_fontset (fontname, 2); | ||
| 777 | |||
| 778 | if (id >= 0) | ||
| 779 | fontname = XCDR (FONTSET_ASCII (FONTSET_FROM_ID (id))); | ||
| 780 | FONTSET_ASCII (Vdefault_fontset) | ||
| 781 | = Fcons (make_number (0), fontname); | ||
| 782 | } | ||
| 783 | } | ||
| 784 | |||
| 768 | 785 | ||
| 769 | /* Cache data used by fontset_pattern_regexp. The car part is a | 786 | /* Cache data used by fontset_pattern_regexp. The car part is a |
| 770 | pattern string containing at least one wild card, the cdr part is | 787 | pattern string containing at least one wild card, the cdr part is |
| @@ -1628,19 +1645,6 @@ syms_of_fontset () | |||
| 1628 | FONTSET_ID (Vdefault_fontset) = make_number (0); | 1645 | FONTSET_ID (Vdefault_fontset) = make_number (0); |
| 1629 | FONTSET_NAME (Vdefault_fontset) | 1646 | FONTSET_NAME (Vdefault_fontset) |
| 1630 | = build_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default"); | 1647 | = build_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default"); |
| 1631 | #if defined (MAC_OS) | ||
| 1632 | FONTSET_ASCII (Vdefault_fontset) | ||
| 1633 | = Fcons (make_number (0), | ||
| 1634 | build_string ("-apple-monaco-medium-r-*--*-120-*-*-*-*-mac-roman")); | ||
| 1635 | #elif defined (WINDOWSNT) | ||
| 1636 | FONTSET_ASCII (Vdefault_fontset) | ||
| 1637 | = Fcons (make_number (0), | ||
| 1638 | build_string ("-*-courier new-normal-r-*-*-*-100-*-*-*-*-iso8859-1")); | ||
| 1639 | #else | ||
| 1640 | FONTSET_ASCII (Vdefault_fontset) | ||
| 1641 | = Fcons (make_number (0), | ||
| 1642 | build_string ("-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1")); | ||
| 1643 | #endif | ||
| 1644 | AREF (Vfontset_table, 0) = Vdefault_fontset; | 1648 | AREF (Vfontset_table, 0) = Vdefault_fontset; |
| 1645 | next_fontset_id = 1; | 1649 | next_fontset_id = 1; |
| 1646 | 1650 | ||
diff --git a/src/fontset.h b/src/fontset.h index c0f0f2d22e4..eee5e515b98 100644 --- a/src/fontset.h +++ b/src/fontset.h | |||
| @@ -194,6 +194,7 @@ extern Lisp_Object fontset_font_pattern P_ ((FRAME_PTR, int, int)); | |||
| 194 | extern int face_suitable_for_char_p P_ ((struct face *, int)); | 194 | extern int face_suitable_for_char_p P_ ((struct face *, int)); |
| 195 | extern int face_for_char P_ ((FRAME_PTR, struct face *, int)); | 195 | extern int face_for_char P_ ((FRAME_PTR, struct face *, int)); |
| 196 | extern int make_fontset_for_ascii_face P_ ((FRAME_PTR, int)); | 196 | extern int make_fontset_for_ascii_face P_ ((FRAME_PTR, int)); |
| 197 | extern void set_default_ascii_font P_ ((Lisp_Object)); | ||
| 197 | extern struct font_info *fs_load_font P_ ((struct frame *, int, char *, int, | 198 | extern struct font_info *fs_load_font P_ ((struct frame *, int, char *, int, |
| 198 | struct face *)); | 199 | struct face *)); |
| 199 | extern int fs_query_fontset P_ ((Lisp_Object, int)); | 200 | extern int fs_query_fontset P_ ((Lisp_Object, int)); |
diff --git a/src/frame.c b/src/frame.c index 06ffc04f2d1..375b1a20a9d 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -3321,6 +3321,7 @@ x_set_font (f, arg, oldval) | |||
| 3321 | error ("The characters of the given font have varying widths"); | 3321 | error ("The characters of the given font have varying widths"); |
| 3322 | else if (STRINGP (result)) | 3322 | else if (STRINGP (result)) |
| 3323 | { | 3323 | { |
| 3324 | set_default_ascii_font (result); | ||
| 3324 | if (STRINGP (fontset_name)) | 3325 | if (STRINGP (fontset_name)) |
| 3325 | { | 3326 | { |
| 3326 | /* Fontset names are built from ASCII font names, so the | 3327 | /* Fontset names are built from ASCII font names, so the |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 6dcba3036c0..8bd83e40043 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -2999,9 +2999,14 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height) | |||
| 2999 | GtkWidget *wparent = gtk_widget_get_parent (wscroll); | 2999 | GtkWidget *wparent = gtk_widget_get_parent (wscroll); |
| 3000 | 3000 | ||
| 3001 | /* Move and resize to new values. */ | 3001 | /* Move and resize to new values. */ |
| 3002 | gtk_widget_set_size_request (wscroll, width, height); | ||
| 3003 | gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top); | 3002 | gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top); |
| 3004 | 3003 | gtk_widget_set_size_request (wscroll, width, height); | |
| 3004 | gtk_widget_queue_draw (wparent); | ||
| 3005 | gdk_window_process_all_updates (); | ||
| 3006 | /* GTK does not redraw until the main loop is entered again, but | ||
| 3007 | if there are no X events pending we will not enter it. So we sync | ||
| 3008 | here to get some events. */ | ||
| 3009 | x_sync (f); | ||
| 3005 | SET_FRAME_GARBAGED (f); | 3010 | SET_FRAME_GARBAGED (f); |
| 3006 | cancel_mouse_face (f); | 3011 | cancel_mouse_face (f); |
| 3007 | } | 3012 | } |
diff --git a/src/keyboard.c b/src/keyboard.c index 3fa6240381e..fcc35cb1235 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1335,6 +1335,11 @@ DEFUN ("top-level", Ftop_level, Stop_level, 0, 0, "", | |||
| 1335 | cancel_hourglass (); | 1335 | cancel_hourglass (); |
| 1336 | #endif | 1336 | #endif |
| 1337 | 1337 | ||
| 1338 | /* Unblock input if we enter with input blocked. This may happen if | ||
| 1339 | redisplay traps e.g. during tool-bar update with input blocked. */ | ||
| 1340 | while (INPUT_BLOCKED_P) | ||
| 1341 | UNBLOCK_INPUT; | ||
| 1342 | |||
| 1338 | return Fthrow (Qtop_level, Qnil); | 1343 | return Fthrow (Qtop_level, Qnil); |
| 1339 | } | 1344 | } |
| 1340 | 1345 | ||
| @@ -9780,6 +9785,15 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ | |||
| 9780 | Lisp_Object saved_keys, saved_last_point_position_buffer; | 9785 | Lisp_Object saved_keys, saved_last_point_position_buffer; |
| 9781 | Lisp_Object bindings, value; | 9786 | Lisp_Object bindings, value; |
| 9782 | struct gcpro gcpro1, gcpro2, gcpro3; | 9787 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 9788 | #ifdef HAVE_X_WINDOWS | ||
| 9789 | /* The call to Fcompleting_read wil start and cancel the hourglass, | ||
| 9790 | but if the hourglass was already scheduled, this means that no | ||
| 9791 | hourglass will be shown for the actual M-x command itself. | ||
| 9792 | So we restart it if it is already scheduled. Note that checking | ||
| 9793 | hourglass_shown_p is not enough, normally the hourglass is not shown, | ||
| 9794 | just scheduled to be shown. */ | ||
| 9795 | int hstarted = hourglass_started (); | ||
| 9796 | #endif | ||
| 9783 | 9797 | ||
| 9784 | saved_keys = Fvector (this_command_key_count, | 9798 | saved_keys = Fvector (this_command_key_count, |
| 9785 | XVECTOR (this_command_keys)->contents); | 9799 | XVECTOR (this_command_keys)->contents); |
| @@ -9811,6 +9825,10 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ | |||
| 9811 | Qt, Qnil, Qextended_command_history, Qnil, | 9825 | Qt, Qnil, Qextended_command_history, Qnil, |
| 9812 | Qnil); | 9826 | Qnil); |
| 9813 | 9827 | ||
| 9828 | #ifdef HAVE_X_WINDOWS | ||
| 9829 | if (hstarted) start_hourglass (); | ||
| 9830 | #endif | ||
| 9831 | |||
| 9814 | if (STRINGP (function) && SCHARS (function) == 0) | 9832 | if (STRINGP (function) && SCHARS (function) == 0) |
| 9815 | error ("No command name given"); | 9833 | error ("No command name given"); |
| 9816 | 9834 | ||
diff --git a/src/macterm.c b/src/macterm.c index a98d4ae5eb4..a6039dbf5c6 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -8451,19 +8451,23 @@ main (void) | |||
| 8451 | #endif | 8451 | #endif |
| 8452 | 8452 | ||
| 8453 | /* Table for translating Mac keycode to X keysym values. Contributed | 8453 | /* Table for translating Mac keycode to X keysym values. Contributed |
| 8454 | by Sudhir Shenoy. */ | 8454 | by Sudhir Shenoy. |
| 8455 | Mapping for special keys is now identical to that in Apple X11 | ||
| 8456 | except `clear' (-> <clear>) on the KeyPad, `enter' (-> <kp-enter>) | ||
| 8457 | on the right of the Cmd key on laptops, and fn + `enter' (-> | ||
| 8458 | <linefeed>). */ | ||
| 8455 | static unsigned char keycode_to_xkeysym_table[] = { | 8459 | static unsigned char keycode_to_xkeysym_table[] = { |
| 8456 | /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 8460 | /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 8457 | /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 8461 | /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 8458 | /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 8462 | /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 8459 | 8463 | ||
| 8460 | /*0x30*/ 0x09 /*tab*/, 0 /*0x0020 space*/, 0, 0x08 /*backspace*/, | 8464 | /*0x30*/ 0x09 /*tab*/, 0 /*0x0020 space*/, 0, 0x08 /*backspace*/, |
| 8461 | /*0x34*/ 0, 0x1b /*escape*/, 0, 0, | 8465 | /*0x34*/ 0x8d /*enter on laptops*/, 0x1b /*escape*/, 0, 0, |
| 8462 | /*0x38*/ 0, 0, 0, 0, | 8466 | /*0x38*/ 0, 0, 0, 0, |
| 8463 | /*0x3C*/ 0, 0, 0, 0, | 8467 | /*0x3C*/ 0, 0, 0, 0, |
| 8464 | 8468 | ||
| 8465 | /*0x40*/ 0, 0xae /*kp-.*/, 0, 0xaa /*kp-**/, | 8469 | /*0x40*/ 0, 0xae /*kp-.*/, 0, 0xaa /*kp-**/, |
| 8466 | /*0x44*/ 0, 0xab /*kp-+*/, 0, 0x7f /*kp-clear*/, | 8470 | /*0x44*/ 0, 0xab /*kp-+*/, 0, 0x0b /*clear*/, |
| 8467 | /*0x48*/ 0, 0, 0, 0xaf /*kp-/*/, | 8471 | /*0x48*/ 0, 0, 0, 0xaf /*kp-/*/, |
| 8468 | /*0x4C*/ 0x8d /*kp-enter*/, 0, 0xad /*kp--*/, 0, | 8472 | /*0x4C*/ 0x8d /*kp-enter*/, 0, 0xad /*kp--*/, 0, |
| 8469 | 8473 | ||
| @@ -8475,11 +8479,11 @@ static unsigned char keycode_to_xkeysym_table[] = { | |||
| 8475 | /*0x60*/ 0xc2 /*f5*/, 0xc3 /*f6*/, 0xc4 /*f7*/, 0xc0 /*f3*/, | 8479 | /*0x60*/ 0xc2 /*f5*/, 0xc3 /*f6*/, 0xc4 /*f7*/, 0xc0 /*f3*/, |
| 8476 | /*0x64*/ 0xc5 /*f8*/, 0xc6 /*f9*/, 0, 0xc8 /*f11*/, | 8480 | /*0x64*/ 0xc5 /*f8*/, 0xc6 /*f9*/, 0, 0xc8 /*f11*/, |
| 8477 | /*0x68*/ 0, 0xca /*f13*/, 0, 0xcb /*f14*/, | 8481 | /*0x68*/ 0, 0xca /*f13*/, 0, 0xcb /*f14*/, |
| 8478 | /*0x6C*/ 0, 0xc7 /*f10*/, 0, 0xc9 /*f12*/, | 8482 | /*0x6C*/ 0, 0xc7 /*f10*/, 0x0a /*fn+enter on laptops*/, 0xc9 /*f12*/, |
| 8479 | 8483 | ||
| 8480 | /*0x70*/ 0, 0xcc /*f15*/, 0x9e /*insert (or 0x6a==help)*/, 0x95 /*home*/, | 8484 | /*0x70*/ 0, 0xcc /*f15*/, 0x6a /*help*/, 0x50 /*home*/, |
| 8481 | /*0x74*/ 0x9a /*pgup*/, 0x9f /*delete*/, 0xc1 /*f4*/, 0x9c /*end*/, | 8485 | /*0x74*/ 0x55 /*pgup*/, 0xff /*delete*/, 0xc1 /*f4*/, 0x57 /*end*/, |
| 8482 | /*0x78*/ 0xbf /*f2*/, 0x9b /*pgdown*/, 0xbe /*f1*/, 0x51 /*left*/, | 8486 | /*0x78*/ 0xbf /*f2*/, 0x56 /*pgdown*/, 0xbe /*f1*/, 0x51 /*left*/, |
| 8483 | /*0x7C*/ 0x53 /*right*/, 0x54 /*down*/, 0x52 /*up*/, 0 | 8487 | /*0x7C*/ 0x53 /*right*/, 0x54 /*down*/, 0x52 /*up*/, 0 |
| 8484 | }; | 8488 | }; |
| 8485 | 8489 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 7f7e60e81b8..b08029b5b7f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1294,6 +1294,7 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) | |||
| 1294 | /* Note that we may overshoot because of invisible text. */ | 1294 | /* Note that we may overshoot because of invisible text. */ |
| 1295 | if (IT_CHARPOS (it) >= charpos) | 1295 | if (IT_CHARPOS (it) >= charpos) |
| 1296 | { | 1296 | { |
| 1297 | int top_x = it.current_x; | ||
| 1297 | int top_y = it.current_y; | 1298 | int top_y = it.current_y; |
| 1298 | int bottom_y = (last_height = 0, line_bottom_y (&it)); | 1299 | int bottom_y = (last_height = 0, line_bottom_y (&it)); |
| 1299 | int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w); | 1300 | int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w); |
| @@ -1302,15 +1303,12 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) | |||
| 1302 | visible_p = bottom_y > window_top_y; | 1303 | visible_p = bottom_y > window_top_y; |
| 1303 | else if (top_y < it.last_visible_y) | 1304 | else if (top_y < it.last_visible_y) |
| 1304 | visible_p = 1; | 1305 | visible_p = 1; |
| 1305 | if (visible_p && x) | 1306 | if (visible_p) |
| 1306 | { | 1307 | { |
| 1307 | *x = it.current_x; | 1308 | *x = top_x; |
| 1308 | *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y); | 1309 | *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y); |
| 1309 | if (rtop) | 1310 | *rtop = max (0, window_top_y - top_y); |
| 1310 | { | 1311 | *rbot = max (0, bottom_y - it.last_visible_y); |
| 1311 | *rtop = max (0, window_top_y - top_y); | ||
| 1312 | *rbot = max (0, bottom_y - it.last_visible_y); | ||
| 1313 | } | ||
| 1314 | } | 1312 | } |
| 1315 | } | 1313 | } |
| 1316 | else | 1314 | else |
| @@ -1323,18 +1321,12 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) | |||
| 1323 | if (charpos < IT_CHARPOS (it)) | 1321 | if (charpos < IT_CHARPOS (it)) |
| 1324 | { | 1322 | { |
| 1325 | visible_p = 1; | 1323 | visible_p = 1; |
| 1326 | if (x) | 1324 | move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS); |
| 1327 | { | 1325 | *x = it2.current_x; |
| 1328 | move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS); | 1326 | *y = it2.current_y + it2.max_ascent - it2.ascent; |
| 1329 | *x = it2.current_x; | 1327 | *rtop = max (0, -it2.current_y); |
| 1330 | *y = it2.current_y + it2.max_ascent - it2.ascent; | 1328 | *rbot = max (0, ((it2.current_y + it2.max_ascent + it2.max_descent) |
| 1331 | if (rtop) | 1329 | - it.last_visible_y)); |
| 1332 | { | ||
| 1333 | *rtop = max (0, -it2.current_y); | ||
| 1334 | *rbot = max (0, ((it2.current_y + it2.max_ascent + it2.max_descent) | ||
| 1335 | - it.last_visible_y)); | ||
| 1336 | } | ||
| 1337 | } | ||
| 1338 | } | 1330 | } |
| 1339 | } | 1331 | } |
| 1340 | 1332 | ||
diff --git a/src/xfns.c b/src/xfns.c index db2e3f74045..4c9b38d2556 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1969,6 +1969,88 @@ static XIMStyle supported_xim_styles[] = | |||
| 1969 | 1969 | ||
| 1970 | /* Create an X fontset on frame F with base font name BASE_FONTNAME. */ | 1970 | /* Create an X fontset on frame F with base font name BASE_FONTNAME. */ |
| 1971 | 1971 | ||
| 1972 | char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*"; | ||
| 1973 | |||
| 1974 | char * | ||
| 1975 | xic_create_fontsetname (base_fontname) | ||
| 1976 | char *base_fontname; | ||
| 1977 | { | ||
| 1978 | /* Make a fontset name from the base font name. */ | ||
| 1979 | if (xic_defaut_fontset == base_fontname) | ||
| 1980 | /* There is no base font name, use the default. */ | ||
| 1981 | return base_fontname; | ||
| 1982 | else | ||
| 1983 | { | ||
| 1984 | /* Make a fontset name from the base font name. | ||
| 1985 | The font set will be made of the following elements: | ||
| 1986 | - the base font. | ||
| 1987 | - the base font where the charset spec is replaced by -*-*. | ||
| 1988 | - the same but with the family also replaced with -*-*-. */ | ||
| 1989 | char *p = base_fontname; | ||
| 1990 | char *fontsetname; | ||
| 1991 | int i; | ||
| 1992 | |||
| 1993 | for (i = 0; *p; p++) | ||
| 1994 | if (*p == '-') i++; | ||
| 1995 | if (i != 14) | ||
| 1996 | { /* As the font name doesn't conform to XLFD, we can't | ||
| 1997 | modify it to generalize it to allcs and allfamilies. | ||
| 1998 | Use the specified font plus the default. */ | ||
| 1999 | int len = strlen (base_fontname) + strlen (xic_defaut_fontset) + 2; | ||
| 2000 | fontsetname = xmalloc (len); | ||
| 2001 | bzero (fontsetname, len); | ||
| 2002 | strcpy (fontsetname, base_fontname); | ||
| 2003 | strcat (fontsetname, ","); | ||
| 2004 | strcat (fontsetname, xic_defaut_fontset); | ||
| 2005 | } | ||
| 2006 | else | ||
| 2007 | { | ||
| 2008 | int len; | ||
| 2009 | char *p1 = NULL; | ||
| 2010 | char *font_allcs = NULL; | ||
| 2011 | char *font_allfamilies = NULL; | ||
| 2012 | char *allcs = "*-*-*-*-*-*-*"; | ||
| 2013 | char *allfamilies = "-*-*-"; | ||
| 2014 | |||
| 2015 | for (i = 0, p = base_fontname; i < 8; p++) | ||
| 2016 | { | ||
| 2017 | if (*p == '-') | ||
| 2018 | { | ||
| 2019 | i++; | ||
| 2020 | if (i == 3) | ||
| 2021 | p1 = p + 1; | ||
| 2022 | } | ||
| 2023 | } | ||
| 2024 | /* Build the font spec that matches all charsets. */ | ||
| 2025 | len = p - base_fontname + strlen (allcs) + 1; | ||
| 2026 | font_allcs = (char *) alloca (len); | ||
| 2027 | bzero (font_allcs, len); | ||
| 2028 | bcopy (base_fontname, font_allcs, p - base_fontname); | ||
| 2029 | strcat (font_allcs, allcs); | ||
| 2030 | |||
| 2031 | /* Build the font spec that matches all families. */ | ||
| 2032 | len = p - p1 + strlen (allcs) + strlen (allfamilies) + 1; | ||
| 2033 | font_allfamilies = (char *) alloca (len); | ||
| 2034 | bzero (font_allfamilies, len); | ||
| 2035 | strcpy (font_allfamilies, allfamilies); | ||
| 2036 | bcopy (p1, font_allfamilies + (strlen (allfamilies)), p - p1); | ||
| 2037 | strcat (font_allfamilies, allcs); | ||
| 2038 | |||
| 2039 | /* Build the actual font set name. */ | ||
| 2040 | len = strlen (base_fontname) + strlen (font_allcs) | ||
| 2041 | + strlen (font_allfamilies) + 3; | ||
| 2042 | fontsetname = xmalloc (len); | ||
| 2043 | bzero (fontsetname, len); | ||
| 2044 | strcpy (fontsetname, base_fontname); | ||
| 2045 | strcat (fontsetname, ","); | ||
| 2046 | strcat (fontsetname, font_allcs); | ||
| 2047 | strcat (fontsetname, ","); | ||
| 2048 | strcat (fontsetname, font_allfamilies); | ||
| 2049 | } | ||
| 2050 | return fontsetname; | ||
| 2051 | } | ||
| 2052 | } | ||
| 2053 | |||
| 1972 | static XFontSet | 2054 | static XFontSet |
| 1973 | xic_create_xfontset (f, base_fontname) | 2055 | xic_create_xfontset (f, base_fontname) |
| 1974 | struct frame *f; | 2056 | struct frame *f; |
| @@ -1980,6 +2062,9 @@ xic_create_xfontset (f, base_fontname) | |||
| 1980 | char *def_string; | 2062 | char *def_string; |
| 1981 | Lisp_Object rest, frame; | 2063 | Lisp_Object rest, frame; |
| 1982 | 2064 | ||
| 2065 | if (!base_fontname) | ||
| 2066 | base_fontname = xic_defaut_fontset; | ||
| 2067 | |||
| 1983 | /* See if there is another frame already using same fontset. */ | 2068 | /* See if there is another frame already using same fontset. */ |
| 1984 | FOR_EACH_FRAME (rest, frame) | 2069 | FOR_EACH_FRAME (rest, frame) |
| 1985 | { | 2070 | { |
| @@ -1996,12 +2081,16 @@ xic_create_xfontset (f, base_fontname) | |||
| 1996 | 2081 | ||
| 1997 | if (!xfs) | 2082 | if (!xfs) |
| 1998 | { | 2083 | { |
| 2084 | char *fontsetname = xic_create_fontsetname (base_fontname); | ||
| 2085 | |||
| 1999 | /* New fontset. */ | 2086 | /* New fontset. */ |
| 2000 | xfs = XCreateFontSet (FRAME_X_DISPLAY (f), | 2087 | xfs = XCreateFontSet (FRAME_X_DISPLAY (f), |
| 2001 | base_fontname, &missing_list, | 2088 | fontsetname, &missing_list, |
| 2002 | &missing_count, &def_string); | 2089 | &missing_count, &def_string); |
| 2003 | if (missing_list) | 2090 | if (missing_list) |
| 2004 | XFreeStringList (missing_list); | 2091 | XFreeStringList (missing_list); |
| 2092 | if (fontsetname != base_fontname) | ||
| 2093 | xfree (fontsetname); | ||
| 2005 | } | 2094 | } |
| 2006 | 2095 | ||
| 2007 | if (FRAME_XIC_BASE_FONTNAME (f)) | 2096 | if (FRAME_XIC_BASE_FONTNAME (f)) |
| @@ -2083,6 +2172,11 @@ create_frame_xic (f) | |||
| 2083 | if (FRAME_XIC (f)) | 2172 | if (FRAME_XIC (f)) |
| 2084 | return; | 2173 | return; |
| 2085 | 2174 | ||
| 2175 | /* Create X fontset. */ | ||
| 2176 | xfs = xic_create_xfontset | ||
| 2177 | (f, (FRAME_FONTSET (f) < 0) ? NULL | ||
| 2178 | : (char *) SDATA (fontset_ascii (FRAME_FONTSET (f)))); | ||
| 2179 | |||
| 2086 | xim = FRAME_X_XIM (f); | 2180 | xim = FRAME_X_XIM (f); |
| 2087 | if (xim) | 2181 | if (xim) |
| 2088 | { | 2182 | { |
| @@ -2090,52 +2184,9 @@ create_frame_xic (f) | |||
| 2090 | XPoint spot; | 2184 | XPoint spot; |
| 2091 | XVaNestedList preedit_attr; | 2185 | XVaNestedList preedit_attr; |
| 2092 | XVaNestedList status_attr; | 2186 | XVaNestedList status_attr; |
| 2093 | char *base_fontname; | ||
| 2094 | int fontset; | ||
| 2095 | 2187 | ||
| 2096 | s_area.x = 0; s_area.y = 0; s_area.width = 1; s_area.height = 1; | 2188 | s_area.x = 0; s_area.y = 0; s_area.width = 1; s_area.height = 1; |
| 2097 | spot.x = 0; spot.y = 1; | 2189 | spot.x = 0; spot.y = 1; |
| 2098 | /* Create X fontset. */ | ||
| 2099 | fontset = FRAME_FONTSET (f); | ||
| 2100 | if (fontset < 0) | ||
| 2101 | base_fontname = "-*-*-*-r-normal--14-*-*-*-*-*-*-*"; | ||
| 2102 | else | ||
| 2103 | { | ||
| 2104 | /* Determine the base fontname from the ASCII font name of | ||
| 2105 | FONTSET. */ | ||
| 2106 | char *ascii_font = (char *) SDATA (fontset_ascii (fontset)); | ||
| 2107 | char *p = ascii_font; | ||
| 2108 | int i; | ||
| 2109 | |||
| 2110 | for (i = 0; *p; p++) | ||
| 2111 | if (*p == '-') i++; | ||
| 2112 | if (i != 14) | ||
| 2113 | /* As the font name doesn't conform to XLFD, we can't | ||
| 2114 | modify it to get a suitable base fontname for the | ||
| 2115 | frame. */ | ||
| 2116 | base_fontname = "-*-*-*-r-normal--14-*-*-*-*-*-*-*"; | ||
| 2117 | else | ||
| 2118 | { | ||
| 2119 | int len = strlen (ascii_font) + 1; | ||
| 2120 | char *p1 = NULL; | ||
| 2121 | |||
| 2122 | for (i = 0, p = ascii_font; i < 8; p++) | ||
| 2123 | { | ||
| 2124 | if (*p == '-') | ||
| 2125 | { | ||
| 2126 | i++; | ||
| 2127 | if (i == 3) | ||
| 2128 | p1 = p + 1; | ||
| 2129 | } | ||
| 2130 | } | ||
| 2131 | base_fontname = (char *) alloca (len); | ||
| 2132 | bzero (base_fontname, len); | ||
| 2133 | strcpy (base_fontname, "-*-*-"); | ||
| 2134 | bcopy (p1, base_fontname + 5, p - p1); | ||
| 2135 | strcat (base_fontname, "*-*-*-*-*-*-*"); | ||
| 2136 | } | ||
| 2137 | } | ||
| 2138 | xfs = xic_create_xfontset (f, base_fontname); | ||
| 2139 | 2190 | ||
| 2140 | /* Determine XIC style. */ | 2191 | /* Determine XIC style. */ |
| 2141 | if (xic_style == 0) | 2192 | if (xic_style == 0) |
| @@ -4310,6 +4361,14 @@ static Lisp_Object Vhourglass_delay; | |||
| 4310 | static void show_hourglass P_ ((struct atimer *)); | 4361 | static void show_hourglass P_ ((struct atimer *)); |
| 4311 | static void hide_hourglass P_ ((void)); | 4362 | static void hide_hourglass P_ ((void)); |
| 4312 | 4363 | ||
| 4364 | /* Return non-zero if houglass timer has been started or hourglass is shown. */ | ||
| 4365 | |||
| 4366 | int | ||
| 4367 | hourglass_started () | ||
| 4368 | { | ||
| 4369 | return hourglass_shown_p || hourglass_atimer != NULL; | ||
| 4370 | } | ||
| 4371 | |||
| 4313 | 4372 | ||
| 4314 | /* Cancel a currently active hourglass timer, and start a new one. */ | 4373 | /* Cancel a currently active hourglass timer, and start a new one. */ |
| 4315 | 4374 | ||
diff --git a/src/xmenu.c b/src/xmenu.c index b6a5186f1f1..41c1c2fe078 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* X Communication module for terminals which understand the X protocol. | 1 | /* X Communication module for terminals which understand the X protocol. |
| 2 | Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2003, 2004 | 2 | Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2003, 2004, |
| 3 | Free Software Foundation, Inc. | 3 | 2005 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -138,12 +138,7 @@ static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **)); | |||
| 138 | /* gtk just uses utf-8. */ | 138 | /* gtk just uses utf-8. */ |
| 139 | # define ENCODE_MENU_STRING(str) ENCODE_UTF_8 (str) | 139 | # define ENCODE_MENU_STRING(str) ENCODE_UTF_8 (str) |
| 140 | #else | 140 | #else |
| 141 | /* I'm not convinced ENCODE_SYSTEM is defined correctly, or maybe | 141 | # define ENCODE_MENU_STRING(str) string_make_unibyte (str) |
| 142 | something else should be used here. Except under MS-Windows it | ||
| 143 | just converts to unibyte, but encoding with `locale-coding-system' | ||
| 144 | seems better -- X may actually display the result correctly, and | ||
| 145 | it's not necessarily equivalent to the unibyte text. -- fx */ | ||
| 146 | # define ENCODE_MENU_STRING(str) ENCODE_SYSTEM (str) | ||
| 147 | #endif | 142 | #endif |
| 148 | 143 | ||
| 149 | static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, | 144 | static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, |
| @@ -645,10 +640,10 @@ list_of_panes (menu) | |||
| 645 | 640 | ||
| 646 | init_menu_items (); | 641 | init_menu_items (); |
| 647 | 642 | ||
| 648 | for (tail = menu; !NILP (tail); tail = Fcdr (tail)) | 643 | for (tail = menu; CONSP (tail); tail = XCDR (tail)) |
| 649 | { | 644 | { |
| 650 | Lisp_Object elt, pane_name, pane_data; | 645 | Lisp_Object elt, pane_name, pane_data; |
| 651 | elt = Fcar (tail); | 646 | elt = XCAR (tail); |
| 652 | pane_name = Fcar (elt); | 647 | pane_name = Fcar (elt); |
| 653 | CHECK_STRING (pane_name); | 648 | CHECK_STRING (pane_name); |
| 654 | push_menu_pane (ENCODE_MENU_STRING (pane_name), Qnil); | 649 | push_menu_pane (ENCODE_MENU_STRING (pane_name), Qnil); |
| @@ -668,22 +663,22 @@ list_of_items (pane) | |||
| 668 | { | 663 | { |
| 669 | Lisp_Object tail, item, item1; | 664 | Lisp_Object tail, item, item1; |
| 670 | 665 | ||
| 671 | for (tail = pane; !NILP (tail); tail = Fcdr (tail)) | 666 | for (tail = pane; CONSP (tail); tail = XCDR (tail)) |
| 672 | { | 667 | { |
| 673 | item = Fcar (tail); | 668 | item = XCAR (tail); |
| 674 | if (STRINGP (item)) | 669 | if (STRINGP (item)) |
| 675 | push_menu_item (ENCODE_MENU_STRING (item), Qnil, Qnil, Qt, | 670 | push_menu_item (ENCODE_MENU_STRING (item), Qnil, Qnil, Qt, |
| 676 | Qnil, Qnil, Qnil, Qnil); | 671 | Qnil, Qnil, Qnil, Qnil); |
| 677 | else if (NILP (item)) | 672 | else if (CONSP (item)) |
| 678 | push_left_right_boundary (); | ||
| 679 | else | ||
| 680 | { | 673 | { |
| 681 | CHECK_CONS (item); | 674 | item1 = XCAR (item); |
| 682 | item1 = Fcar (item); | ||
| 683 | CHECK_STRING (item1); | 675 | CHECK_STRING (item1); |
| 684 | push_menu_item (ENCODE_MENU_STRING (item1), Qt, Fcdr (item), | 676 | push_menu_item (ENCODE_MENU_STRING (item1), Qt, XCDR (item), |
| 685 | Qt, Qnil, Qnil, Qnil, Qnil); | 677 | Qt, Qnil, Qnil, Qnil, Qnil); |
| 686 | } | 678 | } |
| 679 | else | ||
| 680 | push_left_right_boundary (); | ||
| 681 | |||
| 687 | } | 682 | } |
| 688 | } | 683 | } |
| 689 | 684 | ||
| @@ -802,8 +797,8 @@ cached information about equivalent key sequences. */) | |||
| 802 | if (CONSP (tem)) | 797 | if (CONSP (tem)) |
| 803 | { | 798 | { |
| 804 | window = Fcar (Fcdr (position)); | 799 | window = Fcar (Fcdr (position)); |
| 805 | x = Fcar (tem); | 800 | x = XCAR (tem); |
| 806 | y = Fcar (Fcdr (tem)); | 801 | y = Fcar (XCDR (tem)); |
| 807 | } | 802 | } |
| 808 | else | 803 | else |
| 809 | { | 804 | { |
| @@ -931,11 +926,11 @@ cached information about equivalent key sequences. */) | |||
| 931 | 926 | ||
| 932 | /* The first keymap that has a prompt string | 927 | /* The first keymap that has a prompt string |
| 933 | supplies the menu title. */ | 928 | supplies the menu title. */ |
| 934 | for (tem = menu, i = 0; CONSP (tem); tem = Fcdr (tem)) | 929 | for (tem = menu, i = 0; CONSP (tem); tem = XCDR (tem)) |
| 935 | { | 930 | { |
| 936 | Lisp_Object prompt; | 931 | Lisp_Object prompt; |
| 937 | 932 | ||
| 938 | maps[i++] = keymap = get_keymap (Fcar (tem), 1, 0); | 933 | maps[i++] = keymap = get_keymap (XCAR (tem), 1, 0); |
| 939 | 934 | ||
| 940 | prompt = Fkeymap_prompt (keymap); | 935 | prompt = Fkeymap_prompt (keymap); |
| 941 | if (NILP (title) && !NILP (prompt)) | 936 | if (NILP (title) && !NILP (prompt)) |
| @@ -1750,7 +1745,7 @@ digest_single_submenu (start, end, top_level_items) | |||
| 1750 | #ifndef HAVE_MULTILINGUAL_MENU | 1745 | #ifndef HAVE_MULTILINGUAL_MENU |
| 1751 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) | 1746 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) |
| 1752 | { | 1747 | { |
| 1753 | pane_name = ENCODE_SYSTEM (pane_name); | 1748 | pane_name = ENCODE_MENU_STRING (pane_name); |
| 1754 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; | 1749 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; |
| 1755 | } | 1750 | } |
| 1756 | #endif | 1751 | #endif |
| @@ -2695,7 +2690,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2695 | #ifndef HAVE_MULTILINGUAL_MENU | 2690 | #ifndef HAVE_MULTILINGUAL_MENU |
| 2696 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) | 2691 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) |
| 2697 | { | 2692 | { |
| 2698 | pane_name = ENCODE_SYSTEM (pane_name); | 2693 | pane_name = ENCODE_MENU_STRING (pane_name); |
| 2699 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; | 2694 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; |
| 2700 | } | 2695 | } |
| 2701 | #endif | 2696 | #endif |