diff options
| author | Stefan Monnier | 2008-06-10 20:22:10 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-06-10 20:22:10 +0000 |
| commit | 2a3bd2e19336d9a83349575859cfb4842c2ec861 (patch) | |
| tree | 99185c9d37c39d003f8b6395e03aa9c866be64f3 | |
| parent | d5dc61631e773495e96ed2bbd3bca16c981e9f7e (diff) | |
| download | emacs-2a3bd2e19336d9a83349575859cfb4842c2ec861.tar.gz emacs-2a3bd2e19336d9a83349575859cfb4842c2ec861.zip | |
* xdisp.c (underline_minimum_offset): Rename from xterm.c's
x_underline_minimum_display_offset.
(syms_of_xdisp): Declare it here rather than in xterm.c.
* dispextern.h (underline_minimum_offset): Declare it.
* w32term.c (x_draw_glyph_string): Use it.
* xterm.c (x_underline_minimum_display_offset): Move to xdisp.c.
(syms_of_xterm): Don't declare it any more.
(x_draw_glyph_string): Adjust to the new name.
* cus-start.el (underline-minimum-offset) Rename from
x-underline-minimum-display-offset.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/cus-start.el | 2 | ||||
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/dispextern.h | 1 | ||||
| -rw-r--r-- | src/macterm.c | 2 | ||||
| -rw-r--r-- | src/w32term.c | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 15 | ||||
| -rw-r--r-- | src/xterm.c | 23 |
8 files changed, 38 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2472e3f6112..5fecf72d882 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-06-10 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * cus-start.el (underline-minimum-offset) Rename from | ||
| 4 | x-underline-minimum-display-offset. | ||
| 5 | |||
| 1 | 2008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change) | 6 | 2008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change) |
| 2 | 7 | ||
| 3 | * cus-start.el (x-underline-minimum-display-offset): Give it a type. | 8 | * cus-start.el (x-underline-minimum-display-offset): Give it a type. |
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 73150ce8f7c..302d6689186 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -331,6 +331,7 @@ since it could result in memory overflow and make Emacs crash." | |||
| 331 | (unibyte-display-via-language-environment mule boolean) | 331 | (unibyte-display-via-language-environment mule boolean) |
| 332 | (blink-cursor-alist cursor alist "22.1") | 332 | (blink-cursor-alist cursor alist "22.1") |
| 333 | (overline-margin display integer "22.1") | 333 | (overline-margin display integer "22.1") |
| 334 | (underline-minimum-offset display integer "23.1") | ||
| 334 | (mouse-autoselect-window | 335 | (mouse-autoselect-window |
| 335 | display (choice | 336 | display (choice |
| 336 | (const :tag "Off (nil)" :value nil) | 337 | (const :tag "Off (nil)" :value nil) |
| @@ -348,7 +349,6 @@ since it could result in memory overflow and make Emacs crash." | |||
| 348 | ;; xterm.c | 349 | ;; xterm.c |
| 349 | (x-use-underline-position-properties display boolean "22.1") | 350 | (x-use-underline-position-properties display boolean "22.1") |
| 350 | (x-underline-at-descent-line display boolean "22.1") | 351 | (x-underline-at-descent-line display boolean "22.1") |
| 351 | (x-underline-minimum-display-offset display integer "23.1") | ||
| 352 | (x-stretch-cursor display boolean "21.1"))) | 352 | (x-stretch-cursor display boolean "21.1"))) |
| 353 | this symbol group type standard version native-p | 353 | this symbol group type standard version native-p |
| 354 | ;; This function turns a value | 354 | ;; This function turns a value |
diff --git a/src/ChangeLog b/src/ChangeLog index 2716320139b..942db16bea3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2008-06-10 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * xdisp.c (underline_minimum_offset): Rename from xterm.c's | ||
| 4 | x_underline_minimum_display_offset. | ||
| 5 | (syms_of_xdisp): Declare it here rather than in xterm.c. | ||
| 6 | * dispextern.h (underline_minimum_offset): Declare it. | ||
| 7 | * w32term.c (x_draw_glyph_string): Use it. | ||
| 8 | * xterm.c (x_underline_minimum_display_offset): Move to xdisp.c. | ||
| 9 | (syms_of_xterm): Don't declare it any more. | ||
| 10 | (x_draw_glyph_string): Adjust to the new name. | ||
| 11 | |||
| 1 | 2008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change) | 12 | 2008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change) |
| 2 | 13 | ||
| 3 | * xterm.c (x_underline_minimum_display_offset): New var. | 14 | * xterm.c (x_underline_minimum_display_offset): New var. |
diff --git a/src/dispextern.h b/src/dispextern.h index 969f1c55021..883fa431724 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2705,6 +2705,7 @@ extern struct frame *last_mouse_frame; | |||
| 2705 | extern int last_tool_bar_item; | 2705 | extern int last_tool_bar_item; |
| 2706 | extern Lisp_Object Vmouse_autoselect_window; | 2706 | extern Lisp_Object Vmouse_autoselect_window; |
| 2707 | extern int unibyte_display_via_language_environment; | 2707 | extern int unibyte_display_via_language_environment; |
| 2708 | extern EMACS_INT underline_minimum_offset; | ||
| 2708 | 2709 | ||
| 2709 | extern void reseat_at_previous_visible_line_start P_ ((struct it *)); | 2710 | extern void reseat_at_previous_visible_line_start P_ ((struct it *)); |
| 2710 | 2711 | ||
diff --git a/src/macterm.c b/src/macterm.c index 2871bfa1179..b20857317d9 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -4083,7 +4083,7 @@ x_draw_glyph_string (s) | |||
| 4083 | if (s->face->font) | 4083 | if (s->face->font) |
| 4084 | y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; | 4084 | y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; |
| 4085 | } | 4085 | } |
| 4086 | 4086 | /* FIXME: Obey underline_minimum_offset. */ | |
| 4087 | if (s->face->underline_defaulted_p) | 4087 | if (s->face->underline_defaulted_p) |
| 4088 | mac_fill_rectangle (s->f, s->gc, s->x, y, | 4088 | mac_fill_rectangle (s->f, s->gc, s->x, y, |
| 4089 | s->background_width, h); | 4089 | s->background_width, h); |
diff --git a/src/w32term.c b/src/w32term.c index 63d8a1518fe..7880b8abc10 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -2910,6 +2910,7 @@ x_draw_glyph_string (s) | |||
| 2910 | else if (s->font) | 2910 | else if (s->font) |
| 2911 | position = (s->font->descent + 1) / 2; | 2911 | position = (s->font->descent + 1) / 2; |
| 2912 | } | 2912 | } |
| 2913 | position = max (position, underline_minimum_offset); | ||
| 2913 | } | 2914 | } |
| 2914 | /* Check the sanity of thickness and position. We should | 2915 | /* Check the sanity of thickness and position. We should |
| 2915 | avoid drawing underline out of the current line area. */ | 2916 | avoid drawing underline out of the current line area. */ |
diff --git a/src/xdisp.c b/src/xdisp.c index b248cba8e9d..99d55f3b143 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -715,6 +715,12 @@ struct buffer *displayed_buffer; | |||
| 715 | 715 | ||
| 716 | EMACS_INT overline_margin; | 716 | EMACS_INT overline_margin; |
| 717 | 717 | ||
| 718 | /* Require underline to be at least this many screen pixels below baseline | ||
| 719 | This to avoid underline "merging" with the base of letters at small | ||
| 720 | font sizes, particularly when x_use_underline_position_properties is on. */ | ||
| 721 | |||
| 722 | EMACS_INT underline_minimum_offset; | ||
| 723 | |||
| 718 | /* Value returned from text property handlers (see below). */ | 724 | /* Value returned from text property handlers (see below). */ |
| 719 | 725 | ||
| 720 | enum prop_handled | 726 | enum prop_handled |
| @@ -24801,6 +24807,15 @@ The enable predicate for a menu binding should check this variable. */); | |||
| 24801 | The default value is 2: the height of the overline (1 pixel) plus 1 pixel | 24807 | The default value is 2: the height of the overline (1 pixel) plus 1 pixel |
| 24802 | margin to the caracter height. */); | 24808 | margin to the caracter height. */); |
| 24803 | overline_margin = 2; | 24809 | overline_margin = 2; |
| 24810 | |||
| 24811 | DEFVAR_INT ("underline-minimum-offset", | ||
| 24812 | &underline_minimum_offset, | ||
| 24813 | doc: /* Minimum distance between baseline and underline. | ||
| 24814 | This can improve legibility of underlined text at small font sizes, | ||
| 24815 | particularly when using variable `x-use-underline-position-properties' | ||
| 24816 | with fonts that specify an UNDERLINE_POSITION relatively close to the | ||
| 24817 | baseline. The default value is 0. */); | ||
| 24818 | underline_minimum_offset = 0; | ||
| 24804 | } | 24819 | } |
| 24805 | 24820 | ||
| 24806 | 24821 | ||
diff --git a/src/xterm.c b/src/xterm.c index 13c2d2e4a97..d2222b4a9b9 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -183,12 +183,6 @@ int x_use_underline_position_properties; | |||
| 183 | 183 | ||
| 184 | int x_underline_at_descent_line; | 184 | int x_underline_at_descent_line; |
| 185 | 185 | ||
| 186 | /* Require underline to be at least this many screen pixels below baseline | ||
| 187 | This to avoid underline "merging" with the base of letters at small | ||
| 188 | font sizes, particularly when x_use_underline_position_properties is on. */ | ||
| 189 | |||
| 190 | int x_underline_minimum_display_offset; | ||
| 191 | |||
| 192 | /* This is a chain of structures for all the X displays currently in | 186 | /* This is a chain of structures for all the X displays currently in |
| 193 | use. */ | 187 | use. */ |
| 194 | 188 | ||
| @@ -2750,8 +2744,7 @@ x_draw_glyph_string (s) | |||
| 2750 | else if (s->font) | 2744 | else if (s->font) |
| 2751 | position = (s->font->descent + 1) / 2; | 2745 | position = (s->font->descent + 1) / 2; |
| 2752 | } | 2746 | } |
| 2753 | if (x_underline_minimum_display_offset) | 2747 | position = max (position, underline_minimum_offset); |
| 2754 | position = max (position, eabs (x_underline_minimum_display_offset)); | ||
| 2755 | } | 2748 | } |
| 2756 | /* Check the sanity of thickness and position. We should | 2749 | /* Check the sanity of thickness and position. We should |
| 2757 | avoid drawing underline out of the current line area. */ | 2750 | avoid drawing underline out of the current line area. */ |
| @@ -10789,8 +10782,8 @@ syms_of_xterm () | |||
| 10789 | doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties. | 10782 | doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties. |
| 10790 | A value of nil means ignore them. If you encounter fonts with bogus | 10783 | A value of nil means ignore them. If you encounter fonts with bogus |
| 10791 | UNDERLINE_POSITION font properties, for example 7x13 on XFree prior | 10784 | UNDERLINE_POSITION font properties, for example 7x13 on XFree prior |
| 10792 | to 4.1, set this to nil. Variable `x-underline-minimum-display-offset' may | 10785 | to 4.1, set this to nil. You can also use `underline-minimum-offset' |
| 10793 | be used to override the font's UNDERLINE_POSITION for small font display | 10786 | to override the font's UNDERLINE_POSITION for small font display |
| 10794 | sizes. */); | 10787 | sizes. */); |
| 10795 | x_use_underline_position_properties = 1; | 10788 | x_use_underline_position_properties = 1; |
| 10796 | 10789 | ||
| @@ -10802,16 +10795,6 @@ variable `x-use-underline-position-properties', which is usually at the | |||
| 10802 | baseline level. The default value is nil. */); | 10795 | baseline level. The default value is nil. */); |
| 10803 | x_underline_at_descent_line = 0; | 10796 | x_underline_at_descent_line = 0; |
| 10804 | 10797 | ||
| 10805 | DEFVAR_INT ("x-underline-minimum-display-offset", | ||
| 10806 | &x_underline_minimum_display_offset, | ||
| 10807 | doc: /* *When > 0, underline is drawn at least that many screen pixels below baseline. | ||
| 10808 | This can improve legibility of underlined text at small font sizes, | ||
| 10809 | particularly when using variable `x-use-underline-position-properties' | ||
| 10810 | with fonts that specify an UNDERLINE_POSITION relatively close to the | ||
| 10811 | baseline. The default value is 0. */); | ||
| 10812 | x_underline_minimum_display_offset = 0; | ||
| 10813 | |||
| 10814 | |||
| 10815 | DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", | 10798 | DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", |
| 10816 | &x_mouse_click_focus_ignore_position, | 10799 | &x_mouse_click_focus_ignore_position, |
| 10817 | doc: /* Non-nil means that a mouse click to focus a frame does not move point. | 10800 | doc: /* Non-nil means that a mouse click to focus a frame does not move point. |