[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #64061] pdfpic.tmac resorts to undocumented magic
From: |
G. Branden Robinson |
Subject: |
[bug #64061] pdfpic.tmac resorts to undocumented magic |
Date: |
Fri, 21 Apr 2023 22:25:55 -0400 (EDT) |
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.robinson@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/
- [bug #64061] pdfpic.tmac uses sed badly and non-portably, G. Branden Robinson, 2023/04/17
- [bug #64061] pdfpic.tmac uses sed badly and non-portably, Dave, 2023/04/17
- [bug #64061] pdfpic.tmac uses sed badly and non-portably, G. Branden Robinson, 2023/04/17
- [bug #64061] pdfpic.tmac uses sed badly and non-portably, G. Branden Robinson, 2023/04/17
- [bug #64061] pdfpic.tmac resorts to undocumented magic, G. Branden Robinson, 2023/04/19
- [bug #64061] pdfpic.tmac resorts to undocumented magic,
G. Branden Robinson <=
- [bug #64061] pdfpic.tmac resorts to undocumented magic, G. Branden Robinson, 2023/04/21
- [bug #64061] pdfpic.tmac requires non-standard sed feature, G. Branden Robinson, 2023/04/21
- [bug #64061] pdfpic.tmac requires non-standard sed feature, Dave, 2023/04/22
- [bug #64061] pdfpic.tmac requires non-standard sed feature, Dave, 2023/04/22
- [bug #64061] pdfpic.tmac requires non-standard sed feature, G. Branden Robinson, 2023/04/22
- [bug #64061] pdfpic.tmac requires non-standard sed feature, G. Branden Robinson, 2023/04/22
- [bug #64061] pdfpic.tmac requires non-standard sed feature, Dave, 2023/04/23
- [bug #64061] pdfpic.tmac requires non-standard sed feature, Dave, 2023/04/23
- [bug #64061] pdfpic.tmac requires non-standard sed feature, G. Branden Robinson, 2023/04/23
- [bug #64061] pdfpic.tmac requires non-standard sed feature, G. Branden Robinson, 2023/04/23