Re: [Groff] horizontal trap

2016-01-01 Thread Daode
Happy new (Christian++) year everybody.

Tadziu Hoffmann  wrote:
 |> [...] and also supports five different builtin styles for
 |> verbatim output instead of only a silly numbered one.
 |
 |Okay, I'm curious.  What different styles apart from numbering
 |could there possibly be?  (I can't think of any, except of
 |course for variants of this, such as numbering only every
 |fifth line, or numbering only lines containing text and
 |skipping empty ones, or setting the number in a different
 |color/font/size, etc.)

No, no..  It's really just that i don't have this in roff.
And no, i was impressed from Eckel's ?Thinking in Java? style,
which was so different to all the rest.  (Unfortunately that made
me buy his ?Thinking in C++? one or two years later and that
wasn't really it.)  Everybody goes the spiral staircase, so to
say.  But on Tucholsky's "talking writing silence" i'm on two at
most.  ^.^

Whereas the styles are pretty basic, the really great thing on my
TeX package was that almost everything was hookable; builtin:

  % 5 (default) styles. The numbered (inside) ones are ok for up to  lines
  \def\@verbatim@I{\hbox{}}% I = EMPTY
  \def\@verbatim@II{% II = Numbered; number inside document;
{\smallest\it\hbox to 3em{\hfill\number\@count@verbatimno}\hbox to.84em{}}%
  }
  \def\@verbatim@III{% III = Numbered; number shifted to the left margin
\llap{{\smallest\it\number\@count@verbatimno}\hbox to.84em{}}%
  }
  \def\@verbatim@IV{% IV = black border left; border inside document
\vbox{\kern-3pt\vstrutbox{3}}\hbox to.84em{}%
  }
  \def\@verbatim@V{% V = black border left; border shifted to the left margin.
\llap{\vbox{\kern-3pt\vstrutbox{3}}\hbox to.84em{}}%
  }

A default to be chosen from by simple command

  \def\setVerbatimStyle#1{%
\def\@@value{#1}\def\@@value@{I}%
\ifx\@@value\@@value@%
  \setHookVerbatimStyle{\@verbatim@I}%
..
  }
  \setVerbatimStyle{III}% Default is III

But you could adjust a lot of even those by doing some hooks

  % Hooks
  \def\setHookVerbatimPre#1{\gdef\@hook@verbatim@pre{#1}}%
  \setHookVerbatimPre{\tt}%
  \def\setHookVerbatimAfter#1{\gdef\@hook@verbatim@after{#1}}%
  \setHookVerbatimAfter{}%

  \def\setHookVerbatimStyle#1{% set in the style-section below
  \gdef\@verbatim@baseStyle{%
  \global\advance\@count@verbatimno by\TRUE\relax%
  \hSkip{\@verbatim@leftindent}{#1}%
  }%
  % one can choose "local" styles. this is used to restore the global
  \global\let\@hook@verbatim@style\@verbatim@baseStyle%
  }%
  % Dimen
  \def\setVerbatimLeftIndent#1{\gdef\@verbatim@leftindent{#1}}%
  \setVerbatimLeftIndent{0pt}%

(I was sooo proud of that stuff and even wanted to write a book.
Maybe good that the c't magazine distributed a virus on CD in
a program called Street Graphics or so and that i forgot my PGP
password to restore from backup.)

--steffen



Re: [Groff] GPL or FDL

2013-01-25 Thread Daode
"Bernd Warken"  wrote:

 |I will not follow that line. A roff that accepts only 2-letter-macros
 |today has no chance to survive.
 |
 |The original RUNOFF had very long command names, for example
 |.ADJUST
 |
 |Each command had an abbreviation of 2 letters, with the lang name as the
 |standard. But the following roff took only these 2-letter-abbreviations
 |and discarded the original long names. That became the home of the
 |commercial Unix versions.
 |
 |I protest against this bullshit and use long macro names. So the weak
 |commercial roff programs should see where they are. Forget about them.

Wow!  Are you willing to overcome one restriction all roffs afaik have
and that makes me write terrible crap like

  .ds S:LIST_BULLET_ITEM_EMBED \
  \\*[S:LIST_ITEM_DESC\\n[S:#LIST_LVL]]\\h'|\\n[S:#LIST_SEP\\n[S:#LIST_LVL]]u'\
  \\h'-\\w' 'u'

i.e., let me write \*[ITEM] even if that was a macro not a string.
(Or has something adorable happened since then.)

 |Bernd Warken

--steffen



Re: [Groff] GPL or FDL

2013-01-26 Thread Daode
Werner LEMBERG  wrote:
 |> i.e., let me write \*[ITEM] even if that was a macro not a string.
 |> (Or has something adorable happened since then.)
 |
 |I don't understand your (probably sarcastic?) comment.  That \*[ITEM]
 |can call either a macro or a string is a feature which can be useful
 |sometimes.

  .de m
  tea\c
  ..
  .ds s coffee \\*m
  \*m \*s

prints

  tea coffee tea

No, not sarcastic, i really didn't know.
.. and can unnoodle, if i'll find my way through it!

It looks as if it was documented first on 2008-09-28;
do i have to change my version check from

  if (\n[.x] == 1) .if (\n[.y] < 18) .ab [.] requires GNU (t)roff 1.18

to 1.20 for this to work?

 |Werner

Thanks, that is a really great improvement!

--steffen



Re: [Groff] GPL or FDL

2013-01-26 Thread Daode
Tadziu Hoffmann  wrote:
 |[snip]
 |> do i have to change my version check [...] to 1.20 for this to work?
 |
 |This has worked for ages already in Unix troff (because macros and
 |strings share the same namespace), and my guess is in groff as well.
 |It might just not have been documented.

It definitely wasn't, and i can't remember that there were any
examples that used this notation (though i haven't read the entire
manual from the first to the last page -- and most likely
i wouldn't have dared to use the notation regardless).
And i definitely didn't think about *roff implementation details
once i've wrote my letter macros; they work fine with GNU troff.

You seem to be right anyway; the nroff sitting in the Heirloom
project doctools can also handle the code snippet from my previous
mail correctly.

--steffen



Re: [Groff] GPL or FDL

2013-01-26 Thread Daode
Werner LEMBERG  wrote:
 |Macros called with \* is indeed nothing new.  However, having
 |arguments like
 |
 |  \*[foo arg1 arg2 ...]
 |
 |is what I've added some years ago.

It'll allow me to rewrite terrible code. 

 |Werner

--steffen



[Groff] hyphen.de

2013-02-12 Thread Daode
Hello,

i'm looking at a rather current (Add a shell command to the file
MANIFEST.., 2013-01-24) version of the GNU (t)roff repo and i see
that hyphen.de was imported into groff:

  Author: wl 
  Date:   2006-12-19 08:02:52 +

  Add support for German.  For activation, simply use -mde or -mden
  (for traditional and new orthgraphy, respectively) as the last
  macro package.
  
  * tmac/de.tmac, tmac/den.tmac, tmac/hyphen.det, tmac/hyphen.den,
  tmac/hyphenex.det: New files, partly taken from CTAN.
  * LICENSES: Updated list of hyphenation patterns.
  * man/groff_tmac.man: Mention de.tmac and den.tmac.
  * NEWS: Updated.

That is great!  But then i looked into hyphen.de(t) because of
a size mismatch with the version in my ..working.. macro package
and saw that it is not the version that Walter Schmidt updated for
the new German orthography in 2001.
Now i wonder why?  (Well, except that i personally dislike and
disagree with it -- but it is official german in the end?)
Is anything wrong with it?

Thanks and Ciao,

--steffen



Re: [Groff] hyphen.de

2013-02-12 Thread Daode
I'm talking about the attached version of the hyphenation rules.

--steffen


hyphen.de.gz
Description: GNU Zip compressed data


Re: [Groff] autoconf and autoreconf

2013-04-13 Thread Daode
Keith Marshall  wrote:
 |On 13/04/13 14:52, Werner LEMBERG wrote:
 |>> Any comments?
 |
 |Some projects do commit configure, others don't.  IMO, it is better if 
 |it is *not* committed, but IIRC it has been there, in groff's CVS, for 
 |as long as I've been associated with the project.  I would be in favour 
 |of removing it now...

Please don't change this friendly current situation.

It is really a terrible thing that many projects do no longer
/ not ship a self-contained repository, but one that requires an
immense amount of utilities just to create a runnable configure
script.

I've just set up a completely new box and added perl(1), mksh(1),
vim(1) and some others […] -- and it is so nice *not* to need this
huge toolchain.  E.g., GNU gettext alone has a 70 MB (!) checkout
(with the gettext.c of it consuming 10820 bytes).

Even if i had a locale package cache, being able to simply update
a repository on releases / bugfixes and to simply recompile the
package is definitely a quality-of-implementation in my eyes.

 |Keith.

Ciao,

--steffen



[Groff] cvs(1) cannot be accessed (with old clients?)

2013-04-29 Thread Daode
Hello,
i couldn't update my repo:

  AuthReply: cvs: unrecognized option 
'--allow-root-regexp=^/srv/cvs/sources/.*$'

What can be done about that?

--steffen



Re: [Groff] Help with crop marks code

2013-11-28 Thread Daode
Walter Alejandro Iglesias  wrote:
 |Searching for how implement crop marks with groff I've found this:
 [.]
 |I would appreciate some clue or a point to some documentation.

Well i have no crop marks but used "fold marks" for letters and
when punchers had to be adjusted, but you can paint whatever you
want, of course, just use different \D'' requests.
It's part of a larger thing, here only excerpts -- the attached
'test.tr' is their runnable version.

Can be set and managed via global switches:

  .\".ds S:FOLDMARKS true
  .\".nr S:#FOLDMARKS_OFFSET 0.25c
  .MACRO FOLDMARKS \" $1=bool, [$2=offset]
  .  S:BOOLIFY \\$1
  .  ie \\n[S:#IS_BOOL] \{\
  . ds S:FOLDMARKS true
  . ie '\\$2'' .nr S:#FOLDMARKS_OFFSET 0.25c
  . el .nr S:#FOLDMARKS_OFFSET \\$2
  .  \}
  .  el \{\
  . rm S:FOLDMARKS
  . rr S:#FOLDMARKS_OFFSET
  .  \}
  ..

Some generic positioning support

  .aln ROFF:#PAGENO %
  .aln ROFF:#VERT_POS nl
  .aln ROFF:#HORIZ_POS .k
  .aln ROFF:#INDENT .i
  .aln ROFF:#PAGE_OFFSET .o

  .de S:SAVE_POSITION
  .  nr S:#SAVE_POS#V \\n[ROFF:#VERT_POS]
  .  nr S:#SAVE_POS#H \\n[ROFF:#HORIZ_POS]
  ..
  .de S:RESTORE_POSITION
  .  sp |\\n[S:#SAVE_POS#V]u
  \\h'|\\n[S:#SAVE_POS#H]u'\c
  ..

The foldmark painter itself.
All it effectively does is to move absolutely and paint two
horizontal lines at precalculated positions; using different
absolute .sp in combination with several \D''s should do what you
desire?

  .de S:FOLDMARKS_PUT
  .  nr #1 \\n[S:#PAGE_HEIGHT]u/3u
  .  nr #2 \\n(#1u-\\n[S:#PRINTER_MARGIN_TOP]u
  .  nr #3 \\n(#2u+\\n(#1u
  .\" FIXME Does not take care for printer margin left+
  .\"   nr #1 \\n[S:#MARGIN_LEFT]+\\n[ROFF:#HORIZ_POS]-\\n[S:#FOLDMARKS_OFFSET]
  .  nr #1 \\n[ROFF:#PAGE_OFFSET]+\\n[ROFF:#INDENT]-\\n[S:#FOLDMARKS_OFFSET]
  .  S:SAVE_POSITION
  .  sp |\\n[#2]u
  \\Z'\
  \\h'|-\\n(#1u'\
  \\D't 0.5p'\
  \\l'5p'\
  '
  .  sp |\\n[#3]u
  \\Z'\
  \\h'|-\\n(#1u'\
  \\D't 0.5p'\
  \\l'5p'\
  '
  .  S:RESTORE_POSITION
  .  rr #4
  .  rr #3
  .  rr #2
  .  rr #1
  ..

That thing is called from another entry

  .de S:CHECK_TOP_BOXES
  [.]
  .  ds S:TOP_BOXES_SET
  .  if d S:FOLDMARKS .S:FOLDMARKS_PUT
  [.]

which in turn gets called from page-top, EOF and paragraph
(but this only '.if (\\n[ROFF:#PAGENO] = 1) \{\') traps.

  .de S:TRAP_TOP
  [.]
  .  S:CALC_LAYOUT
  '  sp |\\n[S:#PAGE_START]u
  .  rm S:TOP_BOXES_SET
  .  rm S:BOTTOM_BOXES_SET
  .  if (\\n[ROFF:#PAGENO] > 1) .S:CHECK_TOP_BOXES
  [.]
  .wh 0 S:TRAP_TOP

  .de S:TRAP_EOF
  [.]
  .  if !d S:TOP_BOXES_SET .S:CHECK_TOP_BOXES
  .  if !d S:BOTTOM_BOXES_SET .S:CHECK_BOTTOM_BOXES
  ..
  .em S:TRAP_EOF

iirc it was a terrible mess to implement right back then, but it
got better once i realized that the printer imposes its own
margins a.k.a. has a supported drawable area.  It never was done
right, then, however (i.e., has been adjusted to take all
possible margins into account).  :(

--steffen
--- Begin Message ---
Hello all,

Searching for how implement crop marks with groff I've found this:

http://article.gmane.org/gmane.comp.printing.groff.general/7804

That do the job but I am a bit lost with the code.  I couldn't find
documentation on internet to understand it and be able to modify it to fit the
A4 paper format I use.

I would appreciate some clue or a point to some documentation.


Thanks in advace.


Walter



--- End Message ---
.nr S:#PAGE_HEIGHT 29.7c
.nr S:#PAGE_WIDTH 21c
.nr S:#PRINTER_MARGIN_TOP 0c
.nr S:#PRINTER_MARGIN_BOTTOM 0c
.nr S:#PRINTER_MARGIN_LEFT 0c
.nr S:#PRINTER_MARGIN_RIGHT 0c
.
.ds S:FOLDMARKS true
.nr S:#FOLDMARKS_OFFSET 0.25c
.
.aln ROFF:#PAGENO %
.aln ROFF:#VERT_POS nl
.aln ROFF:#HORIZ_POS .k
.aln ROFF:#INDENT .i
.aln ROFF:#PAGE_OFFSET .o
.
.de S:SAVE_POSITION
.  nr S:#SAVE_POS#V \\n[ROFF:#VERT_POS]
.  nr S:#SAVE_POS#H \\n[ROFF:#HORIZ_POS]
..
.de S:RESTORE_POSITION
.  sp |\\n[S:#SAVE_POS#V]u
\\h'|\\n[S:#SAVE_POS#H]u'\c
..
.de S:FOLDMARKS_PUT
.  nr #1 \\n[S:#PAGE_HEIGHT]u/3u
.  nr #2 \\n(#1u-\\n[S:#PRINTER_MARGIN_TOP]u
.  nr #3 \\n(#2u+\\n(#1u
.\" FIXME Does not take care for printer margin left+
.\"   nr #1 \\n[S:#MARGIN_LEFT]+\\n[ROFF:#HORIZ_POS]-\\n[S:#FOLDMARKS_OFFSET]
.  nr #1 \\n[ROFF:#PAGE_OFFSET]+\\n[ROFF:#INDENT]-\\n[S:#FOLDMARKS_OFFSET]
.  S:SAVE_POSITION
.  sp |\\n[#2]u
\\Z'\
\\h'|-\\n(#1u'\
\\D't 0.5p'\
\\l'5p'\
'
.  sp |\\n[#3]u
\\Z'\
\\h'|-\\n(#1u'\
\\D't 0.5p'\
\\l'5p'\
'
.  S:RESTORE_POSITION
.  rr #4
.  rr #3
.  rr #2
.  rr #1
..
.wh 0 S:FOLDMARKS_PUT
Erste Zeile
.sp 5c
Zweiter Absatz.
.sp 5c
Dritter Absatz.
.sp 5c
Absatz 4.
.sp 5c
Absatz 5.
.sp 5c
Absatz 6.
.sp 5c
Absatz 7.
.sp 5c
Absatz 8.


Re: [Groff] Second try at git conversion

2013-12-22 Thread Daode
Heinz-Jürgen Oertel  wrote:
 |What would be the repository address for a git clone?

git://git.savannah.gnu.org/groff.git

The webpage still mentions CVS only.
Ciao,

--steffen



Re: [Groff] Second try at git conversion

2013-12-23 Thread Daode
Heinz-Jürgen Oertel  wrote:
 |Am Sonntag, 22. Dezember 2013, 18:34:01 schrieb Steffen Daode Nurpmeso:
 |> Heinz-Jürgen Oertel  wrote:
 |>|What would be the repository address for a git clone?
 |> 
 |> git://git.savannah.gnu.org/groff.git
 |
 |all steps OK

Good!
(I've mailed sinuhe AT gnu.org to update the webpage.)

--steffen
--- Begin Message ---
Am Sonntag, 22. Dezember 2013, 18:34:01 schrieb Steffen Daode Nurpmeso:
> Heinz-Jürgen Oertel  wrote:
>  |What would be the repository address for a git clone?
> 
> git://git.savannah.gnu.org/groff.git
> 
> The webpage still mentions CVS only.
> Ciao,
> 
> --steffen

git clone git://git.savannah.gnu.org/groff.git
./configure
make
sudo make install

all steps OK
thanks

-- 
mit freundlichen Grüßen
   Heinz-Jürgen Oertel

signature.asc
Description: This is a digitally signed message part.
--- End Message ---


Re: [Groff] Second try at git conversion

2013-12-24 Thread Daode
Werner LEMBERG  wrote:
 |> (I've mailed sinuhe AT gnu.org to update the webpage.)
 | 
 |Anyways, I've updated the web page.  It won't win a beauty contest,
 |but the info should be accurate now.

It seems you sometimes have to deal with asholes in such an
unlimited forum.
...and a beer in a tree...

--steffen
--- Begin Message ---

> (I've mailed sinuhe AT gnu.org to update the webpage.)

I fear that sinuhe won't respond at all – at least he didn't the last
few times I tried to contact him.

Anyways, I've updated the web page.  It won't win a beauty contest,
but the info should be accurate now.


Werner
--- End Message ---


Re: [Groff] [PATCH] Use bash for several contrib scripts

2014-01-02 Thread Daode
Happy new year.

Colin Watson  wrote:
 |+2014-01-02  Colin Watson  
 |+
 |+ * contrib/eqn2graph/eqn2graph.sh: Use bash rather than sh; $RANDOM
 |+ is a bashism.
 |+ * contrib/grap2graph/grap2graph.sh: Likewise.
 |+ * contrib/pic2graph/pic2graph.sh: Likewise.

I'd really rather do something like the below instead.

Btw.: interesting that the auto-generated files like `configure'
simply use $RANDOM, whereas the config.guess and such (i *never*
used any auto*) do.  Imho it is a bug that the generated scripts
use /bin/sh but are not compatible to a real /bin/sh.

--steffen

diff --git a/contrib/eqn2graph/eqn2graph.sh b/contrib/eqn2graph/eqn2graph.sh
index ee7cc5f..c85e06d 100644
--- a/contrib/eqn2graph/eqn2graph.sh
+++ b/contrib/eqn2graph/eqn2graph.sh
@@ -65,7 +65,7 @@ for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
 && test -n "$tmp" && test -d "$tmp" \
 && break
 
-tmp=$d/eqn2graph$$-$RANDOM
+tmp=$d/eqn2graph$$-${RANDOM:-${$}}
 (umask 077 && mkdir $tmp) 2> /dev/null && break
 done;
 if test -z "$tmp"; then
diff --git a/contrib/grap2graph/grap2graph.sh b/contrib/grap2graph/grap2graph.sh
index 58544e1..245e4ca 100644
--- a/contrib/grap2graph/grap2graph.sh
+++ b/contrib/grap2graph/grap2graph.sh
@@ -61,7 +61,7 @@ for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
 && test -n "$tmp" && test -d "$tmp" \
 && break
 
-tmp=$d/grap2graph$$-$RANDOM
+tmp=$d/grap2graph$$-${RANDOM:-${$}}
 (umask 077 && mkdir $tmp) 2> /dev/null && break
 done;
 if test -z "$tmp"; then
diff --git a/contrib/pic2graph/pic2graph.sh b/contrib/pic2graph/pic2graph.sh
index 72c5477..dccd9e7 100644
--- a/contrib/pic2graph/pic2graph.sh
+++ b/contrib/pic2graph/pic2graph.sh
@@ -75,7 +75,7 @@ for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
 && test -n "$tmp" && test -d "$tmp" \
 && break
 
-tmp=$d/pic2graph$$-$RANDOM
+tmp=$d/pic2graph$$-${RANDOM:-${$}}
 (umask 077 && mkdir $tmp) 2> /dev/null \
 && break
 done;
--- Begin Message ---
---
 ChangeLog| 7 +++
 contrib/eqn2graph/eqn2graph.sh   | 2 +-
 contrib/grap2graph/grap2graph.sh | 2 +-
 contrib/pic2graph/pic2graph.sh   | 2 +-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index abf7534..33c5175 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-01-02  Colin Watson  
+
+   * contrib/eqn2graph/eqn2graph.sh: Use bash rather than sh; $RANDOM
+   is a bashism.
+   * contrib/grap2graph/grap2graph.sh: Likewise.
+   * contrib/pic2graph/pic2graph.sh: Likewise.
+
 2013-12-23  Bernd Warken  
 
groff/src/roff/groff/groff.cpp: add groff option `-G' to the
diff --git a/contrib/eqn2graph/eqn2graph.sh b/contrib/eqn2graph/eqn2graph.sh
index ee7cc5f..fb6f7f5 100644
--- a/contrib/eqn2graph/eqn2graph.sh
+++ b/contrib/eqn2graph/eqn2graph.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 #
 # eqn2graph -- compile EQN equation descriptions to bitmap images
 #
diff --git a/contrib/grap2graph/grap2graph.sh b/contrib/grap2graph/grap2graph.sh
index 58544e1..721c2b0 100644
--- a/contrib/grap2graph/grap2graph.sh
+++ b/contrib/grap2graph/grap2graph.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 #
 # grap2graph -- compile graph description descriptions to bitmap images
 #
diff --git a/contrib/pic2graph/pic2graph.sh b/contrib/pic2graph/pic2graph.sh
index 72c5477..c4a7781 100644
--- a/contrib/pic2graph/pic2graph.sh
+++ b/contrib/pic2graph/pic2graph.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 #
 # pic2graph -- compile PIC image descriptions to bitmap images
 #
-- 
1.8.5.2

--- End Message ---
diff --git a/contrib/eqn2graph/eqn2graph.sh b/contrib/eqn2graph/eqn2graph.sh
index ee7cc5f..c85e06d 100644
--- a/contrib/eqn2graph/eqn2graph.sh
+++ b/contrib/eqn2graph/eqn2graph.sh
@@ -65,7 +65,7 @@ for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
 && test -n "$tmp" && test -d "$tmp" \
 && break
 
-tmp=$d/eqn2graph$$-$RANDOM
+tmp=$d/eqn2graph$$-${RANDOM:-${$}}
 (umask 077 && mkdir $tmp) 2> /dev/null && break
 done;
 if test -z "$tmp"; then
diff --git a/contrib/grap2graph/grap2graph.sh b/contrib/grap2graph/grap2graph.sh
index 58544e1..245e4ca 100644
--- a/contrib/grap2graph/grap2graph.sh
+++ b/contrib/grap2graph/grap2graph.sh
@@ -61,7 +61,7 @@ for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
 && test -n "$tmp" && test -d "$tmp" \
 && break
 
-tmp=$d/grap2graph$$-$RANDOM
+tmp=$d/grap2graph$$-${RANDOM:-${$}}
 (umask 077 && mkdir $tmp) 2> /dev/null && break
 done;
 if test -z "$tmp"; then
diff --git a/contrib/pic2graph/pic2graph.sh b/contrib/pic2graph/pic2graph.sh
index 72c5477..dccd9e7 100644
--- a/contrib/pic2graph/pic2graph.sh
+++ b/contrib/pic2graph/pic2graph.sh
@@ -75,7 +75,7 @@ for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
 && test -n "$tmp" && test -d "$tmp" \
 && break
 
-tmp=$d/pic2graph$$-$RANDOM
+tmp=$d/pic2graph$$-${RANDOM:-${$}}
 (umask 077 &&

Re: [Groff] [PATCH] Use bash for several contrib scripts

2014-01-02 Thread Daode
Colin Watson  wrote:
 |I suppose it isn't a fatal incompatibility, since $RANDOM just expands
 |to the empty string on other shells and mkdir will probably fail; maybe
 |we could just leave it alone since the above is really no better than
 |that.[.]

yes of course.
It was just me seeing /bin/bash, and then the dam breaks open many
years too soon..

--steffen
--- Begin Message ---
On Thu, Jan 02, 2014 at 03:03:48PM +0100, Steffen Nurpmeso wrote:
> Colin Watson  wrote:
>  |+2014-01-02  Colin Watson  
>  |+
>  |+ * contrib/eqn2graph/eqn2graph.sh: Use bash rather than sh; $RANDOM
>  |+ is a bashism.
>  |+ * contrib/grap2graph/grap2graph.sh: Likewise.
>  |+ * contrib/pic2graph/pic2graph.sh: Likewise.
> 
> I'd really rather do something like the below instead.

This will amount to $$-$$ on shells that don't support $RANDOM, which
seems rather pointless.  Perhaps just:

  tmp=$d/eqn2graph$${$RANDOM:+-$RANDOM}

then?

> Btw.: interesting that the auto-generated files like `configure'
> simply use $RANDOM, whereas the config.guess and such (i *never*
> used any auto*) do.  Imho it is a bug that the generated scripts
> use /bin/sh but are not compatible to a real /bin/sh.

Good point about configure.

I suppose it isn't a fatal incompatibility, since $RANDOM just expands
to the empty string on other shells and mkdir will probably fail; maybe
we could just leave it alone since the above is really no better than
that.  TBH I think I was trying to placate tools that check for
bashisms.

-- 
Colin Watson   [cjwat...@debian.org]

--- End Message ---


Re: [Groff] [PATCH] Use bash for several contrib scripts

2014-01-02 Thread Daode
Ralph Corderoy  wrote:
 |Hi Steffen,
 |
 |> I'd really rather do something like the below instead.
 |...
 |> -tmp=$d/eqn2graph$$-$RANDOM
 |> +tmp=$d/eqn2graph$$-${RANDOM:-${$}}
 |
 |That's assuming the environment doesn't contain a RANDOM from somewhere.

ph!

 |:-)
 |
 |Cheers, Ralph.

--steffen



[Groff] Fwd: Re: Re: [PATCH] Use bash for several contrib scripts

2014-01-02 Thread Daode
(blush) really nice bicycles..

 Original Message 
Date: Thu, 2 Jan 2014 09:49:27 -0500
From: Mike Bianchi 
To: Steffen Nurpmeso 
Subject: Re:  Re: [Groff] [PATCH] Use bash for several contrib scripts

On Thu, Jan 02, 2014 at 03:03:48PM +0100, Steffen Nurpmeso wrote:
>   :
> Imho it is a bug that the generated scripts
> use /bin/sh but are not compatible to a real /bin/sh.

I _strongly_ agree.
There is no man page for  sh(1) .
There is no executable for /bin/sh .  On Debian ...
  ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Mar  1  2012 /bin/sh -> dash*

And the man page for  dash(1)  says it does not conform to a documented
standard.

The current version of dash is in the process of being changed to
conform with the POSIX 1003.2 and 1003.2a specifications for the shell.
:
Only features designated by POSIX, plus a few Berkeley extensions,
are being incorporated into this shell.

This man page is not intended to be a tutorial or a complete
specification of the shell.

For those reasons, I think  #!/bin/sh  should be outlawed!
(Yeah, right.  That's going to happen.)

Still, within the groff project, could we pick one shell to be the standard?

Or am I trying to inflict order on an unorderly universe?

-- 
 Mike Bianchi
 Foveal Systems

 973 822-2085

 mbian...@foveal.com
 http://www.AutoAuditorium.com
 http://www.FovealMounts.com




Re: [Groff] Fw: Generating ChangeLog files.

2014-01-03 Thread Daode
Werner LEMBERG  wrote:
 |Regarding the abandoning of ChangeLog files: There is an interesting
 |thread right now about this topic in the emacs-devel mailing list.
 |Attached you can find one of the messages, and I agree with Eli.
 |However, other people might think differently...

I never used ChangeLog, only commit messages.  They got better and
more descriptive as time went by.  However, every project may do
it whatever way they want to, of course (and nothing prevents from
writing an entry once and get any desired output in one go).

Groff is nice in particular because of the small ChangeLogs.
Since, the reason that i'm writing this message is that my local
GNULib git repo clone (i've forgotten who depends and not
auto-includes the necessary files in their own repo) is forcefully
downgraded to never 'git gc --aggressive' but only plain 'git gc',
because of their ChangeLog:

  ?0[steffen@sherwood gnulib.git-no_fullgc]$ git show \
  master:ChangeLog | wc
  101149  397227 3800935

Maybe a monster machine is capable to get that right.
Also, i once tried to 'git cvsimport' something with GNU-like
ChangeLogs, but stopped after a few hundred changesets because of
course we were in the process of running into a problem, over the
network.  All of this surely has nothing to do with Groff.

--steffen
--- Begin Message ---

Regarding the abandoning of ChangeLog files: There is an interesting
thread right now about this topic in the emacs-devel mailing list.
Attached you can find one of the messages, and I agree with Eli.
However, other people might think differently...


Werner
--- Begin Message ---
> From: Rüdiger Sonderfeld 
> Date: Fri, 03 Jan 2014 10:31:39 +0100
> Cc: Michael Albinus ,
>   Thierry Volpiatto 
> 
> I usually write patches on a branch and rebase them when they are ready to be 
> pushed.  This always causes merge conflicts for the ChangeLog.  (Maybe [1] 
> could help a bit.)

There should be no merge conflicts with ChangeLog files.  I see an
absolute zero of them.  git-merge-changelog and the changelog_merge
plugin in bzr make this not an issue.

> E.g., GNU Octave replaced ChangeLog with an auto-generated ChangeLog from 
> commit messages and they seem to be quite happy with that solution.

I've seen a couple of projects that eliminated ChangeLogs.  In every
single case, the result was a drastic deterioration in the quality of
the commit log information.

> I know the topic has been discussed several times and it seems a bit 
> pointless 
> to start the discussion again.  But in my opinion ChangeLogs are an even 
> bigger issue than the VC because at least I can work around the latter by 
> using git-bzr.

As pointed out above, you should be able to resolve the former as
well, in no time.


--- End Message ---
--- End Message ---


Re: [Groff] [PATCH] Use bash for several contrib scripts

2014-01-03 Thread Daode
Doug McIlroy  wrote:
 |I must be missing something in the discussion about random
 |numbers. Why does groff need them? In the offered example
 |tmp="$d/eqn2graph$groff_rand"
 |the "random number" serves only to make a (supposedly) unique
 |name. But of course, if the number is truly random, it is not
 |guaranteed to be unique. Why does groff not use the time-honored
 |$$ to serve the purpose?  The only requirement for an absolute
 |guarantee of uniqueness is that the shell script whose pid $$
 |represents lives as long as the temporary file.

POSIX also loomed some notes on temporary files in the shell [1]:

  Having a function like tmpnam( ) in the ISO C standard is
  important in many high-level languages. The shell programming
  language, however, has built-in string manipulation facilities,
  making it very easy to construct temporary filenames. The names
  needed obviously depend on the application, but are frequently
  of a form similar to:

  $TMPDIR/application_abbreviation$$.suffix

  In cases where there is likely to be contention for a given
  suffix, a simple shell for or while loop can be used with the
  shell noclobber option to create a file without risk of
  collisions, as long as applications trying to use the same
  filename name space are cooperating on the use of files after
  they have been created.

  [1] 

--steffen



Re: [Groff] The future redux

2014-02-26 Thread Daode
Volker Wolfram  wrote:
 |Hi all groffers,
 |
 |in fact I'm a newbie on groff tools and macros. But these \
 |tools are the BEST I've used EVER. I enjoy groff so much, I've developed my

I fully agree -- after almost going stony because of loosing
system content _and_ the backups (forgotten PGP password),
including our nifty homebrew TeX package (or it's usable
version..), some simple troff macros could be hacked very fast to
get back to producing correspondence..

 |own three side perspective CAD macro to made my needs. And \
 |a macro for electrical and pipe scheme. And there so much ideas in mind to
 |make more with groff and companions.
 |
 |And as a newbie I don't know about the code and design of \
 |groff. But I've changed from LaTeX to groff because it is simple and easy to
 |understand. (And not tons of binaries and fonts as LaTeX.) \
 |And that is very cool.

..using groff(1) and its' info manual in a plain default from-CD
system installation (of FreeBSD or Halloween Linux, whatever it
was).  It's small, it's fast, it's practically self-contained, and
it is amazing what is actually possible!  Almost open-ended!

E.g., you don't need tricks like lazy-loaded fonts

  \def\rm{\edef\@font@currIsBold{\FALSE}\@font@setFont{rm}}%
  ..
  \def\@font@setFont#1{%
\edef\@font@currFam{#1}%
\csname @font@\@font@currSize#1\endcsname%
  }%
  ..
  \def\normal{\edef\@font@currSize{normal}\edef\@font@currSizeNo{5}%
  \csname @font@normal\@font@currFam\endcsname}%
  ..
  \def\@font@cm@iniFonts{%
  %%  %% . Roman (\rm)
  ..
  \gdef\@font@normalrm{%
  \ifndef{@normal@rm}\@afontadd{@normal@rm}{cmr10 
scaled\nmagstep{5}}\fi\@normal@rm}%
  ..

to get some throughput out of form letters, it does it by itself.

 |My simple wish is:
 |
 |1. Share your groff files and macros without font definitions
 |2. Define for your screenreader font size and margin in .screenreaderrc \
 |and misc stuff
 |3. As you download the file, you can open it with a new screen \
 |reader, which compiles groff file and macro to a PS (PDF) as you like
 |4. Then you can print on paper in different sizes (letter, \
 |A3, A4, A5 etc.) with a new compiler session with your margins and fonts
 |
 |This should not replace html or xml and Internet browser (they \
 |load markup code too and render it on screen)
 |
 |I've tried this in an other situation to print draft and final \
 |PDF files for my own book with different targets in a Makefile and I'm
 |very satisfied. Good typesetting on screen and paper.

Yes, absolutely -- sometimes i have to add a `.hw', but it all
looks really good, i never felt i was missing something,
especially after i discovered that the TeX hyphenation patterns
can be hooked into groff(1)!

Even more, when i look at TeX output once in a while, i indeed
feel uncomfortable, especially when i look from a bit of
a distance: This appearance of «painted uniformity» all over the
paper always makes me feel kind of breathless, and i do no longer
understand why i liked that when i was much younger than today.

On the other hand it would be nice to have the option to simply
hook in .ttf fonts and have a true lookaround typeset engine that
can be turned on with a knob, since unbreakable stuff like "Prof.
Prof. Dr. Blablabla" could be made unbreakable, possibly.
Proofreading can't be helped in the end.

 |On my netbook I think it it's power is enough to render a \
 |good result in a blink of an eye.
 |
 |Please forgive me for my unusual approach to all these things.
 |
 |Once again: GROFF and companions (eqn,pic,tbl, etc.) are great \
 |tools. Thanks to all programmers and maintainers.

And they will be in decades from now.
I fully agree.
Ciao,

 |Regards,
 |
 |Volker
 |-- 
 |Volker Wolfram
 |Lengsfelder Straße 28
 |36460 Dorndorf
 |
 |Telefon: 03 69 63 22 90 22

P.S.:
Fwiw, your mailer is deeply, if not inherently broken.
Updating it would make its maintainer feel a bit more comfortable.
Thank you.

--steffen



Re: [Groff] Permissible characters for hyphenation

2016-05-30 Thread Steffen (Daode) Nurpmeso
Stephen Berman  wrote:
 |Does groff permit characters besides hyphen-minus (ASCII 45) and soft
 |hyphen (octal 255) for displaying hyphenation in man pages?  I'm asking

I have been convinced that soft hyphen is a control character and
not something visual, it should be used as a «break-indicator»
rather than as a hyphenation character, interpretation of which is
left as an excercise for the processing software.  I have no idea
still but would guess groff uses "hyphen minus" U+002D or hyphen
U+2010 if Unicode is possible.

 |because the Emacs package man.el displays references to other man pages
 |(e.g. in the SEE ALSO section) as clickable links, but has a bug when
 |such a reference is hyphenated, and in trying to fix this bug the above
 |question arose (see
 |http://lists.gnu.org/archive/html/bug-gnu-emacs/2016-05/msg01358.html).
 |I'd be grateful for a definitive answer or at least a pointer to
 |relevant documentation.

Sorry.  Truly.

--steffen