aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2004-09-09 09:36:36 +0000
committerMiles Bader2004-09-09 09:36:36 +0000
commita37d67ddadebe7cbcf6d5c5d2f5f4004797a32eb (patch)
tree06645beecd1ea81b98569d82ee5d486a95c3497f /src
parentdd6ab82fb5c85168043306deda1fa5a5010183c6 (diff)
parent6cb4a8923202a1f00fcbd2f7e3b8e0ee9e9bd3f4 (diff)
downloademacs-a37d67ddadebe7cbcf6d5c5d2f5f4004797a32eb.tar.gz
emacs-a37d67ddadebe7cbcf6d5c5d2f5f4004797a32eb.zip
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-36
Merge from emacs--cvs-trunk--0, emacs--gnus--5.10, gnus--rel--5.10 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523 Merge from emacs--gnus--5.10, gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-524 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-534 Update from CVS * miles@gnu.org--gnu-2004/emacs--gnus--5.10--base-0 tag of miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-1 Import from CVS branch gnus-5_10-branch * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-2 Merge from lorentey@elte.hu--2004/emacs--multi-tty--0, emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-3 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-4 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-18 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-19 Remove autoconf-generated files from archive * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-20 Update from CVS
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog69
-rw-r--r--src/buffer.c10
-rw-r--r--src/buffer.h3
-rw-r--r--src/fileio.c14
-rw-r--r--src/minibuf.c11
-rw-r--r--src/w32fns.c32
-rw-r--r--src/w32menu.c5
-rw-r--r--src/w32term.h5
-rw-r--r--src/window.c4
-rw-r--r--src/xdisp.c39
-rw-r--r--src/xmenu.c8
11 files changed, 151 insertions, 49 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8fd72a29c29..52426939562 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,6 +1,53 @@
12004-09-08 Richard M. Stallman <rms@gnu.org>
2
3 * window.c (Fset_window_buffer): Doc fix.
4
5 * xdisp.c (Fformat_mode_line): New arg BUFFER says which buffer to use.
6
72004-09-08 Dan Nicolaescu <dann@ics.uci.edu>
8
9 * minibuf.c (history_delete_duplicates): New variable.
10 (read_minibuf): Use it.
11 (syms_of_minibuf): Create the corresponding lisp variable.
12
132004-09-08 Kim F. Storm <storm@cua.dk>
14
15 * xdisp.c (set_cursor_from_row): Also look at 'cursor' property in
16 overlay just before point.
17
182004-09-07 Luc Teirlinck <teirllm@auburn.edu>
19
20 * buffer.h (struct buffer): Add auto_save_file_format field.
21 * buffer.c (reset_buffer, init_buffer_once): Handle
22 auto_save_file_format field.
23 (syms_of_buffer): Add DEFVAR_PER_BUFFER for
24 `buffer-auto-save-file-format'.
25 * fileio.c: Delete declaration for removed Vauto_save_file_format.
26 (build_annotations): Adapt to replacement of
27 `auto-save-file-format' with the new buffer-local variable
28 `buffer-auto-save-file-format'.
29 (syms_of_fileio): Delete DEFVAR_LISP for auto-save-file-format.
30
312004-09-07 Jason Rumney <jasonr@gnu.org>
32
33 * w32term.h (AppendMenuW_Proc): Move declaration from w32menu.c.
34
35 * w32fns.c (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
36 Unicode menu titles.
37
382004-09-07 Kim F. Storm <storm@cua.dk>
39
40 * xdisp.c (set_cursor_from_row): Fix last change. Only use 'cursor'
41 property from text property or overlay strings at point.
42
432004-09-07 Stefan <monnier@iro.umontreal.ca>
44
45 * xmenu.c (update_submenu_strings): YAILOM.
46 (set_frame_menubar): Make sure last_i is initialized.
47
12004-09-03 Jason Rumney <jasonr@gnu.org> 482004-09-03 Jason Rumney <jasonr@gnu.org>
2 49
3 * w32menu.c (_widget_value): Added lname and lkey. 50 * w32menu.c (_widget_value): Add lname and lkey.
4 (digest_single_submenu): Set lname and lkey in widget_value 51 (digest_single_submenu): Set lname and lkey in widget_value
5 instead of name and key. 52 instead of name and key.
6 (update_submenu_strings): New function. 53 (update_submenu_strings): New function.
@@ -12,7 +59,7 @@
12 UTF-8 if Unicode API is available. 59 UTF-8 if Unicode API is available.
13 (utf8to16): New function. 60 (utf8to16): New function.
14 (add_menu_item): Use it when calling Unicode API. 61 (add_menu_item): Use it when calling Unicode API.
15 62
162004-09-03 Kim F. Storm <storm@cua.dk> 632004-09-03 Kim F. Storm <storm@cua.dk>
17 64
18 * xdisp.c (set_cursor_from_row): Look for non-nil `cursor' property 65 * xdisp.c (set_cursor_from_row): Look for non-nil `cursor' property
@@ -22,14 +69,14 @@
222004-09-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 692004-09-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23 70
24 * macfns.c (x_real_positions): Save the current window port and 71 * macfns.c (x_real_positions): Save the current window port and
25 set a new one before obtaining the global coordinate. Use 72 set a new one before obtaining the global coordinate.
26 FRAME_MAC_WINDOW. 73 Use FRAME_MAC_WINDOW.
27 (x_set_name, x_set_title): Encode title to UTF8. Use 74 (x_set_name, x_set_title): Encode title to UTF8.
28 SetWindowTitleWithCFString. 75 Use SetWindowTitleWithCFString.
29 (Fx_server_version): Get correct OS version. 76 (Fx_server_version): Get correct OS version.
30 77
31 * macmenu.c (add_menu_item): Remove unused variable `i'. Don't 78 * macmenu.c (add_menu_item): Remove unused variable `i'.
32 let separator items destroy refence constants of other menu items. 79 Don't let separator items destroy refence constants of other menu items.
33 80
34 * macterm.c (x_update_end): Move SetPortWindowPort to inside 81 * macterm.c (x_update_end): Move SetPortWindowPort to inside
35 BLOCK_INPUT. 82 BLOCK_INPUT.
@@ -40,8 +87,8 @@
40 87
41 * s/darwin.h (LIBS_CARBON): New define to specify libraries for 88 * s/darwin.h (LIBS_CARBON): New define to specify libraries for
42 Carbon support. 89 Carbon support.
43 (LD_SWITCH_SYSTEM_TEMACS): Don't link with unused libstdc++. Use 90 (LD_SWITCH_SYSTEM_TEMACS): Don't link with unused libstdc++.
44 LIBS_CARBON. 91 Use LIBS_CARBON.
45 92
462004-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 932004-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
47 94
@@ -56,7 +103,7 @@
56 103
572004-08-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 1042004-08-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
58 105
59 * macmenu.c (_widget_value): Added lname and lkey. 106 * macmenu.c (_widget_value): Add lname and lkey.
60 (single_submenu): Set lname and lkey in widget_value 107 (single_submenu): Set lname and lkey in widget_value
61 instead of name and key. 108 instead of name and key.
62 (update_submenu_strings): New function. 109 (update_submenu_strings): New function.
diff --git a/src/buffer.c b/src/buffer.c
index bae964bc139..2084d80049a 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -695,6 +695,7 @@ reset_buffer (b)
695 b->mark_active = Qnil; 695 b->mark_active = Qnil;
696 b->point_before_scroll = Qnil; 696 b->point_before_scroll = Qnil;
697 b->file_format = Qnil; 697 b->file_format = Qnil;
698 b->auto_save_file_format = Qt;
698 b->last_selected_window = Qnil; 699 b->last_selected_window = Qnil;
699 XSETINT (b->display_count, 0); 700 XSETINT (b->display_count, 0);
700 b->display_time = Qnil; 701 b->display_time = Qnil;
@@ -4978,6 +4979,7 @@ init_buffer_once ()
4978 buffer_defaults.undo_list = Qnil; 4979 buffer_defaults.undo_list = Qnil;
4979 buffer_defaults.mark_active = Qnil; 4980 buffer_defaults.mark_active = Qnil;
4980 buffer_defaults.file_format = Qnil; 4981 buffer_defaults.file_format = Qnil;
4982 buffer_defaults.auto_save_file_format = Qt;
4981 buffer_defaults.overlays_before = NULL; 4983 buffer_defaults.overlays_before = NULL;
4982 buffer_defaults.overlays_after = NULL; 4984 buffer_defaults.overlays_after = NULL;
4983 buffer_defaults.overlay_center = BEG; 4985 buffer_defaults.overlay_center = BEG;
@@ -5036,6 +5038,7 @@ init_buffer_once ()
5036 XSETINT (buffer_local_flags.file_truename, -1); 5038 XSETINT (buffer_local_flags.file_truename, -1);
5037 XSETINT (buffer_local_flags.invisibility_spec, -1); 5039 XSETINT (buffer_local_flags.invisibility_spec, -1);
5038 XSETINT (buffer_local_flags.file_format, -1); 5040 XSETINT (buffer_local_flags.file_format, -1);
5041 XSETINT (buffer_local_flags.auto_save_file_format, -1);
5039 XSETINT (buffer_local_flags.display_count, -1); 5042 XSETINT (buffer_local_flags.display_count, -1);
5040 XSETINT (buffer_local_flags.display_time, -1); 5043 XSETINT (buffer_local_flags.display_time, -1);
5041 XSETINT (buffer_local_flags.enable_multibyte_characters, -1); 5044 XSETINT (buffer_local_flags.enable_multibyte_characters, -1);
@@ -5846,6 +5849,13 @@ functions; it should only affect their performance. */);
5846Formats are defined by `format-alist'. This variable is 5849Formats are defined by `format-alist'. This variable is
5847set when a file is visited. */); 5850set when a file is visited. */);
5848 5851
5852 DEFVAR_PER_BUFFER ("buffer-auto-save-file-format",
5853 &current_buffer->auto_save_file_format, Qnil,
5854 doc: /* *Format in which to write auto-save files.
5855Should be a list of symbols naming formats that are defined in `format-alist'.
5856If it is t, which is the default, auto-save files are written in the
5857same format as a regular save would use. */);
5858
5849 DEFVAR_PER_BUFFER ("buffer-invisibility-spec", 5859 DEFVAR_PER_BUFFER ("buffer-invisibility-spec",
5850 &current_buffer->invisibility_spec, Qnil, 5860 &current_buffer->invisibility_spec, Qnil,
5851 doc: /* Invisibility spec of this buffer. 5861 doc: /* Invisibility spec of this buffer.
diff --git a/src/buffer.h b/src/buffer.h
index 47f00560824..838ace7b18b 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -670,6 +670,9 @@ struct buffer
670 /* List of symbols naming the file format used for visited file. */ 670 /* List of symbols naming the file format used for visited file. */
671 Lisp_Object file_format; 671 Lisp_Object file_format;
672 672
673 /* List of symbols naming the file format used for auto-save file. */
674 Lisp_Object auto_save_file_format;
675
673 /* True if the newline position cache and width run cache are 676 /* True if the newline position cache and width run cache are
674 enabled. See search.c and indent.c. */ 677 enabled. See search.c and indent.c. */
675 Lisp_Object cache_long_line_scans; 678 Lisp_Object cache_long_line_scans;
diff --git a/src/fileio.c b/src/fileio.c
index 8290f01b58e..f3678cac0e5 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -173,9 +173,6 @@ Lisp_Object Vdefault_file_name_coding_system;
173 whose I/O is done with a special handler. */ 173 whose I/O is done with a special handler. */
174Lisp_Object Vfile_name_handler_alist; 174Lisp_Object Vfile_name_handler_alist;
175 175
176/* Format for auto-save files */
177Lisp_Object Vauto_save_file_format;
178
179/* Lisp functions for translating file formats */ 176/* Lisp functions for translating file formats */
180Lisp_Object Qformat_decode, Qformat_annotate_function; 177Lisp_Object Qformat_decode, Qformat_annotate_function;
181 178
@@ -5313,8 +5310,8 @@ build_annotations (start, end)
5313 } 5310 }
5314 5311
5315 /* Now do the same for annotation functions implied by the file-format */ 5312 /* Now do the same for annotation functions implied by the file-format */
5316 if (auto_saving && (!EQ (Vauto_save_file_format, Qt))) 5313 if (auto_saving && (!EQ (current_buffer->auto_save_file_format, Qt)))
5317 p = Vauto_save_file_format; 5314 p = current_buffer->auto_save_file_format;
5318 else 5315 else
5319 p = current_buffer->file_format; 5316 p = current_buffer->file_format;
5320 for (i = 0; CONSP (p); p = XCDR (p), ++i) 5317 for (i = 0; CONSP (p); p = XCDR (p), ++i)
@@ -6404,13 +6401,6 @@ instead use `file-name-coding-system' to get a constant encoding
6404of file names regardless of the current language environment. */); 6401of file names regardless of the current language environment. */);
6405 Vdefault_file_name_coding_system = Qnil; 6402 Vdefault_file_name_coding_system = Qnil;
6406 6403
6407 DEFVAR_LISP ("auto-save-file-format", &Vauto_save_file_format,
6408 doc: /* *Format in which to write auto-save files.
6409Should be a list of symbols naming formats that are defined in `format-alist'.
6410If it is t, which is the default, auto-save files are written in the
6411same format as a regular save would use. */);
6412 Vauto_save_file_format = Qt;
6413
6414 Qformat_decode = intern ("format-decode"); 6404 Qformat_decode = intern ("format-decode");
6415 staticpro (&Qformat_decode); 6405 staticpro (&Qformat_decode);
6416 Qformat_annotate_function = intern ("format-annotate-function"); 6406 Qformat_annotate_function = intern ("format-annotate-function");
diff --git a/src/minibuf.c b/src/minibuf.c
index 07b9a0d9c7a..6d9402942e6 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -61,6 +61,10 @@ Lisp_Object Vcompletion_auto_help;
61 61
62Lisp_Object Qhistory_length, Vhistory_length; 62Lisp_Object Qhistory_length, Vhistory_length;
63 63
64/* No duplicates in history. */
65
66int history_delete_duplicates;
67
64/* Fread_minibuffer leaves the input here as a string. */ 68/* Fread_minibuffer leaves the input here as a string. */
65 69
66Lisp_Object last_minibuf_string; 70Lisp_Object last_minibuf_string;
@@ -749,6 +753,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
749 { 753 {
750 Lisp_Object length; 754 Lisp_Object length;
751 755
756 if (history_delete_duplicates) Fdelete (histstring, histval);
752 histval = Fcons (histstring, histval); 757 histval = Fcons (histstring, histval);
753 Fset (Vminibuffer_history_variable, histval); 758 Fset (Vminibuffer_history_variable, histval);
754 759
@@ -2658,6 +2663,12 @@ just after a new element is inserted. Setting the history-length
2658property of a history variable overrides this default. */); 2663property of a history variable overrides this default. */);
2659 XSETFASTINT (Vhistory_length, 30); 2664 XSETFASTINT (Vhistory_length, 30);
2660 2665
2666 DEFVAR_BOOL ("history-delete-duplicates", &history_delete_duplicates,
2667 doc: /* *Non-nil means to delete duplicates in history.
2668If set to t when adding a new history element, all previous identical
2669elements are deleted. */);
2670 history_delete_duplicates = 0;
2671
2661 DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help, 2672 DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help,
2662 doc: /* *Non-nil means automatically provide help for invalid completion input. */); 2673 doc: /* *Non-nil means automatically provide help for invalid completion input. */);
2663 Vcompletion_auto_help = Qt; 2674 Vcompletion_auto_help = Qt;
diff --git a/src/w32fns.c b/src/w32fns.c
index d2231772bf4..2b613931a9c 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -261,6 +261,7 @@ typedef BOOL (WINAPI * TrackMouseEvent_Proc)
261 261
262TrackMouseEvent_Proc track_mouse_event_fn = NULL; 262TrackMouseEvent_Proc track_mouse_event_fn = NULL;
263ClipboardSequence_Proc clipboard_sequence_fn = NULL; 263ClipboardSequence_Proc clipboard_sequence_fn = NULL;
264extern AppendMenuW_Proc unicode_append_menu;
264 265
265/* W95 mousewheel handler */ 266/* W95 mousewheel handler */
266unsigned int msh_mousewheel = 0; 267unsigned int msh_mousewheel = 0;
@@ -3458,7 +3459,13 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
3458 pMis->itemHeight = GetSystemMetrics (SM_CYMENUSIZE); 3459 pMis->itemHeight = GetSystemMetrics (SM_CYMENUSIZE);
3459 if (title) 3460 if (title)
3460 { 3461 {
3461 GetTextExtentPoint32 (hdc, title, strlen (title), &size); 3462 if (unicode_append_menu)
3463 GetTextExtentPoint32W (hdc, (WCHAR *) title,
3464 wcslen ((WCHAR *) title),
3465 &size);
3466 else
3467 GetTextExtentPoint32 (hdc, title, strlen (title), &size);
3468
3462 pMis->itemWidth = size.cx; 3469 pMis->itemWidth = size.cx;
3463 if (pMis->itemHeight < size.cy) 3470 if (pMis->itemHeight < size.cy)
3464 pMis->itemHeight = size.cy; 3471 pMis->itemHeight = size.cy;
@@ -3496,13 +3503,22 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
3496 menu_font = CreateFontIndirect (&menu_logfont); 3503 menu_font = CreateFontIndirect (&menu_logfont);
3497 old_font = SelectObject (hdc, menu_font); 3504 old_font = SelectObject (hdc, menu_font);
3498 3505
3499 /* Always draw title as if not selected. */ 3506 /* Always draw title as if not selected. */
3500 ExtTextOut (hdc, 3507 if (unicode_append_menu)
3501 pDis->rcItem.left 3508 ExtTextOutW (hdc,
3502 + GetSystemMetrics (SM_CXMENUCHECK), 3509 pDis->rcItem.left
3503 pDis->rcItem.top, 3510 + GetSystemMetrics (SM_CXMENUCHECK),
3504 ETO_OPAQUE, &pDis->rcItem, 3511 pDis->rcItem.top,
3505 title, strlen (title), NULL); 3512 ETO_OPAQUE, &pDis->rcItem,
3513 (WCHAR *) title,
3514 wcslen ((WCHAR *) title), NULL);
3515 else
3516 ExtTextOut (hdc,
3517 pDis->rcItem.left
3518 + GetSystemMetrics (SM_CXMENUCHECK),
3519 pDis->rcItem.top,
3520 ETO_OPAQUE, &pDis->rcItem,
3521 title, strlen (title), NULL);
3506 3522
3507 SelectObject (hdc, old_font); 3523 SelectObject (hdc, old_font);
3508 DeleteObject (menu_font); 3524 DeleteObject (menu_font);
diff --git a/src/w32menu.c b/src/w32menu.c
index f3f3eb785b0..4553895d829 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -143,11 +143,6 @@ typedef BOOL (WINAPI * SetMenuItemInfoA_Proc) (
143 IN UINT, 143 IN UINT,
144 IN BOOL, 144 IN BOOL,
145 IN LPCMENUITEMINFOA); 145 IN LPCMENUITEMINFOA);
146typedef BOOL (WINAPI * AppendMenuW_Proc) (
147 IN HMENU,
148 IN UINT,
149 IN UINT_PTR,
150 IN LPCWSTR);
151 146
152GetMenuItemInfoA_Proc get_menu_item_info = NULL; 147GetMenuItemInfoA_Proc get_menu_item_info = NULL;
153SetMenuItemInfoA_Proc set_menu_item_info = NULL; 148SetMenuItemInfoA_Proc set_menu_item_info = NULL;
diff --git a/src/w32term.h b/src/w32term.h
index 524b1097c42..a25a3b49782 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -740,6 +740,11 @@ EXFUN (Fx_display_grayscale_p, 1);
740 ? BDF_1D_FONT : BDF_2D_FONT)) 740 ? BDF_1D_FONT : BDF_2D_FONT))
741 741
742typedef DWORD (WINAPI * ClipboardSequence_Proc) (); 742typedef DWORD (WINAPI * ClipboardSequence_Proc) ();
743typedef BOOL (WINAPI * AppendMenuW_Proc) (
744 IN HMENU,
745 IN UINT,
746 IN UINT_PTR,
747 IN LPCWSTR);
743 748
744/* arch-tag: f201d05a-1240-4fc5-8ea4-ca24d4ee5671 749/* arch-tag: f201d05a-1240-4fc5-8ea4-ca24d4ee5671
745 (do not change this comment) */ 750 (do not change this comment) */
diff --git a/src/window.c b/src/window.c
index c64902501db..e7246b7c657 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3057,7 +3057,9 @@ BUFFER can be a buffer or the name of an existing buffer.
3057Optional third arg KEEP-MARGINS non-nil means that WINDOW's current 3057Optional third arg KEEP-MARGINS non-nil means that WINDOW's current
3058display margins, fringe widths, and scroll bar settings are maintained; 3058display margins, fringe widths, and scroll bar settings are maintained;
3059the default is to reset these from BUFFER's local settings or the frame 3059the default is to reset these from BUFFER's local settings or the frame
3060defaults. */) 3060defaults.
3061
3062This function runs the hook `window-scroll-functions'. */)
3061 (window, buffer, keep_margins) 3063 (window, buffer, keep_margins)
3062 register Lisp_Object window, buffer, keep_margins; 3064 register Lisp_Object window, buffer, keep_margins;
3063{ 3065{
diff --git a/src/xdisp.c b/src/xdisp.c
index 779109b83ab..6f88827bf73 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10759,6 +10759,7 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
10759 int string_before_pos; 10759 int string_before_pos;
10760 int x = row->x; 10760 int x = row->x;
10761 int cursor_x = x; 10761 int cursor_x = x;
10762 int cursor_from_overlay_pos = 0;
10762 int pt_old = PT - delta; 10763 int pt_old = PT - delta;
10763 10764
10764 /* Skip over glyphs not having an object at the start of the row. 10765 /* Skip over glyphs not having an object at the start of the row.
@@ -10784,6 +10785,12 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
10784 string_start = NULL; 10785 string_start = NULL;
10785 x += glyph->pixel_width; 10786 x += glyph->pixel_width;
10786 ++glyph; 10787 ++glyph;
10788 if (cursor_from_overlay_pos
10789 && last_pos > cursor_from_overlay_pos)
10790 {
10791 cursor_from_overlay_pos = 0;
10792 cursor = 0;
10793 }
10787 } 10794 }
10788 else 10795 else
10789 { 10796 {
@@ -10793,10 +10800,21 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
10793 /* Skip all glyphs from string. */ 10800 /* Skip all glyphs from string. */
10794 do 10801 do
10795 { 10802 {
10803 int pos;
10796 if ((cursor == NULL || glyph > cursor) 10804 if ((cursor == NULL || glyph > cursor)
10797 && !NILP (Fget_char_property (make_number ((glyph)->charpos), 10805 && !NILP (Fget_char_property (make_number ((glyph)->charpos),
10798 Qcursor, (glyph)->object))) 10806 Qcursor, (glyph)->object))
10807 && (pos = string_buffer_position (w, glyph->object,
10808 string_before_pos),
10809 (pos == 0 /* From overlay */
10810 || pos == pt_old)))
10799 { 10811 {
10812 /* Estimate overlay buffer position from the buffer
10813 positions of the glyphs before and after the overlay.
10814 Add 1 to last_pos so that if point corresponds to the
10815 glyph right after the overlay, we still use a 'cursor'
10816 property found in that overlay. */
10817 cursor_from_overlay_pos = pos == 0 ? last_pos+1 : 0;
10800 cursor = glyph; 10818 cursor = glyph;
10801 cursor_x = x; 10819 cursor_x = x;
10802 } 10820 }
@@ -15876,15 +15894,16 @@ store_mode_line_string (string, lisp_string, copy_string, field_width, precision
15876 15894
15877 15895
15878DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line, 15896DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line,
15879 0, 3, 0, 15897 0, 4, 0,
15880 doc: /* Return the mode-line of selected window as a string. 15898 doc: /* Return the mode-line of selected window as a string.
15881First optional arg FORMAT specifies a different format string (see 15899First optional arg FORMAT specifies a different format string (see
15882`mode-line-format' for details) to use. If FORMAT is t, return 15900`mode-line-format' for details) to use. If FORMAT is t, return
15883the buffer's header-line. Second optional arg WINDOW specifies a 15901the buffer's header-line. Second optional arg WINDOW specifies a
15884different window to use as the context for the formatting. 15902different window to use as the context for the formatting.
15885If third optional arg NO-PROPS is non-nil, string is not propertized. */) 15903If third optional arg NO-PROPS is non-nil, string is not propertized.
15886 (format, window, no_props) 15904Fourth optional arg BUFFER specifies which buffer to use. */)
15887 Lisp_Object format, window, no_props; 15905 (format, window, no_props, buffer)
15906 Lisp_Object format, window, no_props, buffer;
15888{ 15907{
15889 struct it it; 15908 struct it it;
15890 int len; 15909 int len;
@@ -15896,12 +15915,16 @@ If third optional arg NO-PROPS is non-nil, string is not propertized. */)
15896 window = selected_window; 15915 window = selected_window;
15897 CHECK_WINDOW (window); 15916 CHECK_WINDOW (window);
15898 w = XWINDOW (window); 15917 w = XWINDOW (window);
15899 CHECK_BUFFER (w->buffer);
15900 15918
15901 if (XBUFFER (w->buffer) != current_buffer) 15919 if (NILP (buffer))
15920 buffer = w->buffer;
15921
15922 CHECK_BUFFER (buffer);
15923
15924 if (XBUFFER (buffer) != current_buffer)
15902 { 15925 {
15903 old_buffer = current_buffer; 15926 old_buffer = current_buffer;
15904 set_buffer_internal_1 (XBUFFER (w->buffer)); 15927 set_buffer_internal_1 (XBUFFER (buffer));
15905 } 15928 }
15906 15929
15907 if (NILP (format) || EQ (format, Qt)) 15930 if (NILP (format) || EQ (format, Qt))
diff --git a/src/xmenu.c b/src/xmenu.c
index eddda3ef91b..040bb6df622 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1,5 +1,5 @@
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, 88, 93, 94, 96, 99, 2000, 2001, 2003 2 Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2003, 2004
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -1801,7 +1801,7 @@ update_submenu_strings (first_wv)
1801 1801
1802 for (wv = first_wv; wv; wv = wv->next) 1802 for (wv = first_wv; wv; wv = wv->next)
1803 { 1803 {
1804 if (wv->lname && ! NILP (wv->lname)) 1804 if (STRINGP (wv->lname))
1805 { 1805 {
1806 wv->name = SDATA (wv->lname); 1806 wv->name = SDATA (wv->lname);
1807 1807
@@ -1815,7 +1815,7 @@ update_submenu_strings (first_wv)
1815 } 1815 }
1816 } 1816 }
1817 1817
1818 if (wv->lkey && ! NILP (wv->lkey)) 1818 if (STRINGP (wv->lkey))
1819 wv->key = SDATA (wv->lkey); 1819 wv->key = SDATA (wv->lkey);
1820 1820
1821 if (wv->contents) 1821 if (wv->contents)
@@ -1888,7 +1888,7 @@ set_frame_menubar (f, first_time, deep_p)
1888#endif 1888#endif
1889 Lisp_Object items; 1889 Lisp_Object items;
1890 widget_value *wv, *first_wv, *prev_wv = 0; 1890 widget_value *wv, *first_wv, *prev_wv = 0;
1891 int i, last_i; 1891 int i, last_i = 0;
1892 int *submenu_start, *submenu_end; 1892 int *submenu_start, *submenu_end;
1893 int *submenu_top_level_items, *submenu_n_panes; 1893 int *submenu_top_level_items, *submenu_n_panes;
1894 1894