summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2008-06-10 20:22:10 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2008-06-10 20:22:10 +0000
commit2a3bd2e19336d9a83349575859cfb4842c2ec861 (patch)
tree99185c9d37c39d003f8b6395e03aa9c866be64f3
parentd5dc61631e773495e96ed2bbd3bca16c981e9f7e (diff)
* 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/ChangeLog5
-rw-r--r--lisp/cus-start.el2
-rw-r--r--src/ChangeLog11
-rw-r--r--src/dispextern.h1
-rw-r--r--src/macterm.c2
-rw-r--r--src/w32term.c1
-rw-r--r--src/xdisp.c15
-rw-r--r--src/xterm.c23
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 @@
+2008-06-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * cus-start.el (underline-minimum-offset) Rename from
+ x-underline-minimum-display-offset.
+
2008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change)
* 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."
(unibyte-display-via-language-environment mule boolean)
(blink-cursor-alist cursor alist "22.1")
(overline-margin display integer "22.1")
+ (underline-minimum-offset display integer "23.1")
(mouse-autoselect-window
display (choice
(const :tag "Off (nil)" :value nil)
@@ -348,7 +349,6 @@ since it could result in memory overflow and make Emacs crash."
;; xterm.c
(x-use-underline-position-properties display boolean "22.1")
(x-underline-at-descent-line display boolean "22.1")
- (x-underline-minimum-display-offset display integer "23.1")
(x-stretch-cursor display boolean "21.1")))
this symbol group type standard version native-p
;; 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 @@
+2008-06-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * 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.
+
2008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change)
* 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;
extern int last_tool_bar_item;
extern Lisp_Object Vmouse_autoselect_window;
extern int unibyte_display_via_language_environment;
+extern EMACS_INT underline_minimum_offset;
extern void reseat_at_previous_visible_line_start P_ ((struct it *));
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)
if (s->face->font)
y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
}
-
+ /* FIXME: Obey underline_minimum_offset. */
if (s->face->underline_defaulted_p)
mac_fill_rectangle (s->f, s->gc, s->x, y,
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)
else if (s->font)
position = (s->font->descent + 1) / 2;
}
+ position = max (position, underline_minimum_offset);
}
/* Check the sanity of thickness and position. We should
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;
EMACS_INT overline_margin;
+/* Require underline to be at least this many screen pixels below baseline
+ This to avoid underline "merging" with the base of letters at small
+ font sizes, particularly when x_use_underline_position_properties is on. */
+
+EMACS_INT underline_minimum_offset;
+
/* Value returned from text property handlers (see below). */
enum prop_handled
@@ -24801,6 +24807,15 @@ The enable predicate for a menu binding should check this variable. */);
The default value is 2: the height of the overline (1 pixel) plus 1 pixel
margin to the caracter height. */);
overline_margin = 2;
+
+ DEFVAR_INT ("underline-minimum-offset",
+ &underline_minimum_offset,
+ doc: /* Minimum distance between baseline and underline.
+This can improve legibility of underlined text at small font sizes,
+particularly when using variable `x-use-underline-position-properties'
+with fonts that specify an UNDERLINE_POSITION relatively close to the
+baseline. The default value is 0. */);
+ underline_minimum_offset = 0;
}
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;
int x_underline_at_descent_line;
-/* Require underline to be at least this many screen pixels below baseline
- This to avoid underline "merging" with the base of letters at small
- font sizes, particularly when x_use_underline_position_properties is on. */
-
-int x_underline_minimum_display_offset;
-
/* This is a chain of structures for all the X displays currently in
use. */
@@ -2750,8 +2744,7 @@ x_draw_glyph_string (s)
else if (s->font)
position = (s->font->descent + 1) / 2;
}
- if (x_underline_minimum_display_offset)
- position = max (position, eabs (x_underline_minimum_display_offset));
+ position = max (position, underline_minimum_offset);
}
/* Check the sanity of thickness and position. We should
avoid drawing underline out of the current line area. */
@@ -10789,8 +10782,8 @@ syms_of_xterm ()
doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
A value of nil means ignore them. If you encounter fonts with bogus
UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
-to 4.1, set this to nil. Variable `x-underline-minimum-display-offset' may
-be used to override the font's UNDERLINE_POSITION for small font display
+to 4.1, set this to nil. You can also use `underline-minimum-offset'
+to override the font's UNDERLINE_POSITION for small font display
sizes. */);
x_use_underline_position_properties = 1;
@@ -10802,16 +10795,6 @@ variable `x-use-underline-position-properties', which is usually at the
baseline level. The default value is nil. */);
x_underline_at_descent_line = 0;
- DEFVAR_INT ("x-underline-minimum-display-offset",
- &x_underline_minimum_display_offset,
- doc: /* *When > 0, underline is drawn at least that many screen pixels below baseline.
-This can improve legibility of underlined text at small font sizes,
-particularly when using variable `x-use-underline-position-properties'
-with fonts that specify an UNDERLINE_POSITION relatively close to the
-baseline. The default value is 0. */);
- x_underline_minimum_display_offset = 0;
-
-
DEFVAR_BOOL ("x-mouse-click-focus-ignore-position",
&x_mouse_click_focus_ignore_position,
doc: /* Non-nil means that a mouse click to focus a frame does not move point.