aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-06-03 05:49:26 +0000
committerKaroly Lorentey2005-06-03 05:49:26 +0000
commit8736257554f49445f7b4402ac7a9436b38ce6452 (patch)
treede0478f60f773c3e09c6c4fcbed3b6ea1641e74c /src
parent93d7a3669284221c9272784875f69c047873fe04 (diff)
parentd06e384795d5ca4e82c88273847eeb9d01380046 (diff)
downloademacs-8736257554f49445f7b4402ac7a9436b38ce6452.tar.gz
emacs-8736257554f49445f7b4402ac7a9436b38ce6452.zip
Merged from miles@gnu.org--gnu-2005 (patch 74-79, 332-349)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-332 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-333 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-334 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-335 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-336 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-337 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-338 etc/emacs-buffer.gdb: Remove RCS keywords * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-340 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-341 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-342 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-343 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-344 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-345 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-346 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-347 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-348 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-349 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-74 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-75 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-76 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-77 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-78 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-79 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-349
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog135
-rw-r--r--src/buffer.c3
-rw-r--r--src/fileio.c2
-rw-r--r--src/fns.c6
-rw-r--r--src/macterm.c9
-rw-r--r--src/xdisp.c448
-rw-r--r--src/xfaces.c4
7 files changed, 386 insertions, 221 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8c64defd5db..dbcac952b51 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,63 @@
12005-06-02 Kim F. Storm <storm@cua.dk>
2
3 * xdisp.c (MODE_LINE_NOPROP_LEN): New macro.
4 (x_consider_frame_title, Fformat_mode_line): Save offset into
5 mode_line_noprop_buf rather than pointer, in case buffer is relocated.
6
72005-06-01 Kim F. Storm <storm@cua.dk>
8
9 * fns.c (mapcar1): Maybe exit loop if original sequence was modified.
10
112005-06-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12
13 * macterm.c (mac_to_x_fontname, mac_do_list_fonts): Set XLFD
14 resolution fields for scalable fonts to 0.
15
16 * xfaces.c (build_scalable_font_name): Round pixel size to the
17 nearest integer.
18
192005-06-01 Kim F. Storm <storm@cua.dk>
20
21 * xdisp.c (display_mode_line): Support nested calls to redisplay
22 and format-mode-line. Set mode_line_target to MODE_LINE_DISPLAY.
23
242005-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
25
26 * fileio.c (Finsert_file_contents):
27 * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup.
28
292005-05-31 Kim F. Storm <storm@cua.dk>
30
31 * xdisp.c (mode_line_noprop_buf, mode_line_noprop_buf_end)
32 (mode_line_noprop_ptr): Rename from frame_title_*.
33 (store_mode_line_noprop_char): Rename from store_frame_title_char.
34 (store_mode_line_noprop): Rename from store_frame_title.
35 (mode_line_target): New enum to specify current output target
36 for mode line formatting.
37 (display_mode_element): Test it rather than frame_title_ptr and
38 mode_line_string_list to determine where output should go.
39 (mode_line_proptrans_alist, mode_line_string_alist): Make static.
40 (Vmode_line_unwind_vector): New variable.
41 (format_mode_line_unwind_data, unwind_format_mode_line):
42 New functions for unwind protection in mode line formatting.
43 (x_consider_frame_title): Use them and new local var 'title_start'
44 to support nested calls to format-mode-line and redisplay. Set
45 mode_line_target to MODE_LINE_TITLE.
46 (Fformat_mode_line): Use them and new local var 'string_start' to
47 support nested calls to format-mode-line and redisplay. Set
48 mode_line_target to MODE_LINE_NOPROP or MODE_LINE_STRING.
49 Don't trim trailing dashes.
50 (decode_mode_spec): Don't make infinite number of trailing dashes
51 for MODE_LINE_NOPROP and MODE_LINE_STRING targets.
52 (syms_of_xdisp): Initialize and staticpro mode_line_string_face,
53 mode_line_string_face_prop, and Vmode_line_unwind_vector.
54 (init_xdisp): Initialize mode_line_noprop_ptr to start of _buf.
55 Initialize mode_line_target to MODE_LINE_DISPLAY.
56
572005-05-29 Richard M. Stallman <rms@gnu.org>
58
59 * buffer.c (Fbuffer_local_value): Call indirect_variable.
60
12005-05-28 Masatake YAMATO <jet@gyve.org> 612005-05-28 Masatake YAMATO <jet@gyve.org>
2 62
3 * xdisp.c (note_mode_line_or_margin_highlight): Change the 63 * xdisp.c (note_mode_line_or_margin_highlight): Change the
@@ -9,10 +69,9 @@
9 69
10 * ccl.c: Now an element of Vccl_program_table is a vector of 70 * ccl.c: Now an element of Vccl_program_table is a vector of
11 length 4, not 3. 71 length 4, not 3.
12 (ccl_get_compiled_code): New arg idx. Caller changed. Adjusted 72 (ccl_get_compiled_code): New arg idx. Caller changed.
13 for the change of Vccl_program_table. 73 Adjust for the change of Vccl_program_table.
14 (setup_ccl_program): Adjusted for the change of 74 (setup_ccl_program): Adjust for the change of Vccl_program_table.
15 Vccl_program_table.
16 (check_ccl_update): New function. 75 (check_ccl_update): New function.
17 (Fregister_ccl_program): Use ASET to set an element of a vector. 76 (Fregister_ccl_program): Use ASET to set an element of a vector.
18 Adjusted for the change of Vccl_program_table. 77 Adjusted for the change of Vccl_program_table.
@@ -22,7 +81,7 @@
22 81
232005-05-27 Juanma Barranquero <lekktu@gmail.com> 822005-05-27 Juanma Barranquero <lekktu@gmail.com>
24 83
25 * image.c (Vimage_library_alist): Moved from image.el. 84 * image.c (Vimage_library_alist): Move from image.el.
26 (syms_of_image): Defvar it. 85 (syms_of_image): Defvar it.
27 (lookup_image_type): Use it. 86 (lookup_image_type): Use it.
28 87
@@ -119,8 +178,7 @@
119 178
1202005-05-16 Andreas Schwab <schwab@suse.de> 1792005-05-16 Andreas Schwab <schwab@suse.de>
121 180
122 * unexmacosx.c (unexec_realloc): Move declarations before 181 * unexmacosx.c (unexec_realloc): Move declarations before statements.
123 statements.
124 182
1252005-05-14 Richard M. Stallman <rms@gnu.org> 1832005-05-14 Richard M. Stallman <rms@gnu.org>
126 184
@@ -148,8 +206,8 @@
148 206
149 * emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init. 207 * emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init.
150 208
151 * keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]: Regard 209 * keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]:
152 toolkit scroll bar thumb drag events as squeezable and prevent 210 Regard toolkit scroll bar thumb drag events as squeezable and prevent
153 redisplay from being paused by them. 211 redisplay from being paused by them.
154 212
155 * mac.c [!MAC_OSX]: Include keyboard.h and syssignal.h. 213 * mac.c [!MAC_OSX]: Include keyboard.h and syssignal.h.
@@ -157,12 +215,11 @@
157 [!MAC_OSX] (check_alarm, pause, index): Remove functions. 215 [!MAC_OSX] (check_alarm, pause, index): Remove functions.
158 [!MAC_OSX && __MRC__] (sys_strftime): Likewise. 216 [!MAC_OSX && __MRC__] (sys_strftime): Likewise.
159 [!MAC_OSX] (select): If fd 0 is not set in rfds and some input 217 [!MAC_OSX] (select): If fd 0 is not set in rfds and some input
160 event occurs before timeout, behave as if the function were 218 event occurs before timeout, behave as if the function were interrupted.
161 interrupted.
162 [!MAC_OSX] (sigblock, sigsetmask, alarm): Simulate SIGALRM 219 [!MAC_OSX] (sigblock, sigsetmask, alarm): Simulate SIGALRM
163 handling using Time Manager routines. 220 handling using Time Manager routines.
164 [!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask): New 221 [!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask):
165 variables. 222 New variables.
166 [!MAC_OSX] (mac_atimer_handler, set_mac_atimer, remove_mac_atimer) 223 [!MAC_OSX] (mac_atimer_handler, set_mac_atimer, remove_mac_atimer)
167 (setitimer): New functions. 224 (setitimer): New functions.
168 225
@@ -176,8 +233,8 @@
176 (x_scroll_bar_handle_click): Change type of second argument from 233 (x_scroll_bar_handle_click): Change type of second argument from
177 int to ControlPartCode. 234 int to ControlPartCode.
178 (check_alarm): Remove declaration. 235 (check_alarm): Remove declaration.
179 (XTread_Socket) [!TARGET_API_MAC_CARBON]: Don't call it. 236 (XTread_socket) [!TARGET_API_MAC_CARBON]: Don't call it.
180 (XTread_Socket): Use ControlPartCode instead of SInt16. 237 (XTread_socket): Use ControlPartCode instead of SInt16.
181 238
1822005-05-13 Nozomu Ando <nand@mac.com> 2392005-05-13 Nozomu Ando <nand@mac.com>
183 240
@@ -1981,7 +2038,7 @@
19812005-01-13 Kim F. Storm <storm@cua.dk> 20382005-01-13 Kim F. Storm <storm@cua.dk>
1982 2039
1983 * xdisp.c (Fformat_mode_line): Fix last change. Remove NO_PROPS arg 2040 * xdisp.c (Fformat_mode_line): Fix last change. Remove NO_PROPS arg
1984 (specify 0 for FACE instead). Reorder arg list. Doc fix. 2041 (specify 0 for FACE instead). Reorder arg list. Doc fix.
1985 2042
19862005-01-12 Richard M. Stallman <rms@gnu.org> 20432005-01-12 Richard M. Stallman <rms@gnu.org>
1987 2044
@@ -2132,7 +2189,7 @@
2132 fontp->space_width to FONT_WIDTH so they are valid. 2189 fontp->space_width to FONT_WIDTH so they are valid.
2133 2190
2134 * w32fns.c (w32_load_system_font): Set FONT_WIDTH to maximum, not 2191 * w32fns.c (w32_load_system_font): Set FONT_WIDTH to maximum, not
2135 average width. Set fontp->average_width and fontp->space_width to 2192 average width. Set fontp->average_width and fontp->space_width to
2136 their appropriate values. 2193 their appropriate values.
2137 2194
2138 * w32term.c (x_new_font): Set FRAME_COLUMN_WIDTH to 2195 * w32term.c (x_new_font): Set FRAME_COLUMN_WIDTH to
@@ -2159,7 +2216,7 @@
2159 * xdisp.c (setup_for_ellipsis, get_next_display_element): 2216 * xdisp.c (setup_for_ellipsis, get_next_display_element):
2160 Set it->ellipsis_p to 1 or 0. 2217 Set it->ellipsis_p to 1 or 0.
2161 (display_line): Record whether row ends in mid-ellipsis. 2218 (display_line): Record whether row ends in mid-ellipsis.
2162 (set_cursor_from_row): If ends in ellipsis. find start of it. 2219 (set_cursor_from_row): If ends in ellipsis, find start of it.
2163 (cursor_row_p): If PT's at the end of the ellipsis the row 2220 (cursor_row_p): If PT's at the end of the ellipsis the row
2164 ends within, don't display cursor on this row. 2221 ends within, don't display cursor on this row.
2165 2222
@@ -2862,7 +2919,7 @@
2862 * fringe.c (update_window_fringes): Prefer truncation bitmaps over 2919 * fringe.c (update_window_fringes): Prefer truncation bitmaps over
2863 angle bitmaps at top/bottom line. 2920 angle bitmaps at top/bottom line.
2864 2921
2865 * xdisp.c: Undo recent changes for restoring saved_face_id. Instead, 2922 * xdisp.c: Undo recent changes for restoring saved_face_id. Instead,
2866 set it when it->method is set to next_element_from_display_vector. 2923 set it when it->method is set to next_element_from_display_vector.
2867 (setup_for_ellipsis): Add LEN argument. Callers changed. 2924 (setup_for_ellipsis): Add LEN argument. Callers changed.
2868 Set it->saved_face_id. 2925 Set it->saved_face_id.
@@ -3058,7 +3115,7 @@
3058 * xfns.c (Fx_file_dialog): Call popup_activated instead of 3115 * xfns.c (Fx_file_dialog): Call popup_activated instead of
3059 x_menu_in_use. Call x_menu_set_in_use in Motif version also. 3116 x_menu_in_use. Call x_menu_set_in_use in Motif version also.
3060 3117
3061 * xterm.h: (x_menu_in_use): Remove. 3118 * xterm.h (x_menu_in_use): Remove.
3062 3119
30632004-11-16 Richard M. Stallman <rms@gnu.org> 31202004-11-16 Richard M. Stallman <rms@gnu.org>
3064 3121
@@ -3192,7 +3249,7 @@
3192 (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros. 3249 (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros.
3193 (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible 3250 (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible
3194 part of last line is only extra line spacing (so the text on the 3251 part of last line is only extra line spacing (so the text on the
3195 line is fully visible). Use helper macros. 3252 line is fully visible). Use helper macros.
3196 Add W arg (to use them). All callers changed. 3253 Add W arg (to use them). All callers changed.
3197 (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P) 3254 (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P)
3198 (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros. 3255 (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros.
@@ -3878,7 +3935,7 @@
3878 3935
3879 * keyboard.c (timer_resume_idle): New function to resume idle 3936 * keyboard.c (timer_resume_idle): New function to resume idle
3880 timer without resetting timers on the idle list. 3937 timer without resetting timers on the idle list.
3881 (read_char): Use timer_resume_idle. Remove local var last_idle_start. 3938 (read_char): Use timer_resume_idle. Remove local var last_idle_start.
3882 (timer_start_idle, timer_stop_idle): Declare static. 3939 (timer_start_idle, timer_stop_idle): Declare static.
3883 (read_key_sequence): Use timer_resume_idle instead of timer_start_idle. 3940 (read_key_sequence): Use timer_resume_idle instead of timer_start_idle.
3884 3941
@@ -5952,7 +6009,7 @@
5952 elt_prefix combined with Fsingle_key_description. 6009 elt_prefix combined with Fsingle_key_description.
5953 (describe_vector): Declare static. Replace arg `elt_prefix' with 6010 (describe_vector): Declare static. Replace arg `elt_prefix' with
5954 `prefix'. Add KEYMAP_P arg. Add local var `elt_prefix'; use it 6011 `prefix'. Add KEYMAP_P arg. Add local var `elt_prefix'; use it
5955 if !KEYMAP_P. Use Fkey_description with prefix instead of 6012 if !KEYMAP_P. Use Fkey_description with prefix instead of
5956 Fsingle_key_description. 6013 Fsingle_key_description.
5957 6014
5958 * keymap.h (Fkey_description): Fix prototype. 6015 * keymap.h (Fkey_description): Fix prototype.
@@ -6167,7 +6224,7 @@
6167 (display_mode_line): Set mode_line_p before displaying line. 6224 (display_mode_line): Set mode_line_p before displaying line.
6168 (calc_pixel_width_or_height): Declare extern. Add separate :align-to 6225 (calc_pixel_width_or_height): Declare extern. Add separate :align-to
6169 handling. Remove complex cases for fringes and scroll-bars. 6226 handling. Remove complex cases for fringes and scroll-bars.
6170 Add left, right, and center alignment positions. Add text (area) 6227 Add left, right, and center alignment positions. Add text (area)
6171 width/height. Return width or height for image specs. 6228 width/height. Return width or height for image specs.
6172 (produce_stretch_glyph): Improve handling of :align-to. Is now 6229 (produce_stretch_glyph): Improve handling of :align-to. Is now
6173 relative to left of text area by default, but other base offsets 6230 relative to left of text area by default, but other base offsets
@@ -10475,7 +10532,7 @@
10475 * intervals.h (CHECK_TOTAL_LENGTH): New macro. 10532 * intervals.h (CHECK_TOTAL_LENGTH): New macro.
10476 * intervals.c: Add many calls to CHECK_TOTAL_LENGTH. 10533 * intervals.c: Add many calls to CHECK_TOTAL_LENGTH.
10477 10534
10478 * alloc.c: (VALIDATE_LISP_STORAGE): Macro deleted. 10535 * alloc.c (VALIDATE_LISP_STORAGE): Macro deleted.
10479 All calls deleted. 10536 All calls deleted.
10480 (lisp_malloc): Do the work here directly. 10537 (lisp_malloc): Do the work here directly.
10481 10538
@@ -10634,7 +10691,7 @@
10634 (syms_of_w32fns): Don't intern/staticpro removed vars. 10691 (syms_of_w32fns): Don't intern/staticpro removed vars.
10635 10692
10636 * w32term.c: Remove unnecessary extern declarations. 10693 * w32term.c: Remove unnecessary extern declarations.
10637 (x_fullscreen_adjust): Remove. Use generic instead. 10694 (x_fullscreen_adjust): Remove. Use generic instead.
10638 (x_redisplay_interface): Add w32_frame_parm_handlers member. 10695 (x_redisplay_interface): Add w32_frame_parm_handlers member.
10639 10696
10640 * w32reg.c (x_get_string_resource): Use XrmDatabase. 10697 * w32reg.c (x_get_string_resource): Use XrmDatabase.
@@ -11860,9 +11917,9 @@
118602003-01-21 David Ponce <david@dponce.com> 119172003-01-21 David Ponce <david@dponce.com>
11861 11918
11862 * w32term.c (w32_encode_char): For DIM=1 charset, set 11919 * w32term.c (w32_encode_char): For DIM=1 charset, set
11863 ccl->reg[2] to -1 before calling ccl_driver. (Sync. with xterm.c 11920 ccl->reg[2] to -1 before calling ccl_driver.
11864 x_encode_char change by Kenichi Handa <handa@m17n.org> on 11921 (Sync. with xterm.c x_encode_char change by Kenichi Handa
11865 2002-09-30.) 11922 <handa@m17n.org> on 2002-09-30.)
11866 (w32_draw_relief_rect): Declare all args. 11923 (w32_draw_relief_rect): Declare all args.
11867 (w32_define_cursor): New. 11924 (w32_define_cursor): New.
11868 11925
@@ -14545,7 +14602,7 @@
14545 14602
145462002-06-27 Kim F. Storm <storm@cua.dk> 146032002-06-27 Kim F. Storm <storm@cua.dk>
14547 14604
14548 * xdisp.c: (mode_line_string_list, mode_line_string_face) 14605 * xdisp.c (mode_line_string_list, mode_line_string_face)
14549 (mode_line_string_face_prop): New variables. 14606 (mode_line_string_face_prop): New variables.
14550 (store_mode_line_string): New function. 14607 (store_mode_line_string): New function.
14551 (display_mode_element): Use store_mode_line_string to 14608 (display_mode_element): Use store_mode_line_string to
@@ -14588,7 +14645,7 @@
14588 14645
145892002-06-24 Juanma Barranquero <lektu@terra.es> 146462002-06-24 Juanma Barranquero <lektu@terra.es>
14590 14647
14591 * w32select.c: Include composite.h 14648 * w32select.c: Include composite.h.
14592 14649
14593 * w16select.c: Likewise. 14650 * w16select.c: Likewise.
14594 14651
@@ -15579,7 +15636,7 @@
15579 15636
15580 * config.in: Add HAVE_SHARED_GAME_DIR. 15637 * config.in: Add HAVE_SHARED_GAME_DIR.
15581 15638
15582 * callproc.c: (Vgame_score_directory): New variable. 15639 * callproc.c (Vgame_score_directory): New variable.
15583 (syms_of_callproc) <Vgame_score_directory>: DEFVAR_LISP. 15640 (syms_of_callproc) <Vgame_score_directory>: DEFVAR_LISP.
15584 15641
155852002-04-10 Richard M. Stallman <rms@gnu.org> 156422002-04-10 Richard M. Stallman <rms@gnu.org>
@@ -16127,7 +16184,7 @@
16127 16184
16128 * xterm.h (x_session_check_input, x_session_initialize): Declare. 16185 * xterm.h (x_session_check_input, x_session_initialize): Declare.
16129 16186
16130 * xterm.c: (XTread_socket): Add call to x_session_check_input and 16187 * xterm.c (XTread_socket): Add call to x_session_check_input and
16131 x_session_have_connection. 16188 x_session_have_connection.
16132 (x_initialize): Add call to x_session_initialize. 16189 (x_initialize): Add call to x_session_initialize.
16133 16190
@@ -16544,10 +16601,10 @@
16544 16601
165452002-02-17 Kim F. Storm <storm@cua.dk> 166022002-02-17 Kim F. Storm <storm@cua.dk>
16546 16603
16547 * frame.c: (Vmouse_highlight): New variable. 16604 * frame.c (Vmouse_highlight): New variable.
16548 (syms_of_frame): DEFVAR_LISP it. 16605 (syms_of_frame): DEFVAR_LISP it.
16549 16606
16550 * frame.h: (Vmouse_highlight): Declare extern. 16607 * frame.h (Vmouse_highlight): Declare extern.
16551 16608
16552 * xterm.h (struct x_display_info): Add mouse_face_hidden. 16609 * xterm.h (struct x_display_info): Add mouse_face_hidden.
16553 16610
@@ -18072,7 +18129,7 @@
18072 18129
180732001-11-16 Eli Zaretskii <eliz@is.elta.co.il> 181302001-11-16 Eli Zaretskii <eliz@is.elta.co.il>
18074 18131
18075 * syswait.h: (HAVE_SYS_WAIT_H): Undef for ISC 4.1. Reported by 18132 * syswait.h (HAVE_SYS_WAIT_H): Undef for ISC 4.1. Reported by
18076 Andrew Wiseman <a.wiseman@btclick.com>. 18133 Andrew Wiseman <a.wiseman@btclick.com>.
18077 18134
180782001-11-16 Kim F. Storm <storm@cua.dk> 181352001-11-16 Kim F. Storm <storm@cua.dk>
@@ -18760,7 +18817,7 @@
18760 18817
18761 * xterm.c: Fix typo in a comment. 18818 * xterm.c: Fix typo in a comment.
18762 18819
18763 * lisp.h: (gdb_lisp_params): Remove code in #if 0 which is now in 18820 * lisp.h (gdb_lisp_params): Remove code in #if 0 which is now in
18764 emacs.c. 18821 emacs.c.
18765 18822
187662001-10-27 Gerd Moellmann <gerd@gnu.org> 188232001-10-27 Gerd Moellmann <gerd@gnu.org>
@@ -18884,7 +18941,7 @@
18884 18941
188852001-10-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> 189422001-10-24 Pavel Jan,Am(Bk <Pavel@Janik.cz>
18886 18943
18887 * xterm.c: (x_insert_glyphs): Remove unused variables `real_end' 18944 * xterm.c (x_insert_glyphs): Remove unused variables `real_end'
18888 and `real_start'. 18945 and `real_start'.
18889 (x_draw_image_foreground): Remove unused variables `mask' and `xgcv'. 18946 (x_draw_image_foreground): Remove unused variables `mask' and `xgcv'.
18890 (glyph_rect): Remove unused variable `area'. 18947 (glyph_rect): Remove unused variable `area'.
@@ -18916,7 +18973,7 @@
18916 (HAVE_BOXES): Fix typo in comment. 18973 (HAVE_BOXES): Fix typo in comment.
18917 (push_menu_pane): Fix typo in comment. 18974 (push_menu_pane): Fix typo in comment.
18918 18975
18919 * xdisp.c: (display_prop_string_p): Remove unused local declaration 18976 * xdisp.c (display_prop_string_p): Remove unused local declaration
18920 of `Qwhen'. 18977 of `Qwhen'.
18921 (single_display_prop_string_p): Remove unused local declarations 18978 (single_display_prop_string_p): Remove unused local declarations
18922 of `Qwhen' and `Qmargin'. 18979 of `Qwhen' and `Qmargin'.
diff --git a/src/buffer.c b/src/buffer.c
index dfcf4a9a0b9..a287e45df78 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -889,6 +889,9 @@ is the default binding of the variable. */)
889 CHECK_BUFFER (buffer); 889 CHECK_BUFFER (buffer);
890 buf = XBUFFER (buffer); 890 buf = XBUFFER (buffer);
891 891
892 if (SYMBOLP (variable))
893 variable = indirect_variable (variable);
894
892 /* Look in local_var_list */ 895 /* Look in local_var_list */
893 result = Fassoc (variable, buf->local_var_alist); 896 result = Fassoc (variable, buf->local_var_alist);
894 if (NILP (result)) 897 if (NILP (result))
diff --git a/src/fileio.c b/src/fileio.c
index a31b434c1de..c38cb924c8b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3747,7 +3747,7 @@ actually used. */)
3747 int set_coding_system = 0; 3747 int set_coding_system = 0;
3748 int coding_system_decided = 0; 3748 int coding_system_decided = 0;
3749 int read_quit = 0; 3749 int read_quit = 0;
3750 int old_Vdeactivate_mark = Vdeactivate_mark; 3750 Lisp_Object old_Vdeactivate_mark = Vdeactivate_mark;
3751 int we_locked_file = 0; 3751 int we_locked_file = 0;
3752 3752
3753 if (current_buffer->base_buffer && ! NILP (visit)) 3753 if (current_buffer->base_buffer && ! NILP (visit))
diff --git a/src/fns.c b/src/fns.c
index bd3893f7538..e910c87375b 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3132,9 +3132,9 @@ mapcar1 (leni, vals, fn, seq)
3132 else /* Must be a list, since Flength did not get an error */ 3132 else /* Must be a list, since Flength did not get an error */
3133 { 3133 {
3134 tail = seq; 3134 tail = seq;
3135 for (i = 0; i < leni; i++) 3135 for (i = 0; i < leni && CONSP (tail); i++)
3136 { 3136 {
3137 dummy = call1 (fn, Fcar (tail)); 3137 dummy = call1 (fn, XCAR (tail));
3138 if (vals) 3138 if (vals)
3139 vals[i] = dummy; 3139 vals[i] = dummy;
3140 tail = XCDR (tail); 3140 tail = XCDR (tail);
@@ -3172,7 +3172,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
3172 mapcar1 (leni, args, function, sequence); 3172 mapcar1 (leni, args, function, sequence);
3173 UNGCPRO; 3173 UNGCPRO;
3174 3174
3175 for (i = leni - 1; i >= 0; i--) 3175 for (i = leni - 1; i > 0; i--)
3176 args[i + i] = args[i]; 3176 args[i + i] = args[i];
3177 3177
3178 for (i = 1; i < nargs; i += 2) 3178 for (i = 1; i < nargs; i += 2)
diff --git a/src/macterm.c b/src/macterm.c
index 47c77e6dd56..890c1a1b9ba 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -6256,9 +6256,10 @@ mac_to_x_fontname (name, size, style, charset)
6256 strcpy(family, name); 6256 strcpy(family, name);
6257 } 6257 }
6258 6258
6259 sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-75-75-m-%d-%s", 6259 sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-%d-%d-m-%d-%s",
6260 foundry, family, style & bold ? "bold" : "medium", 6260 foundry, family, style & bold ? "bold" : "medium",
6261 style & italic ? 'i' : 'r', size, size * 10, size * 10, charset); 6261 style & italic ? 'i' : 'r', size, size * 10,
6262 size ? 75 : 0, size ? 75 : 0, size * 10, charset);
6262 6263
6263 result = (char *) xmalloc (strlen (xf) + 1); 6264 result = (char *) xmalloc (strlen (xf) + 1);
6264 strcpy (result, xf); 6265 strcpy (result, xf);
@@ -6714,7 +6715,7 @@ mac_do_list_fonts (pattern, maxnames)
6714 break; 6715 break;
6715 } 6716 }
6716 else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 6717 else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0
6717 && (ptr = strstr (font_name_table[i], "-0-0-75-75-m-0-"))) 6718 && (ptr = strstr (font_name_table[i], "-0-0-0-0-m-0-")))
6718 { 6719 {
6719 int former_len = ptr - font_name_table[i]; 6720 int former_len = ptr - font_name_table[i];
6720 6721
@@ -6724,7 +6725,7 @@ mac_do_list_fonts (pattern, maxnames)
6724 scl_val[XLFD_SCL_PIXEL_SIZE], 6725 scl_val[XLFD_SCL_PIXEL_SIZE],
6725 scl_val[XLFD_SCL_POINT_SIZE], 6726 scl_val[XLFD_SCL_POINT_SIZE],
6726 scl_val[XLFD_SCL_AVGWIDTH], 6727 scl_val[XLFD_SCL_AVGWIDTH],
6727 ptr + sizeof ("-0-0-75-75-m-0-") - 1); 6728 ptr + sizeof ("-0-0-0-0-m-0-") - 1);
6728 fontname = mac_c_string_match (pattern_regex, scaled, 6729 fontname = mac_c_string_match (pattern_regex, scaled,
6729 nonspecial, exact); 6730 nonspecial, exact);
6730 if (!NILP (fontname)) 6731 if (!NILP (fontname))
diff --git a/src/xdisp.c b/src/xdisp.c
index fe2d2e7020a..31a82fefd78 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -830,8 +830,8 @@ static struct text_pos run_window_scroll_functions P_ ((Lisp_Object,
830 struct text_pos)); 830 struct text_pos));
831static void reconsider_clip_changes P_ ((struct window *, struct buffer *)); 831static void reconsider_clip_changes P_ ((struct window *, struct buffer *));
832static int text_outside_line_unchanged_p P_ ((struct window *, int, int)); 832static int text_outside_line_unchanged_p P_ ((struct window *, int, int));
833static void store_frame_title_char P_ ((char)); 833static void store_mode_line_noprop_char P_ ((char));
834static int store_frame_title P_ ((const unsigned char *, int, int)); 834static int store_mode_line_noprop P_ ((const unsigned char *, int, int));
835static void x_consider_frame_title P_ ((Lisp_Object)); 835static void x_consider_frame_title P_ ((Lisp_Object));
836static void handle_stop P_ ((struct it *)); 836static void handle_stop P_ ((struct it *));
837static int tool_bar_lines_needed P_ ((struct frame *)); 837static int tool_bar_lines_needed P_ ((struct frame *));
@@ -8161,52 +8161,126 @@ echo_area_display (update_frame_p)
8161 8161
8162 8162
8163/*********************************************************************** 8163/***********************************************************************
8164 Frame Titles 8164 Mode Lines and Frame Titles
8165 ***********************************************************************/ 8165 ***********************************************************************/
8166 8166
8167/* A buffer for constructing non-propertized mode-line strings and
8168 frame titles in it; allocated from the heap in init_xdisp and
8169 resized as needed in store_mode_line_noprop_char. */
8167 8170
8168/* The frame title buffering code is also used by Fformat_mode_line. 8171static char *mode_line_noprop_buf;
8169 So it is not conditioned by HAVE_WINDOW_SYSTEM. */
8170 8172
8171/* A buffer for constructing frame titles in it; allocated from the 8173/* The buffer's end, and a current output position in it. */
8172 heap in init_xdisp and resized as needed in store_frame_title_char. */
8173 8174
8174static char *frame_title_buf; 8175static char *mode_line_noprop_buf_end;
8176static char *mode_line_noprop_ptr;
8175 8177
8176/* The buffer's end, and a current output position in it. */ 8178#define MODE_LINE_NOPROP_LEN(start) \
8179 ((mode_line_noprop_ptr - mode_line_noprop_buf) - start)
8180
8181static enum {
8182 MODE_LINE_DISPLAY = 0,
8183 MODE_LINE_TITLE,
8184 MODE_LINE_NOPROP,
8185 MODE_LINE_STRING
8186} mode_line_target;
8187
8188/* Alist that caches the results of :propertize.
8189 Each element is (PROPERTIZED-STRING . PROPERTY-LIST). */
8190static Lisp_Object mode_line_proptrans_alist;
8191
8192/* List of strings making up the mode-line. */
8193static Lisp_Object mode_line_string_list;
8194
8195/* Base face property when building propertized mode line string. */
8196static Lisp_Object mode_line_string_face;
8197static Lisp_Object mode_line_string_face_prop;
8198
8199
8200/* Unwind data for mode line strings */
8201
8202static Lisp_Object Vmode_line_unwind_vector;
8203
8204static Lisp_Object
8205format_mode_line_unwind_data (obuf)
8206 struct buffer *obuf;
8207{
8208 int i = 0;
8209 Lisp_Object vector;
8210
8211 /* Reduce consing by keeping one vector in
8212 Vwith_echo_area_save_vector. */
8213 vector = Vmode_line_unwind_vector;
8214 Vmode_line_unwind_vector = Qnil;
8215
8216 if (NILP (vector))
8217 vector = Fmake_vector (make_number (7), Qnil);
8218
8219 AREF (vector, 0) = make_number (mode_line_target);
8220 AREF (vector, 1) = make_number (MODE_LINE_NOPROP_LEN (0));
8221 AREF (vector, 2) = mode_line_string_list;
8222 AREF (vector, 3) = mode_line_proptrans_alist;
8223 AREF (vector, 4) = mode_line_string_face;
8224 AREF (vector, 5) = mode_line_string_face_prop;
8225
8226 if (obuf)
8227 XSETBUFFER (AREF (vector, 6), obuf);
8228 else
8229 AREF (vector, 6) = Qnil;
8230
8231 return vector;
8232}
8233
8234static Lisp_Object
8235unwind_format_mode_line (vector)
8236 Lisp_Object vector;
8237{
8238 mode_line_target = XINT (AREF (vector, 0));
8239 mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1));
8240 mode_line_string_list = AREF (vector, 2);
8241 mode_line_proptrans_alist = AREF (vector, 3);
8242 mode_line_string_face = AREF (vector, 4);
8243 mode_line_string_face_prop = AREF (vector, 5);
8177 8244
8178static char *frame_title_buf_end; 8245 if (!NILP (AREF (vector, 6)))
8179static char *frame_title_ptr; 8246 {
8247 set_buffer_internal_1 (XBUFFER (AREF (vector, 6)));
8248 AREF (vector, 6) = Qnil;
8249 }
8180 8250
8251 Vmode_line_unwind_vector = vector;
8252 return Qnil;
8253}
8181 8254
8182/* Store a single character C for the frame title in frame_title_buf. 8255
8183 Re-allocate frame_title_buf if necessary. */ 8256/* Store a single character C for the frame title in mode_line_noprop_buf.
8257 Re-allocate mode_line_noprop_buf if necessary. */
8184 8258
8185static void 8259static void
8186#ifdef PROTOTYPES 8260#ifdef PROTOTYPES
8187store_frame_title_char (char c) 8261store_mode_line_noprop_char (char c)
8188#else 8262#else
8189store_frame_title_char (c) 8263store_mode_line_noprop_char (c)
8190 char c; 8264 char c;
8191#endif 8265#endif
8192{ 8266{
8193 /* If output position has reached the end of the allocated buffer, 8267 /* If output position has reached the end of the allocated buffer,
8194 double the buffer's size. */ 8268 double the buffer's size. */
8195 if (frame_title_ptr == frame_title_buf_end) 8269 if (mode_line_noprop_ptr == mode_line_noprop_buf_end)
8196 { 8270 {
8197 int len = frame_title_ptr - frame_title_buf; 8271 int len = MODE_LINE_NOPROP_LEN (0);
8198 int new_size = 2 * len * sizeof *frame_title_buf; 8272 int new_size = 2 * len * sizeof *mode_line_noprop_buf;
8199 frame_title_buf = (char *) xrealloc (frame_title_buf, new_size); 8273 mode_line_noprop_buf = (char *) xrealloc (mode_line_noprop_buf, new_size);
8200 frame_title_buf_end = frame_title_buf + new_size; 8274 mode_line_noprop_buf_end = mode_line_noprop_buf + new_size;
8201 frame_title_ptr = frame_title_buf + len; 8275 mode_line_noprop_ptr = mode_line_noprop_buf + len;
8202 } 8276 }
8203 8277
8204 *frame_title_ptr++ = c; 8278 *mode_line_noprop_ptr++ = c;
8205} 8279}
8206 8280
8207 8281
8208/* Store part of a frame title in frame_title_buf, beginning at 8282/* Store part of a frame title in mode_line_noprop_buf, beginning at
8209 frame_title_ptr. STR is the string to store. Do not copy 8283 mode_line_noprop_ptr. STR is the string to store. Do not copy
8210 characters that yield more columns than PRECISION; PRECISION <= 0 8284 characters that yield more columns than PRECISION; PRECISION <= 0
8211 means copy the whole string. Pad with spaces until FIELD_WIDTH 8285 means copy the whole string. Pad with spaces until FIELD_WIDTH
8212 number of characters have been copied; FIELD_WIDTH <= 0 means don't 8286 number of characters have been copied; FIELD_WIDTH <= 0 means don't
@@ -8214,7 +8288,7 @@ store_frame_title_char (c)
8214 frame title. */ 8288 frame title. */
8215 8289
8216static int 8290static int
8217store_frame_title (str, field_width, precision) 8291store_mode_line_noprop (str, field_width, precision)
8218 const unsigned char *str; 8292 const unsigned char *str;
8219 int field_width, precision; 8293 int field_width, precision;
8220{ 8294{
@@ -8225,19 +8299,23 @@ store_frame_title (str, field_width, precision)
8225 nbytes = strlen (str); 8299 nbytes = strlen (str);
8226 n += c_string_width (str, nbytes, precision, &dummy, &nbytes); 8300 n += c_string_width (str, nbytes, precision, &dummy, &nbytes);
8227 while (nbytes--) 8301 while (nbytes--)
8228 store_frame_title_char (*str++); 8302 store_mode_line_noprop_char (*str++);
8229 8303
8230 /* Fill up with spaces until FIELD_WIDTH reached. */ 8304 /* Fill up with spaces until FIELD_WIDTH reached. */
8231 while (field_width > 0 8305 while (field_width > 0
8232 && n < field_width) 8306 && n < field_width)
8233 { 8307 {
8234 store_frame_title_char (' '); 8308 store_mode_line_noprop_char (' ');
8235 ++n; 8309 ++n;
8236 } 8310 }
8237 8311
8238 return n; 8312 return n;
8239} 8313}
8240 8314
8315/***********************************************************************
8316 Frame Titles
8317 ***********************************************************************/
8318
8241#ifdef HAVE_WINDOW_SYSTEM 8319#ifdef HAVE_WINDOW_SYSTEM
8242 8320
8243/* Set the title of FRAME, if it has changed. The title format is 8321/* Set the title of FRAME, if it has changed. The title format is
@@ -8257,9 +8335,11 @@ x_consider_frame_title (frame)
8257 /* Do we have more than one visible frame on this X display? */ 8335 /* Do we have more than one visible frame on this X display? */
8258 Lisp_Object tail; 8336 Lisp_Object tail;
8259 Lisp_Object fmt; 8337 Lisp_Object fmt;
8260 struct buffer *obuf; 8338 int title_start;
8339 char *title;
8261 int len; 8340 int len;
8262 struct it it; 8341 struct it it;
8342 int count = SPECPDL_INDEX ();
8263 8343
8264 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) 8344 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
8265 { 8345 {
@@ -8278,18 +8358,22 @@ x_consider_frame_title (frame)
8278 multiple_frames = CONSP (tail); 8358 multiple_frames = CONSP (tail);
8279 8359
8280 /* Switch to the buffer of selected window of the frame. Set up 8360 /* Switch to the buffer of selected window of the frame. Set up
8281 frame_title_ptr so that display_mode_element will output into it; 8361 mode_line_target so that display_mode_element will output into
8282 then display the title. */ 8362 mode_line_noprop_buf; then display the title. */
8283 obuf = current_buffer; 8363 record_unwind_protect (unwind_format_mode_line,
8364 format_mode_line_unwind_data (current_buffer));
8365
8284 set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer)); 8366 set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer));
8285 fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; 8367 fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format;
8286 frame_title_ptr = frame_title_buf; 8368
8369 mode_line_target = MODE_LINE_TITLE;
8370 title_start = MODE_LINE_NOPROP_LEN (0);
8287 init_iterator (&it, XWINDOW (f->selected_window), -1, -1, 8371 init_iterator (&it, XWINDOW (f->selected_window), -1, -1,
8288 NULL, DEFAULT_FACE_ID); 8372 NULL, DEFAULT_FACE_ID);
8289 display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0); 8373 display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0);
8290 len = frame_title_ptr - frame_title_buf; 8374 len = MODE_LINE_NOPROP_LEN (title_start);
8291 frame_title_ptr = NULL; 8375 title = mode_line_noprop_buf + title_start;
8292 set_buffer_internal_1 (obuf); 8376 unbind_to (count, Qnil);
8293 8377
8294 /* Set the title only if it's changed. This avoids consing in 8378 /* Set the title only if it's changed. This avoids consing in
8295 the common case where it hasn't. (If it turns out that we've 8379 the common case where it hasn't. (If it turns out that we've
@@ -8298,8 +8382,8 @@ x_consider_frame_title (frame)
8298 higher level than this.) */ 8382 higher level than this.) */
8299 if (! STRINGP (f->name) 8383 if (! STRINGP (f->name)
8300 || SBYTES (f->name) != len 8384 || SBYTES (f->name) != len
8301 || bcmp (frame_title_buf, SDATA (f->name), len) != 0) 8385 || bcmp (title, SDATA (f->name), len) != 0)
8302 x_implicitly_set_name (f, make_string (frame_title_buf, len), Qnil); 8386 x_implicitly_set_name (f, make_string (title, len), Qnil);
8303 } 8387 }
8304} 8388}
8305 8389
@@ -15600,6 +15684,7 @@ display_mode_line (w, face_id, format)
15600{ 15684{
15601 struct it it; 15685 struct it it;
15602 struct face *face; 15686 struct face *face;
15687 int count = SPECPDL_INDEX ();
15603 15688
15604 init_iterator (&it, w, -1, -1, NULL, face_id); 15689 init_iterator (&it, w, -1, -1, NULL, face_id);
15605 prepare_desired_row (it.glyph_row); 15690 prepare_desired_row (it.glyph_row);
@@ -15610,6 +15695,11 @@ display_mode_line (w, face_id, format)
15610 /* Force the mode-line to be displayed in the default face. */ 15695 /* Force the mode-line to be displayed in the default face. */
15611 it.base_face_id = it.face_id = DEFAULT_FACE_ID; 15696 it.base_face_id = it.face_id = DEFAULT_FACE_ID;
15612 15697
15698 record_unwind_protect (unwind_format_mode_line,
15699 format_mode_line_unwind_data (NULL));
15700
15701 mode_line_target = MODE_LINE_DISPLAY;
15702
15613 /* Temporarily make frame's keyboard the current kboard so that 15703 /* Temporarily make frame's keyboard the current kboard so that
15614 kboard-local variables in the mode_line_format will get the right 15704 kboard-local variables in the mode_line_format will get the right
15615 values. */ 15705 values. */
@@ -15617,6 +15707,8 @@ display_mode_line (w, face_id, format)
15617 display_mode_element (&it, 0, 0, 0, format, Qnil, 0); 15707 display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
15618 pop_frame_kboard (); 15708 pop_frame_kboard ();
15619 15709
15710 unbind_to (count, Qnil);
15711
15620 /* Fill up with spaces. */ 15712 /* Fill up with spaces. */
15621 display_string (" ", Qnil, Qnil, 0, 0, &it, 10000, -1, -1, 0); 15713 display_string (" ", Qnil, Qnil, 0, 0, &it, 10000, -1, -1, 0);
15622 15714
@@ -15639,18 +15731,6 @@ display_mode_line (w, face_id, format)
15639 return it.glyph_row->height; 15731 return it.glyph_row->height;
15640} 15732}
15641 15733
15642/* Alist that caches the results of :propertize.
15643 Each element is (PROPERTIZED-STRING . PROPERTY-LIST). */
15644Lisp_Object mode_line_proptrans_alist;
15645
15646/* List of strings making up the mode-line. */
15647Lisp_Object mode_line_string_list;
15648
15649/* Base face property when building propertized mode line string. */
15650static Lisp_Object mode_line_string_face;
15651static Lisp_Object mode_line_string_face_prop;
15652
15653
15654/* Contribute ELT to the mode line for window IT->w. How it 15734/* Contribute ELT to the mode line for window IT->w. How it
15655 translates into text depends on its data type. 15735 translates into text depends on its data type.
15656 15736
@@ -15671,8 +15751,9 @@ static Lisp_Object mode_line_string_face_prop;
15671 If RISKY is nonzero, remove (disregard) any properties in any string 15751 If RISKY is nonzero, remove (disregard) any properties in any string
15672 we encounter, and ignore :eval and :propertize. 15752 we encounter, and ignore :eval and :propertize.
15673 15753
15674 If the global variable `frame_title_ptr' is non-NULL, then the output 15754 The global variable `mode_line_target' determines whether the
15675 is passed to `store_frame_title' instead of `display_string'. */ 15755 output is passed to `store_mode_line_noprop',
15756 `store_mode_line_string', or `display_string'. */
15676 15757
15677static int 15758static int
15678display_mode_element (it, depth, field_width, precision, elt, props, risky) 15759display_mode_element (it, depth, field_width, precision, elt, props, risky)
@@ -15761,21 +15842,27 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
15761 if (literal) 15842 if (literal)
15762 { 15843 {
15763 prec = precision - n; 15844 prec = precision - n;
15764 if (frame_title_ptr) 15845 switch (mode_line_target)
15765 n += store_frame_title (SDATA (elt), -1, prec); 15846 {
15766 else if (!NILP (mode_line_string_list)) 15847 case MODE_LINE_NOPROP:
15767 n += store_mode_line_string (NULL, elt, 1, 0, prec, Qnil); 15848 case MODE_LINE_TITLE:
15768 else 15849 n += store_mode_line_noprop (SDATA (elt), -1, prec);
15769 n += display_string (NULL, elt, Qnil, 0, 0, it, 15850 break;
15770 0, prec, 0, STRING_MULTIBYTE (elt)); 15851 case MODE_LINE_STRING:
15852 n += store_mode_line_string (NULL, elt, 1, 0, prec, Qnil);
15853 break;
15854 case MODE_LINE_DISPLAY:
15855 n += display_string (NULL, elt, Qnil, 0, 0, it,
15856 0, prec, 0, STRING_MULTIBYTE (elt));
15857 break;
15858 }
15771 15859
15772 break; 15860 break;
15773 } 15861 }
15774 15862
15775 while ((precision <= 0 || n < precision) 15863 while ((precision <= 0 || n < precision)
15776 && *this 15864 && *this
15777 && (frame_title_ptr 15865 && (mode_line_target != MODE_LINE_DISPLAY
15778 || !NILP (mode_line_string_list)
15779 || it->current_x < it->last_visible_x)) 15866 || it->current_x < it->last_visible_x))
15780 { 15867 {
15781 const unsigned char *last = this; 15868 const unsigned char *last = this;
@@ -15796,29 +15883,36 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
15796 prec = c_string_width (last, this - last, precision - n, 15883 prec = c_string_width (last, this - last, precision - n,
15797 &nchars, &nbytes); 15884 &nchars, &nbytes);
15798 15885
15799 if (frame_title_ptr) 15886 switch (mode_line_target)
15800 n += store_frame_title (last, 0, prec);
15801 else if (!NILP (mode_line_string_list))
15802 { 15887 {
15803 int bytepos = last - lisp_string; 15888 case MODE_LINE_NOPROP:
15804 int charpos = string_byte_to_char (elt, bytepos); 15889 case MODE_LINE_TITLE:
15805 int endpos = (precision <= 0 15890 n += store_mode_line_noprop (last, 0, prec);
15806 ? string_byte_to_char (elt, 15891 break;
15807 this - lisp_string) 15892 case MODE_LINE_STRING:
15808 : charpos + nchars); 15893 {
15809 15894 int bytepos = last - lisp_string;
15810 n += store_mode_line_string (NULL, 15895 int charpos = string_byte_to_char (elt, bytepos);
15811 Fsubstring (elt, make_number (charpos), 15896 int endpos = (precision <= 0
15812 make_number (endpos)), 15897 ? string_byte_to_char (elt,
15813 0, 0, 0, Qnil); 15898 this - lisp_string)
15814 } 15899 : charpos + nchars);
15815 else 15900
15816 { 15901 n += store_mode_line_string (NULL,
15817 int bytepos = last - lisp_string; 15902 Fsubstring (elt, make_number (charpos),
15818 int charpos = string_byte_to_char (elt, bytepos); 15903 make_number (endpos)),
15819 n += display_string (NULL, elt, Qnil, 0, charpos, 15904 0, 0, 0, Qnil);
15820 it, 0, prec, 0, 15905 }
15821 STRING_MULTIBYTE (elt)); 15906 break;
15907 case MODE_LINE_DISPLAY:
15908 {
15909 int bytepos = last - lisp_string;
15910 int charpos = string_byte_to_char (elt, bytepos);
15911 n += display_string (NULL, elt, Qnil, 0, charpos,
15912 it, 0, prec, 0,
15913 STRING_MULTIBYTE (elt));
15914 }
15915 break;
15822 } 15916 }
15823 } 15917 }
15824 else /* c == '%' */ 15918 else /* c == '%' */
@@ -15856,44 +15950,51 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
15856 spec 15950 spec
15857 = decode_mode_spec (it->w, c, field, prec, &multibyte); 15951 = decode_mode_spec (it->w, c, field, prec, &multibyte);
15858 15952
15859 if (frame_title_ptr) 15953 switch (mode_line_target)
15860 n += store_frame_title (spec, field, prec);
15861 else if (!NILP (mode_line_string_list))
15862 {
15863 int len = strlen (spec);
15864 Lisp_Object tem = make_string (spec, len);
15865 props = Ftext_properties_at (make_number (charpos), elt);
15866 /* Should only keep face property in props */
15867 n += store_mode_line_string (NULL, tem, 0, field, prec, props);
15868 }
15869 else
15870 { 15954 {
15871 int nglyphs_before, nwritten; 15955 case MODE_LINE_NOPROP:
15872 15956 case MODE_LINE_TITLE:
15873 nglyphs_before = it->glyph_row->used[TEXT_AREA]; 15957 n += store_mode_line_noprop (spec, field, prec);
15874 nwritten = display_string (spec, Qnil, elt, 15958 break;
15875 charpos, 0, it, 15959 case MODE_LINE_STRING:
15876 field, prec, 0, 15960 {
15877 multibyte); 15961 int len = strlen (spec);
15878 15962 Lisp_Object tem = make_string (spec, len);
15879 /* Assign to the glyphs written above the 15963 props = Ftext_properties_at (make_number (charpos), elt);
15880 string where the `%x' came from, position 15964 /* Should only keep face property in props */
15881 of the `%'. */ 15965 n += store_mode_line_string (NULL, tem, 0, field, prec, props);
15882 if (nwritten > 0) 15966 }
15883 { 15967 break;
15884 struct glyph *glyph 15968 case MODE_LINE_DISPLAY:
15885 = (it->glyph_row->glyphs[TEXT_AREA] 15969 {
15886 + nglyphs_before); 15970 int nglyphs_before, nwritten;
15887 int i; 15971
15888 15972 nglyphs_before = it->glyph_row->used[TEXT_AREA];
15889 for (i = 0; i < nwritten; ++i) 15973 nwritten = display_string (spec, Qnil, elt,
15890 { 15974 charpos, 0, it,
15891 glyph[i].object = elt; 15975 field, prec, 0,
15892 glyph[i].charpos = charpos; 15976 multibyte);
15893 } 15977
15894 15978 /* Assign to the glyphs written above the
15895 n += nwritten; 15979 string where the `%x' came from, position
15896 } 15980 of the `%'. */
15981 if (nwritten > 0)
15982 {
15983 struct glyph *glyph
15984 = (it->glyph_row->glyphs[TEXT_AREA]
15985 + nglyphs_before);
15986 int i;
15987
15988 for (i = 0; i < nwritten; ++i)
15989 {
15990 glyph[i].object = elt;
15991 glyph[i].charpos = charpos;
15992 }
15993
15994 n += nwritten;
15995 }
15996 }
15997 break;
15897 } 15998 }
15898 } 15999 }
15899 else /* c == 0 */ 16000 else /* c == 0 */
@@ -16064,13 +16165,20 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
16064 /* Pad to FIELD_WIDTH. */ 16165 /* Pad to FIELD_WIDTH. */
16065 if (field_width > 0 && n < field_width) 16166 if (field_width > 0 && n < field_width)
16066 { 16167 {
16067 if (frame_title_ptr) 16168 switch (mode_line_target)
16068 n += store_frame_title ("", field_width - n, 0); 16169 {
16069 else if (!NILP (mode_line_string_list)) 16170 case MODE_LINE_NOPROP:
16070 n += store_mode_line_string ("", Qnil, 0, field_width - n, 0, Qnil); 16171 case MODE_LINE_TITLE:
16071 else 16172 n += store_mode_line_noprop ("", field_width - n, 0);
16072 n += display_string ("", Qnil, Qnil, 0, 0, it, field_width - n, 16173 break;
16073 0, 0, 0); 16174 case MODE_LINE_STRING:
16175 n += store_mode_line_string ("", Qnil, 0, field_width - n, 0, Qnil);
16176 break;
16177 case MODE_LINE_DISPLAY:
16178 n += display_string ("", Qnil, Qnil, 0, 0, it, field_width - n,
16179 0, 0, 0);
16180 break;
16181 }
16074 } 16182 }
16075 16183
16076 return n; 16184 return n;
@@ -16202,6 +16310,9 @@ are the selected window and the window's buffer). */)
16202 struct buffer *old_buffer = NULL; 16310 struct buffer *old_buffer = NULL;
16203 int face_id = -1; 16311 int face_id = -1;
16204 int no_props = INTEGERP (face); 16312 int no_props = INTEGERP (face);
16313 int count = SPECPDL_INDEX ();
16314 Lisp_Object str;
16315 int string_start = 0;
16205 16316
16206 if (NILP (window)) 16317 if (NILP (window))
16207 window = selected_window; 16318 window = selected_window;
@@ -16229,64 +16340,50 @@ are the selected window and the window's buffer). */)
16229 face_id = DEFAULT_FACE_ID; 16340 face_id = DEFAULT_FACE_ID;
16230 16341
16231 if (XBUFFER (buffer) != current_buffer) 16342 if (XBUFFER (buffer) != current_buffer)
16232 { 16343 old_buffer = current_buffer;
16233 old_buffer = current_buffer; 16344
16234 set_buffer_internal_1 (XBUFFER (buffer)); 16345 record_unwind_protect (unwind_format_mode_line,
16235 } 16346 format_mode_line_unwind_data (old_buffer));
16347
16348 if (old_buffer)
16349 set_buffer_internal_1 (XBUFFER (buffer));
16236 16350
16237 init_iterator (&it, w, -1, -1, NULL, face_id); 16351 init_iterator (&it, w, -1, -1, NULL, face_id);
16238 16352
16239 if (!no_props) 16353 if (no_props)
16240 { 16354 {
16241 mode_line_string_face = face; 16355 mode_line_target = MODE_LINE_NOPROP;
16242 mode_line_string_face_prop 16356 mode_line_string_face_prop = Qnil;
16243 = (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil))); 16357 mode_line_string_list = Qnil;
16244 16358 string_start = MODE_LINE_NOPROP_LEN (0);
16245 /* We need a dummy last element in mode_line_string_list to
16246 indicate we are building the propertized mode-line string.
16247 Using mode_line_string_face_prop here GC protects it. */
16248 mode_line_string_list
16249 = Fcons (mode_line_string_face_prop, Qnil);
16250 frame_title_ptr = NULL;
16251 } 16359 }
16252 else 16360 else
16253 { 16361 {
16254 mode_line_string_face_prop = Qnil; 16362 mode_line_target = MODE_LINE_STRING;
16255 mode_line_string_list = Qnil; 16363 mode_line_string_list = Qnil;
16256 frame_title_ptr = frame_title_buf; 16364 mode_line_string_face = face;
16365 mode_line_string_face_prop
16366 = (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil)));
16257 } 16367 }
16258 16368
16259 push_frame_kboard (it.f); 16369 push_frame_kboard (it.f);
16260 display_mode_element (&it, 0, 0, 0, format, Qnil, 0); 16370 display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
16261 pop_frame_kboard (); 16371 pop_frame_kboard ();
16262 16372
16263 if (old_buffer) 16373 if (no_props)
16264 set_buffer_internal_1 (old_buffer);
16265
16266 if (!no_props)
16267 { 16374 {
16268 Lisp_Object str; 16375 len = MODE_LINE_NOPROP_LEN (string_start);
16269 mode_line_string_list = Fnreverse (mode_line_string_list); 16376 str = make_string (mode_line_noprop_buf + string_start, len);
16270 str = Fmapconcat (intern ("identity"), XCDR (mode_line_string_list),
16271 make_string ("", 0));
16272 mode_line_string_face_prop = Qnil;
16273 mode_line_string_list = Qnil;
16274 return str;
16275 } 16377 }
16276 16378 else
16277 len = frame_title_ptr - frame_title_buf;
16278 if (len > 0 && frame_title_ptr[-1] == '-')
16279 { 16379 {
16280 /* Mode lines typically ends with numerous dashes; reduce to two dashes. */ 16380 mode_line_string_list = Fnreverse (mode_line_string_list);
16281 while (frame_title_ptr > frame_title_buf && *--frame_title_ptr == '-') 16381 str = Fmapconcat (intern ("identity"), mode_line_string_list,
16282 ; 16382 make_string ("", 0));
16283 frame_title_ptr += 3; /* restore last non-dash + two dashes */
16284 if (len > frame_title_ptr - frame_title_buf)
16285 len = frame_title_ptr - frame_title_buf;
16286 } 16383 }
16287 16384
16288 frame_title_ptr = NULL; 16385 unbind_to (count, Qnil);
16289 return make_string (frame_title_buf, len); 16386 return str;
16290} 16387}
16291 16388
16292/* Write a null-terminated, right justified decimal representation of 16389/* Write a null-terminated, right justified decimal representation of
@@ -16604,7 +16701,8 @@ decode_mode_spec (w, c, field_width, precision, multibyte)
16604 register int i; 16701 register int i;
16605 16702
16606 /* Let lots_of_dashes be a string of infinite length. */ 16703 /* Let lots_of_dashes be a string of infinite length. */
16607 if (!NILP (mode_line_string_list)) 16704 if (mode_line_target == MODE_LINE_NOPROP ||
16705 mode_line_target == MODE_LINE_STRING)
16608 return "--"; 16706 return "--";
16609 if (field_width <= 0 16707 if (field_width <= 0
16610 || field_width > sizeof (lots_of_dashes)) 16708 || field_width > sizeof (lots_of_dashes))
@@ -21407,7 +21505,7 @@ note_mode_line_or_margin_highlight (window, x, y, area)
21407 tmp_glyph->charpos >= XINT (b); 21505 tmp_glyph->charpos >= XINT (b);
21408 tmp_glyph--, gpos++) 21506 tmp_glyph--, gpos++)
21409 { 21507 {
21410 if (tmp_glyph->object != glyph->object) 21508 if (!EQ (tmp_glyph->object, glyph->object))
21411 break; 21509 break;
21412 } 21510 }
21413 21511
@@ -21420,7 +21518,7 @@ note_mode_line_or_margin_highlight (window, x, y, area)
21420 tmp_glyph->charpos < XINT (e); 21518 tmp_glyph->charpos < XINT (e);
21421 tmp_glyph++, gseq_length++) 21519 tmp_glyph++, gseq_length++)
21422 { 21520 {
21423 if (tmp_glyph->object != glyph->object) 21521 if (!EQ (tmp_glyph->object, glyph->object))
21424 break; 21522 break;
21425 } 21523 }
21426 21524
@@ -22698,9 +22796,14 @@ syms_of_xdisp ()
22698 22796
22699 mode_line_proptrans_alist = Qnil; 22797 mode_line_proptrans_alist = Qnil;
22700 staticpro (&mode_line_proptrans_alist); 22798 staticpro (&mode_line_proptrans_alist);
22701
22702 mode_line_string_list = Qnil; 22799 mode_line_string_list = Qnil;
22703 staticpro (&mode_line_string_list); 22800 staticpro (&mode_line_string_list);
22801 mode_line_string_face = Qnil;
22802 staticpro (&mode_line_string_face);
22803 mode_line_string_face_prop = Qnil;
22804 staticpro (&mode_line_string_face_prop);
22805 Vmode_line_unwind_vector = Qnil;
22806 staticpro (&Vmode_line_unwind_vector);
22704 22807
22705 help_echo_string = Qnil; 22808 help_echo_string = Qnil;
22706 staticpro (&help_echo_string); 22809 staticpro (&help_echo_string);
@@ -23050,9 +23153,10 @@ init_xdisp ()
23050 /* Allocate the buffer for frame titles. 23153 /* Allocate the buffer for frame titles.
23051 Also used for `format-mode-line'. */ 23154 Also used for `format-mode-line'. */
23052 int size = 100; 23155 int size = 100;
23053 frame_title_buf = (char *) xmalloc (size); 23156 mode_line_noprop_buf = (char *) xmalloc (size);
23054 frame_title_buf_end = frame_title_buf + size; 23157 mode_line_noprop_buf_end = mode_line_noprop_buf + size;
23055 frame_title_ptr = NULL; 23158 mode_line_noprop_ptr = mode_line_noprop_buf;
23159 mode_line_target = MODE_LINE_DISPLAY;
23056 } 23160 }
23057 23161
23058 help_echo_showing_p = 0; 23162 help_echo_showing_p = 0;
diff --git a/src/xfaces.c b/src/xfaces.c
index 2884bccb3b9..953276aef83 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6452,12 +6452,12 @@ build_scalable_font_name (f, font, specified_pt)
6452 if (font->numeric[XLFD_RESY] != 0) 6452 if (font->numeric[XLFD_RESY] != 0)
6453 { 6453 {
6454 pt = resy / font->numeric[XLFD_RESY] * specified_pt + 0.5; 6454 pt = resy / font->numeric[XLFD_RESY] * specified_pt + 0.5;
6455 pixel_value = font->numeric[XLFD_RESY] / (PT_PER_INCH * 10.0) * pt; 6455 pixel_value = font->numeric[XLFD_RESY] / (PT_PER_INCH * 10.0) * pt + 0.5;
6456 } 6456 }
6457 else 6457 else
6458 { 6458 {
6459 pt = specified_pt; 6459 pt = specified_pt;
6460 pixel_value = resy / (PT_PER_INCH * 10.0) * pt; 6460 pixel_value = resy / (PT_PER_INCH * 10.0) * pt + 0.5;
6461 } 6461 }
6462 /* We may need a font of the different size. */ 6462 /* We may need a font of the different size. */
6463 pixel_value *= font->rescale_ratio; 6463 pixel_value *= font->rescale_ratio;