The original patch is http://www.netlaputa.ne.jp/~kose/Emacs/Archives/emacs-20.5-linespace-patch.gz It is required emcws-20.5-19991208 and cannot be applied to the original emacs-20.7. So the following patch is modified for the original one. by Taoka diff -ur emacs-20.7.orig/configure.in emacs-20.7/configure.in --- emacs-20.7.orig/configure.in Tue Jun 6 00:42:49 2000 +++ emacs-20.7/configure.in Mon Nov 12 10:57:29 2001 @@ -34,6 +34,9 @@ archlibdir='${libexecdir}/emacs/${version}/${configuration}' docdir='${datadir}/emacs/${version}/etc' +AC_ARG_WITH(line-space, +[ --with-line-space support line space feature], +[AC_DEFINE(LINESPACE)]) AC_ARG_WITH(gcc, [ --with-gcc use GCC to compile Emacs]) AC_ARG_WITH(pop, diff -ur emacs-20.7.orig/lisp/startup.el emacs-20.7/lisp/startup.el --- emacs-20.7.orig/lisp/startup.el Mon Aug 2 10:12:00 1999 +++ emacs-20.7/lisp/startup.el Mon Nov 12 10:57:29 2001 @@ -201,6 +201,9 @@ ("-vb" 0 x-handle-switch vertical-scroll-bars t) ("-hb" 0 x-handle-switch horizontal-scroll-bars t) ("-bd" 1 x-handle-switch) + ;; For LINESPACE + ("-lsp" 1 x-handle-switch line-space) + ;; end of patch ("--border-width" 1 x-handle-numeric-switch border-width) ("--display" 1 x-handle-display) ("--name" 1 x-handle-name-switch) @@ -217,7 +220,10 @@ ("--xrm" 1 x-handle-xrm-switch) ("--cursor-color" 1 x-handle-switch cursor-color) ("--vertical-scroll-bars" 0 x-handle-switch vertical-scroll-bars t) - ("--border-color" 1 x-handle-switch border-width)) + ("--border-color" 1 x-handle-switch border-width) + ;; For LINESPACE + ("--line-space" 1 x-handle-switch line-space)) + ;; end of patch "Alist of X Windows options. Each element has the form (NAME NUMARGS HANDLER FRAME-PARAM VALUE) diff -ur emacs-20.7.orig/src/config.in emacs-20.7/src/config.in --- emacs-20.7.orig/src/config.in Sat May 20 23:58:21 2000 +++ emacs-20.7/src/config.in Mon Nov 12 10:57:29 2001 @@ -262,6 +262,8 @@ #define INLINE #endif +#undef LINESPACE /* flag whether to enable line space feature */ + #undef EMACS_CONFIGURATION #undef EMACS_CONFIG_OPTIONS diff -ur emacs-20.7.orig/src/xfaces.c emacs-20.7/src/xfaces.c --- emacs-20.7.orig/src/xfaces.c Wed Nov 18 10:36:41 1998 +++ emacs-20.7/src/xfaces.c Mon Nov 12 10:57:30 2001 @@ -789,6 +789,9 @@ if (height > biggest) biggest = height; } +#ifdef LINESPACE + biggest += f->output_data.x->upper_space + f->output_data.x->lower_space; +#endif /* LINESPACE */ if (biggest == f->output_data.x->line_height) return 0; diff -ur emacs-20.7.orig/src/xfns.c emacs-20.7/src/xfns.c --- emacs-20.7.orig/src/xfns.c Thu Jul 1 09:09:39 1999 +++ emacs-20.7/src/xfns.c Mon Nov 12 10:57:30 2001 @@ -205,6 +205,9 @@ Lisp_Object Quser_position; Lisp_Object Quser_size; Lisp_Object Qdisplay; +#ifdef LINESPACE +Lisp_Object Qline_space; +#endif /* LINESPACE */ /* The below are defined in frame.c. */ extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; @@ -679,6 +682,9 @@ void x_set_icon_type (); void x_set_icon_name (); void x_set_font (); +#ifdef LINESPACE +void x_set_line_space (); +#endif /* LINESPACE */ void x_set_border_width (); void x_set_internal_border_width (); void x_explicitly_set_name (); @@ -705,6 +711,9 @@ "icon-name", x_set_icon_name, "icon-type", x_set_icon_type, "internal-border-width", x_set_internal_border_width, +#ifdef LINESPACE + "line-space", x_set_line_space, +#endif /* LINESPACE */ "menu-bar-lines", x_set_menu_bar_lines, "mouse-color", x_set_mouse_color, "name", x_explicitly_set_name, @@ -1676,6 +1685,50 @@ call1 (Qface_set_after_frame_default, frame); } +#ifdef LINESPACE +void +x_set_line_space (f, arg, oldval) + struct frame *f; + Lisp_Object arg, oldval; +{ + int upper, lower; + char *s, *p; + + CHECK_STRING (arg, 0); + s = (char *) XSTRING (arg)->data; + + upper = lower = 0; + if (*s) { + if (*s != '+') + upper = atoi(s); + if (p = (char *) index (s, '+')) { + lower = atoi(p); + } else { + lower = upper - (upper / 2); + upper /= 2; + } + } + if (upper < 0) upper = 0; + if (lower < 0) lower = 0; + + if (f->output_data.x->upper_space != upper + || f->output_data.x->lower_space != lower) { + f->output_data.x->line_height + += (upper - f->output_data.x->upper_space + + lower - f->output_data.x->lower_space); + f->output_data.x->upper_space = upper; + f->output_data.x->lower_space = lower; + if (FRAME_X_WINDOW (f) != 0) { + BLOCK_INPUT; + x_set_window_size (f, 0, f->width, f->height); + XFlush (FRAME_X_DISPLAY (f)); + UNBLOCK_INPUT; + SET_FRAME_GARBAGED (f); + } + } +} +#endif /* LINESPACE */ + void x_set_border_width (f, arg, oldval) struct frame *f; @@ -3376,6 +3429,11 @@ xlwmenu_default_font = f->output_data.x->font; #endif +#ifdef LINESPACE + x_default_parameter (f, parms, Qline_space, build_string ("0"), + "lineSpace", "LineSpace", string); +#endif /* LINESPACE */ + x_default_parameter (f, parms, Qborder_width, make_number (2), "borderWidth", "BorderWidth", number); /* This defaults to 2 in order to match xterm. We recognize either @@ -5315,6 +5373,10 @@ staticpro (&Quser_size); Qdisplay = intern ("display"); staticpro (&Qdisplay); +#ifdef LINESPACE + Qline_space = intern ("line-space"); + staticpro (&Qline_space); +#endif /* LINESPACE */ /* This is the end of symbol initialization. */ Qface_set_after_frame_default = intern ("face-set-after-frame-default"); diff -ur emacs-20.7.orig/src/xterm.c emacs-20.7/src/xterm.c --- emacs-20.7.orig/src/xterm.c Mon Aug 2 09:16:43 1999 +++ emacs-20.7/src/xterm.c Mon Nov 12 10:57:30 2001 @@ -724,10 +724,17 @@ font = (XFontStruct *) (fontp->font); gc = FACE_NON_ASCII_GC (face); XSetFont (FRAME_X_DISPLAY (f), gc, font->fid); +#ifdef LINESPACE + baseline + = (font->max_byte1 != 0 + ? (line_height + f->output_data.x->upper_space - f->output_data.x->lower_space + font->ascent - font->descent) / 2 + : f->output_data.x->font_baseline - fontp->baseline_offset); +#else baseline = (font->max_byte1 != 0 ? (line_height + font->ascent - font->descent) / 2 : f->output_data.x->font_baseline - fontp->baseline_offset); +#endif /* LINESPACE */ if (FONT_HEIGHT (font) <= line_height && (font->ascent > baseline || font->descent > line_height - baseline)) @@ -795,7 +802,11 @@ font = FACE_FONT (face); if (!font || font == (XFontStruct *) FACE_DEFAULT) font = f->output_data.x->font; +#ifdef LINESPACE + baseline = FONT_BASE (f->output_data.x->font) + f->output_data.x->upper_space; +#else baseline = FONT_BASE (f->output_data.x->font); +#endif /* LINESPACE */ if (charset == charset_latin_iso8859_1) { if (font->max_char_or_byte2 < 0x80) @@ -5419,7 +5430,12 @@ else /* If we are setting a new frame's font for the first time, there are no faces yet, so this font's height is the line height. */ +#ifdef LINESPACE + f->output_data.x->line_height = FONT_HEIGHT (f->output_data.x->font) + + f->output_data.x->upper_space + f->output_data.x->lower_space; +#else f->output_data.x->line_height = FONT_HEIGHT (f->output_data.x->font); +#endif /* LINESPACE */ return build_string (fontp->full_name); } diff -ur emacs-20.7.orig/src/xterm.h emacs-20.7/src/xterm.h --- emacs-20.7.orig/src/xterm.h Sun Aug 16 07:58:10 1998 +++ emacs-20.7/src/xterm.h Mon Nov 12 10:57:30 2001 @@ -348,6 +348,14 @@ /* Height of a line, in pixels. */ int line_height; +#ifdef LINESPACE + /* Upper space of each line, in pixels. */ + int upper_space; + + /* Lower space of each line, in pixels. */ + int lower_space; +#endif /* LINESPACE */ + /* The tiled border used when the mouse is out of the frame. */ Pixmap border_tile; diff -ur emacs-20.7.orig/src/emacs.c emacs-20.7/src/emacs.c --- emacs-20.7.orig/src/emacs.c Wed May 24 22:58:54 2000 +++ emacs-20.7/src/emacs.c Fri Dec 7 02:21:53 2001 @@ -835,6 +835,7 @@ Usage: %s [--batch] [-t term] [--terminal term]\n\ [-d display] [--display display] [-nw] [--no-windows]\n\ [-q] [--no-init-file] [-u user] [--user user] [--debug-init]\n\ + [-lsp dots] [--line-space dots]\n\ [--unibyte] [--multibyte] [--version] [--no-site-file]\n\ [-f func] [--funcall func] [-l file] [--load file] [--eval expr]\n\ [--insert file] [+linenum] file-to-visit [--kill]\n\