[bug #61013] [mom] slide-demo.mom: negative indent

2021-08-07 Thread Peter Schaffter
Update of bug #61013 (project groff):

  Status:None => In Progress

___

Follow-up Comment #1:

Several issues surrounding the warning:

1 - Missing parens around an argument to .in
2 - In slide-demo.mom, .PS should have been given the LEFT
arg because the pic is in a left-quadded tab.  (Good thing it wasn't or the
negative indent warning might not have been spotted.)
3 - In the docs, the LEFT arg isn't listed in the args to PS.
4 - The tabs look better with their headings centred, so I've changed them.

All this will be fixed and reflected in the next full release of mom.

___

Reply to this item at:

  

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




[bug #61022] [ms]: Documention neglects to mention FP macro

2021-08-07 Thread Keith Marshall
URL:
  

 Summary: [ms]: Documention neglects to mention FP macro
 Project: GNU troff
Submitted by: keithmarshall
Submitted on: Sat 07 Aug 2021 09:31:22 PM UTC
Category: Macro - ms
Severity: 3 - Normal
  Item Group: Documentation
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
 Planned Release: None

___

Details:

Internally, groff's s.tmac defines a macro called "FP", and uses it to control
the printing of footnotes.  At the point of definition, I see:


.\" This can be redefined. It gets a second argument of 'no' if the
.\" first argument was supplied by the user, rather than automatically.
.de FP
...


To me, this suggests that the intention is to provide a hook, (albeit
inconsistent with other ms implementations — e.g. Plan-9's ms manpage
documents an FP macro associated with font positions), whereby the user may
choose to modify the appearance of footnotes, yet the documentation (neither
manpage, nor info) has absolutely no mention of it.




___

Reply to this item at:

  

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




[bug #55081] [me] two-column output does not work with very long page lengths

2021-08-07 Thread G. Branden Robinson
Update of bug #55081 (project groff):

  Status:None => In Progress
 Assigned to:None => gbranden   

___

Follow-up Comment #1:

I appear to have a fix for this.


diff --git a/tmac/e.tmac b/tmac/e.tmac
index f204cf6f..e0e6176a 100644
--- a/tmac/e.tmac
+++ b/tmac/e.tmac
@@ -942,7 +942,7 @@
 ..
 .
 .de bc \" *** begin column
-.sp 24i
+.sp \\n(.pu+1u
 ..
 .
 .


Something that bothers me is that me(7), with or without this patch, produces
a 159-line document instead of a multiple of 66 for very simple input like in
the original submission.

___

Reply to this item at:

  

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




[bug #57768] [PATCH] tmac/e.tmac-u: Fix a typo, @e->@q

2021-08-07 Thread G. Branden Robinson
Update of bug #57768 (project groff):

  Status:None => In Progress
 Assigned to:None => gbranden   


___

Reply to this item at:

  

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




[bug #60479] tmac/e.tmac-u is missing .PF macro documented in doc/meref.me

2021-08-07 Thread G. Branden Robinson
Update of bug #60479 (project groff):

  Status:None => In Progress
 Assigned to:None => gbranden   


___

Reply to this item at:

  

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




[bug #61012] [mom] om.tmac: an empty argument to ".substring" produces a warning

2021-08-07 Thread Peter Schaffter
Update of bug #61012 (project groff):

  Status:None => In Progress

___

Follow-up Comment #1:

The fix will be in the git repo when I upload the next full mom release, hence
marking as In Progress.

___

Reply to this item at:

  

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




[bug #61011] [mom] om.tmac: empty parentheses cause a warning

2021-08-07 Thread Peter Schaffter
Update of bug #61011 (project groff):

  Status:None => In Progress

___

Follow-up Comment #1:

The fix will be in the git repo when I upload the next full mom release, hence
marking as In Progress.

___

Reply to this item at:

  

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




[bug #61019] [me] using PS and n1 together produces a lot of diagnostic noise

2021-08-07 Thread G. Branden Robinson
Follow-up Comment #2, bug #61019 (project groff):

Thanks, Bjarni.

I already reached the same conclusion; that's why I marked the status as "In
Progress".

Here's the current state in my working tree.  I haven't pushed this yet.


diff --git a/ChangeLog b/ChangeLog
index f04a058a..1f9e566d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2021-08-08  G. Branden Robinson 
+
+   [me]: Fix PS/n1 combination diagnostic spew and apparent logic
+   error.
+
+   * tmac/e.tmac (@h): Place comment escape sequence immediately
+   after macro argument.  (When redefining a request, one needs to
+   remember that request arguments are not parsed exactly as macro
+   arguments are.)
+   (n2): Prefix with `do` requests using long register names.
+   (n2): Add macro-local register `|l` to store length of first
+   argument.  Don't attempt to extract a substring beyond its
+   bounds, which produces a warning diagnostic.
+   (&&): Define no-op macro for use as end macro in nested macro
+   definition.
+   (PS): Fix unbalanced-else diagnostic by changing `if` to `ie`.
+   (PS): Initialize `PS_nm_cnt` register to 0 instead of relying on
+   implicit definition.
+   (PS): Prefix with `do` definition of long macro name.
+   (PS): Indent call of end macro.
+   (PS): Add comment after escaped space.
+   (PS, PE): Prefix with `do` call of long macro name.
+
+   Fixes .
+
 2021-08-08  G. Branden Robinson 
 
* src/utils/grog/grog.pl (do_line): Recognize `n1` and `n2` as
diff --git a/tmac/e.tmac b/tmac/e.tmac
index 47aaff21..e9f4bd87 100644
--- a/tmac/e.tmac
+++ b/tmac/e.tmac
@@ -288,7 +288,7 @@
 .  sp |\\n(tmu \" move to top of text
 .ev
 .mk _k \" for columned output
-.if \\n(?n=1 .nm 1 \" restore line numbering if n1 mode
+.if \\n(?n=1 .nm 1\"   restore line numbering if n1 mode
 .nr $c 1   \" set first column
 .if \n@>4 .tm -- @h >> .ns nl=\\n(nl %=\\n% _k=\\n(_k tm=\\n(tm
 .ie \\n(?s \
@@ -577,14 +577,16 @@
 \{\
 .  ds |i \\$1
 .  ds |j \\$1
+.  nr |l 0
 .  \" Pick off leading char and rest to check.
 .  do substring |i 0 0  \"
-.  do substring |j 1\" for +N / -N
+.  do length |l \\$1
+.  if \\n(|l>1 .do substring |j 1  \" for +N / -N
 .  ie `\\*(|i`+` \
-.  nr ln (\\n[_ln])+\\*(|j
+.  do nr ln (\\n[_ln])+\\*(|j
 .  el \
 .  ie `\\*(|i`-` \
-.  nr ln (\\n[_ln])-\\*(|j
+.  do nr ln (\\n[_ln])-\\*(|j
 .  el \
 .  nr ln \\$1  \" unsigned N
 .  do nr _#p \\n(.s
@@ -592,6 +594,7 @@
 .  nm \\n(ln
 .  nr ?n 2
 .  rm |i |j
+.  rr |l
 .\}
 .  el \
 .  tm Line \\n(.c -- Bad .n2 value
@@ -599,7 +602,7 @@
 .el \
 \{\
 .  nm
-.  nr _ln \\n(ln
+.  do nr _ln \\n(ln
 .  po +\w''u
 .  ll \\n($lu
 .  nr ?n 0
@@ -1325,6 +1328,9 @@
 .ls
 ..
 .
+.de && \" no-op so we can define and end one macro inside another
+..
+.
 .\"
 .\"PIC
 .\"
@@ -1336,9 +1342,10 @@
 .ne \\$1u
 .nr g7 \\n(.u
 .ls 1
-.if \\n(?n \
+.ie \\n(?n \
 \{\
-.  de PS_nm_check && \" define macro to emit .nm at top diversion
+.  do nr PS_nm_cnt 0
+.  do de PS_nm_check && \" define macro to emit .nm at top diversion
 .  if \n@>4 .tm -- PS: $1 $2 .z=n(.z
PS_nm_cnt=n[PS_nm_cnt]
 .  \" Multiple .PS/.PE in a keep.
 .  if `$2`init` \
@@ -1359,18 +1366,18 @@
 .\}
 .\}
 .el \!.PS_nm_check $1
-.&&
+.  &&
 .  mk _q   \" emit a single numbered line for PS picture
 .  rs
-\&\ 
+\&\ \" space
 .  br
 .  rt \\n(_qu
-.  PS_nm_check suspend init
+.  do PS_nm_check suspend init
 .\}
 ..
 .
 .de PE \" *** end picture
-.if \\n(?n .PS_nm_check resume
+.if \\n(?n .do PS_nm_check resume
 .ls
 .in
 .if \\n(g7 .fi


___

Reply to this item at:

  

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




[bug #61019] [me] using PS and n1 together produces a lot of diagnostic noise

2021-08-07 Thread Bjarni Ingi Gislason
Follow-up Comment #1, bug #61019 (project groff):

  This is the result of a bad programming practice;

  macros are not initialised before they are used.

  The message:

troff: EXPERIMENTS/pic.me:2: warning: macro '&&' not defined

  is the clue.

  '&&' is here used as a "terminating macro" (when '..' can't be used),
 thus it must exist when it is encountered.

  Defining it as empty is enough,
 or one could put a diagnostic message in it.



___

Reply to this item at:

  

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




[bug #61019] [me] using PS and n1 together produces a lot of diagnostic noise

2021-08-07 Thread G. Branden Robinson
URL:
  

 Summary: [me] using PS and n1 together produces a lot of
diagnostic noise
 Project: GNU troff
Submitted by: gbranden
Submitted on: Sat 07 Aug 2021 03:44:48 PM UTC
Category: Macro - me
Severity: 2 - Minor
  Item Group: Warning/Suspicious behaviour
  Status: In Progress
 Privacy: Public
 Assigned to: gbranden
 Open/Closed: Open
 Discussion Lock: Any
 Planned Release: None

___

Details:

Input:


.n1
.PS
circle
.PE
Hello,
world.
.n2
.PS
circle
.PF
This is a circle.


Standard error output:


$ ./build/test-groff -p -me -z EXPERIMENTS/pic.me
troff: backtrace: '.../build/../tmac/e.tmac':291: trap-called macro '@h'
troff: backtrace: '.../build/../tmac/e.tmac':1332: macro 'PS'
troff: backtrace: file 'EXPERIMENTS/pic.me':2
troff: EXPERIMENTS/pic.me:2: warning: tab character in unquoted macro
argument
troff: backtrace: '.../build/../tmac/e.tmac':291
troff: backtrace: '.../build/../tmac/e.tmac':163: macro 'nm'
troff: backtrace: '.../build/../tmac/e.tmac':291: trap-called macro '@h'
troff: backtrace: '.../build/../tmac/e.tmac':1332: macro 'PS'
troff: backtrace: file 'EXPERIMENTS/pic.me':2
troff: EXPERIMENTS/pic.me:2: warning: tab character where number expected
troff: backtrace: '.../build/../tmac/e.tmac':291
troff: backtrace: '.../build/../tmac/e.tmac':163: macro 'nm'
troff: backtrace: '.../build/../tmac/e.tmac':291: trap-called macro '@h'
troff: backtrace: '.../build/../tmac/e.tmac':1332: macro 'PS'
troff: backtrace: file 'EXPERIMENTS/pic.me':2
troff: EXPERIMENTS/pic.me:2: warning: tab character where number expected
troff: backtrace: '.../build/../tmac/e.tmac':291
troff: backtrace: '.../build/../tmac/e.tmac':163: macro 'nm'
troff: backtrace: '.../build/../tmac/e.tmac':291: trap-called macro '@h'
troff: backtrace: '.../build/../tmac/e.tmac':1332: macro 'PS'
troff: backtrace: file 'EXPERIMENTS/pic.me':2
troff: EXPERIMENTS/pic.me:2: warning: tab character where number expected
troff: backtrace: '.../build/../tmac/e.tmac':1362: macro 'PS'
troff: backtrace: file 'EXPERIMENTS/pic.me':2
troff: EXPERIMENTS/pic.me:2: warning: macro '&&' not defined
troff: backtrace: '.../build/../tmac/e.tmac':1345: macro 'PS_nm_check'
troff: backtrace: '.../build/../tmac/e.tmac':1368: macro 'PS'
troff: backtrace: file 'EXPERIMENTS/pic.me':2
troff: EXPERIMENTS/pic.me:2: warning: register 'PS_nm_cnt' not defined


If you turn on compatibility mode, you get some different diagnostics toward
the end.


$ ./build/test-groff -C -p -me -z EXPERIMENTS/pic.me
troff: backtrace: '.../build/../tmac/e.tmac':1367: macro 'PS'
troff: backtrace: file 'EXPERIMENTS/pic.me':2
troff: EXPERIMENTS/pic.me:2: warning: register '_q' not defined
troff: backtrace: file 'EXPERIMENTS/pic.me':15
troff: EXPERIMENTS/pic.me:15: warning: register '00' not defined
troff: EXPERIMENTS/pic.me:2: error: end of file while defining macro 'PS'







___

Reply to this item at:

  

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




[bug #61018] [refer] citation style undocumented for classical macro packages

2021-08-07 Thread Dave
URL:
  

 Summary: [refer] citation style undocumented for classical
macro packages
 Project: GNU troff
Submitted by: barx
Submitted on: Sat 07 Aug 2021 02:13:43 AM CDT
Category: Preprocessor refer
Severity: 1 - Wish
  Item Group: Documentation
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
 Planned Release: None

___

Details:

Peter Schaffter observes in
http://lists.gnu.org:443/archive/html/groff/2021-08/msg00019.html:

"Nowhere is there any indication what style of bibliographic formatting is
provided by the ms/mm/me implementations of refer(1), a matter of some
importance for authors preparing submissions and students writing papers.  Mom
is upfront about formatting in MLA style, which is useful to groffers seeking
a macro package that does MLA.  I believe the other packages should follow
suit and state, in their manpage or in refer(1), which style guide is being
followed for refer(1) bibliographies."




___

Reply to this item at:

  

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




[bug #61013] [mom] slide-demo.mom: negative indent

2021-08-07 Thread Dave
Update of bug #61013 (project groff):

 Assigned to:None => PTPi   


___

Reply to this item at:

  

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




[bug #61012] [mom] om.tmac: an empty argument to ".substring" produces a warning

2021-08-07 Thread Dave
Update of bug #61012 (project groff):

 Assigned to:None => PTPi   


___

Reply to this item at:

  

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




[bug #61011] [mom] om.tmac: empty parentheses cause a warning

2021-08-07 Thread Dave
Update of bug #61011 (project groff):

 Assigned to:None => PTPi   


___

Reply to this item at:

  

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