bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61710] [me] $v and $V are in the wrong namespace


From: G. Branden Robinson
Subject: [bug #61710] [me] $v and $V are in the wrong namespace
Date: Tue, 1 Feb 2022 03:38:05 -0500 (EST)

Follow-up Comment #16, bug #61710 (project groff):

Hi Dave,

Here's a new approach that doesn't meddle with `sz` at all.

Instead, it intercepts the `vs` request.  Updated documentation is included in
the diff.

It did not alter the formatting of our 3 in-tree me(7) documents.

What do you think?


diff --git a/doc/meref.me.in b/doc/meref.me.in
index 3ef233667..05b23da82 100644
--- a/doc/meref.me.in
+++ b/doc/meref.me.in
@@ -1105,6 +1105,19 @@ and
 .NR (tp
 (title point size)
 define the type size set in their corresponding contexts.
+.TL
+.b .vs
+.i \(+-v
+.DE
+Set the vertical spacing to
+.i \(+-p
+points.
+Recompute percentage of vertical spacing to type size
+and store it in
+.NR ($V
+if within a display or annotation,
+otherwise
+.NR ($v .
 .lp
 The following macros
 style or decorate an argument
@@ -2354,6 +2367,7 @@ and a square \(sq marks \*G extensions.
 \ew\(aq\fI\,S\/\fP\(aq F\(sc   interpolate formatted width of \fIS\fP
 \e*(wa S\(sq   term for \(lqappendix\(rq used by \fB.$c\fP
 \e*(wc S\(sq   term for \(lqchapter\(rq used by \fB.$c\fP
+\&.vs  M\(sq   set vertical spacing in points
 \&.xl  M       set line length (current environment)
 \&.xp  M       output index
 \en(xs R       index entry prespace
diff --git a/tmac/e.tmac b/tmac/e.tmac
index 91dc19830..4e515a2bd 100644
--- a/tmac/e.tmac
+++ b/tmac/e.tmac
@@ -135,7 +135,7 @@
 .nr _I \\n(.i
 .ev \\$1
 .ps \\n(_S
-.vs \\n(_Vu
+.xv \\n(_Vu
 .ft \\n(_F
 .ad \\n(_J
 .do @fam \\*(_A
@@ -551,6 +551,21 @@
 .nr _o \\n(.o
 ..
 .
+.rn vs xv              \" --- save troff vertical spacing request
+.
+.de vs                 \" *** vertical spacing
+.xv \\$1
+.\" Compute new vertical spacing to type size percentage (see .sz).
+.nr _r \\n(.vu/\\n(.su*100u
+.nr _V 0 \" Are we in a context where we use $V instead of $v?
+.if \\n(?k .nr _V 1
+.if "\\n(.z"|f" .nr _V 1
+.ie \\n(_V .nr $V \\n(_r
+.el        .nr $v \\n(_r
+.rr _V
+.rr _r
+..
+.
 .\" Redefine the groff fam request to set the family in
 .\" environment 2 as well as the current environment.
 .if !\n(.g .ig
@@ -1115,7 +1130,7 @@
 .@C 1
 .@F \\n(df
 .if \\n($R .@V
-.vs \\n(.sp*\\n($Vu/100u
+.xv \\n(.sp*\\n($Vu/100u
 .nf
 .if "\\*(|p"F" \
 .      fi                      \" set fill mode if "F" parameter
@@ -1495,7 +1510,7 @@
 .de sz                 \" *** set point size and vertical spacing
 .ps \\$1
 .if \\n($r .@v
-.vs \\n(.sp*\\n($vu/100u       \" default vs at pointsize + 20%
+.xv \\n(.sp*\\n($vu/100u       \" default vs at pointsize + 20%
 ..
 .
 .de @v                 \" --- possibly set $v from $r
@@ -1605,7 +1620,7 @@
 .      xl \\n($lu-\\n(fuu
 .      @F \\n(ff
 .      sz \\n(fp
-.      vs \\n(.sp*\\n($Vu/100u
+.      xv \\n(.sp*\\n($Vu/100u
 .      if !\\n(?f \
 \{\
 .              nr _b +1v       \" allow space for $s
@@ -1624,7 +1639,7 @@
 .              xl \\n($lu-\\n(fuu
 .              @F \\n(ff
 .              sz \\n(fp
-.              vs \\n(.sp*\\n($Vu/100u
+.              xv \\n(.sp*\\n($Vu/100u
 .              if !\\n(?f \
 .                      $s
 .              br
@@ -1645,7 +1660,7 @@
 .      xl \\n($lu-\\n(fuu
 .      @F \\n(ff
 .      sz \\n(fp
-.      vs \\n(.sp*\\n($Vu/100u
+.      xv \\n(.sp*\\n($Vu/100u
 .      fi
 \!.(f \\$1
 \!.@N
@@ -1776,7 +1791,7 @@
 .br
 .@C 2
 .ls 1
-.vs \\n(.sp*\\n($Vu/100u
+.xv \\n(.sp*\\n($Vu/100u
 .fi
 .in +\\n(piu
 .ds |X x


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61710>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]