aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2012-07-08 19:38:43 +0300
committerEli Zaretskii2012-07-08 19:38:43 +0300
commit3434fe8a236bb8fcb098c713b6383810c16a721d (patch)
tree3fa377aca0211995ad335e5d9a81c84229f05f26 /src
parentc4b3bc8aaf01a9e3fdd14072ae49316ae4fb4f3b (diff)
downloademacs-3434fe8a236bb8fcb098c713b6383810c16a721d.tar.gz
emacs-3434fe8a236bb8fcb098c713b6383810c16a721d.zip
Cleanup changes following fix for bug #11832.
src/ xdisp.c (display_line): Add commentary about displaying truncation glyphs on GUI frames. (produce_special_glyphs): Move here from term.c. src/term.c (produce_special_glyphs): Move to xdisp.c. src/dispextern.h (produce_special_glyphs): Move prototype to xdisp.c section.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/dispextern.h3
-rw-r--r--src/term.c61
-rw-r--r--src/xdisp.c66
4 files changed, 75 insertions, 63 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2fc91007719..98a4f978830 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -2,6 +2,14 @@
2 2
3 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph 3 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4 has no font, use the frame's font. (Bug#11813) 4 has no font, use the frame's font. (Bug#11813)
5 (display_line): Add commentary about displaying truncation glyphs
6 on GUI frames.
7 (produce_special_glyphs): Move here from term.c.
8
9 * term.c (produce_special_glyphs): Move to xdisp.c.
10
11 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
12 section.
5 13
62012-07-07 Andreas Schwab <schwab@linux-m68k.org> 142012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7 15
diff --git a/src/dispextern.h b/src/dispextern.h
index 7d9f913e4f1..b08d6107b80 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3065,7 +3065,7 @@ extern ptrdiff_t compute_display_string_pos (struct text_pos *,
3065extern ptrdiff_t compute_display_string_end (ptrdiff_t, 3065extern ptrdiff_t compute_display_string_end (ptrdiff_t,
3066 struct bidi_string_data *); 3066 struct bidi_string_data *);
3067extern void produce_stretch_glyph (struct it *); 3067extern void produce_stretch_glyph (struct it *);
3068 3068extern void produce_special_glyphs (struct it *, enum display_element_type);
3069 3069
3070#ifdef HAVE_WINDOW_SYSTEM 3070#ifdef HAVE_WINDOW_SYSTEM
3071 3071
@@ -3353,7 +3353,6 @@ extern int string_cost (const char *);
3353extern int per_line_cost (const char *); 3353extern int per_line_cost (const char *);
3354extern void calculate_costs (struct frame *); 3354extern void calculate_costs (struct frame *);
3355extern void produce_glyphs (struct it *); 3355extern void produce_glyphs (struct it *);
3356extern void produce_special_glyphs (struct it *, enum display_element_type);
3357extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long); 3356extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long);
3358extern void set_tty_color_mode (struct tty_display_info *, struct frame *); 3357extern void set_tty_color_mode (struct tty_display_info *, struct frame *);
3359extern struct terminal *get_named_tty (const char *); 3358extern struct terminal *get_named_tty (const char *);
diff --git a/src/term.c b/src/term.c
index 900818559cd..4d73f896d21 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1885,67 +1885,6 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
1885 append_glyphless_glyph (it, face_id, str); 1885 append_glyphless_glyph (it, face_id, str);
1886} 1886}
1887 1887
1888
1889/* Get information about special display element WHAT in an
1890 environment described by IT. WHAT is one of IT_TRUNCATION or
1891 IT_CONTINUATION. Maybe produce glyphs for WHAT if IT has a
1892 non-null glyph_row member. This function ensures that fields like
1893 face_id, c, len of IT are left untouched. */
1894
1895void
1896produce_special_glyphs (struct it *it, enum display_element_type what)
1897{
1898 struct it temp_it;
1899 Lisp_Object gc;
1900 GLYPH glyph;
1901
1902 temp_it = *it;
1903 temp_it.dp = NULL;
1904 temp_it.what = IT_CHARACTER;
1905 temp_it.len = 1;
1906 temp_it.object = make_number (0);
1907 memset (&temp_it.current, 0, sizeof temp_it.current);
1908
1909 if (what == IT_CONTINUATION)
1910 {
1911 /* Continuation glyph. For R2L lines, we mirror it by hand. */
1912 if (it->bidi_it.paragraph_dir == R2L)
1913 SET_GLYPH_FROM_CHAR (glyph, '/');
1914 else
1915 SET_GLYPH_FROM_CHAR (glyph, '\\');
1916 if (it->dp
1917 && (gc = DISP_CONTINUE_GLYPH (it->dp), GLYPH_CODE_P (gc)))
1918 {
1919 /* FIXME: Should we mirror GC for R2L lines? */
1920 SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
1921 spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
1922 }
1923 }
1924 else if (what == IT_TRUNCATION)
1925 {
1926 /* Truncation glyph. */
1927 SET_GLYPH_FROM_CHAR (glyph, '$');
1928 if (it->dp
1929 && (gc = DISP_TRUNC_GLYPH (it->dp), GLYPH_CODE_P (gc)))
1930 {
1931 /* FIXME: Should we mirror GC for R2L lines? */
1932 SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
1933 spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
1934 }
1935 }
1936 else
1937 abort ();
1938
1939 temp_it.c = temp_it.char_to_display = GLYPH_CHAR (glyph);
1940 temp_it.face_id = GLYPH_FACE (glyph);
1941 temp_it.len = CHAR_BYTES (temp_it.c);
1942
1943 PRODUCE_GLYPHS (&temp_it);
1944 it->pixel_width = temp_it.pixel_width;
1945 it->nglyphs = temp_it.pixel_width;
1946}
1947
1948
1949 1888
1950/*********************************************************************** 1889/***********************************************************************
1951 Faces 1890 Faces
diff --git a/src/xdisp.c b/src/xdisp.c
index 3a485f6a5a9..9018dce37fa 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -19773,6 +19773,13 @@ display_line (struct it *it)
19773#ifdef HAVE_WINDOW_SYSTEM 19773#ifdef HAVE_WINDOW_SYSTEM
19774 else 19774 else
19775 { 19775 {
19776 /* On a GUI frame, when the right fringe (left
19777 fringe for R2L rows) is turned off, we produce
19778 truncation glyphs preceded by a stretch glyph
19779 whose width is computed such that the truncation
19780 glyphs are aligned at the window margin, even
19781 when very different fonts are used in different
19782 glyph rows. */
19776 int stretch_width = it->last_visible_x - it->current_x; 19783 int stretch_width = it->last_visible_x - it->current_x;
19777 19784
19778 row->used[TEXT_AREA] = i; 19785 row->used[TEXT_AREA] = i;
@@ -24196,6 +24203,65 @@ produce_stretch_glyph (struct it *it)
24196 it->nglyphs = width; 24203 it->nglyphs = width;
24197} 24204}
24198 24205
24206/* Get information about special display element WHAT in an
24207 environment described by IT. WHAT is one of IT_TRUNCATION or
24208 IT_CONTINUATION. Maybe produce glyphs for WHAT if IT has a
24209 non-null glyph_row member. This function ensures that fields like
24210 face_id, c, len of IT are left untouched. */
24211
24212void
24213produce_special_glyphs (struct it *it, enum display_element_type what)
24214{
24215 struct it temp_it;
24216 Lisp_Object gc;
24217 GLYPH glyph;
24218
24219 temp_it = *it;
24220 temp_it.dp = NULL;
24221 temp_it.what = IT_CHARACTER;
24222 temp_it.len = 1;
24223 temp_it.object = make_number (0);
24224 memset (&temp_it.current, 0, sizeof temp_it.current);
24225
24226 if (what == IT_CONTINUATION)
24227 {
24228 /* Continuation glyph. For R2L lines, we mirror it by hand. */
24229 if (it->bidi_it.paragraph_dir == R2L)
24230 SET_GLYPH_FROM_CHAR (glyph, '/');
24231 else
24232 SET_GLYPH_FROM_CHAR (glyph, '\\');
24233 if (it->dp
24234 && (gc = DISP_CONTINUE_GLYPH (it->dp), GLYPH_CODE_P (gc)))
24235 {
24236 /* FIXME: Should we mirror GC for R2L lines? */
24237 SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
24238 spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
24239 }
24240 }
24241 else if (what == IT_TRUNCATION)
24242 {
24243 /* Truncation glyph. */
24244 SET_GLYPH_FROM_CHAR (glyph, '$');
24245 if (it->dp
24246 && (gc = DISP_TRUNC_GLYPH (it->dp), GLYPH_CODE_P (gc)))
24247 {
24248 /* FIXME: Should we mirror GC for R2L lines? */
24249 SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
24250 spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
24251 }
24252 }
24253 else
24254 abort ();
24255
24256 temp_it.c = temp_it.char_to_display = GLYPH_CHAR (glyph);
24257 temp_it.face_id = GLYPH_FACE (glyph);
24258 temp_it.len = CHAR_BYTES (temp_it.c);
24259
24260 PRODUCE_GLYPHS (&temp_it);
24261 it->pixel_width = temp_it.pixel_width;
24262 it->nglyphs = temp_it.pixel_width;
24263}
24264
24199#ifdef HAVE_WINDOW_SYSTEM 24265#ifdef HAVE_WINDOW_SYSTEM
24200 24266
24201/* Calculate line-height and line-spacing properties. 24267/* Calculate line-height and line-spacing properties.