Follow-up Comment #5, bug #64061 (project groff):

[https://lists.gnu.org/archive/html/groff/2023-04/msg00196.html As discussed
on the list, there are a few tricks available to us.]

1. Run pdfinfo twice and scrape out a different datum on each pass.  I fear
this would give up more than was gained by eliminating grep from the
pipeline.

2. Perform a sed stunt involving the hold space.

3. Use groff's `\R` escape sequence to sneak two register assignments onto the
same input line.

Here's an illustration of the last.


commit 0bad05526a72e63fd189babb166c0ad981370c42 (HEAD)
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
Date:   Fri Apr 21 20:16:21 2023 -0500

    squash Fix Savannah #64061. (\R trick)

diff --git a/tmac/pdfpic.tmac b/tmac/pdfpic.tmac
index 024c10cd4..90a183774 100644
--- a/tmac/pdfpic.tmac
+++ b/tmac/pdfpic.tmac
@@ -77,8 +77,9 @@
 .  as pdfpic*command " | tr -d '\\000'
 .  as pdfpic*command " | sed -n -e '/Page  *size:/
 .  as pdfpic*command s/Page  *size:  *\\([0-9.]*\\)  *x  *\([0-9.]*\\).*$/
-.  as pdfpic*command .nr pdfpic*width  (p;\\1)\\n
-.  as pdfpic*command .nr pdfpic*height (p;\\2)/p'
+.  as pdfpic*command . \\\\R@pdfpic*width  (p;\\1)@
+.  as pdfpic*command " \\\\R@pdfpic*height (p;\\2)@
+.  as pdfpic*command /p'
 .  ec
 .  as pdfpic*command " > \*[pdfpic*temporary-file]
 .  sy \*[pdfpic*command]


This works for me on Solaris 11 (running my "fake-pdfinfo" output generator
instead of the real thing, which isn't installed).

Dave, can you give this a crack on your Mac OS X 10.11.6 host?


    _______________________________________________________

Reply to this item at:

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

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


Reply via email to