gbranden pushed a commit to branch master in repository groff. commit c3428341b64521d18c73d5f3cc064e3e05ddf95a Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Wed Apr 26 04:36:05 2023 -0500
[pdfpic]: Refactor (`sy` -> `pso`). * tmac/pdfpic.tmac: Migrate gathering of image dimensions from `sy` and a temporary file to `pso`. (pdfpic@cleanup): Drop `pdfpic*temporary-file` string. (pdfpic@get-image-dimensions): Remove redirection. Invoke `pso`, not `sy`. (PDFPIC): Stop constructing `pdfpic*temporary-file` string. Stop testing `systat` register. Stop sourcing and deleting temporary file. We keep the temporary directory handling because we will need it for the `PSPIC` fallback logic, but it also promises to be really painful to fix that before we have more formatter support for string traversal. See <https://savannah.gnu.org/bugs/index.php?64114>. --- ChangeLog | 13 +++++++++++++ tmac/pdfpic.tmac | 14 ++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index b3a33dc31..e66606213 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2023-04-26 G. Branden Robinson <g.branden.robin...@gmail.com> + + [pdfpic]: Refactor. + + * tmac/pdfpic.tmac: Migrate gathering of image dimensions from + `sy` and a temporary file to `pso`. + (pdfpic@cleanup): Drop `pdfpic*temporary-file` string. + (pdfpic@get-image-dimensions): Remove redirection. Invoke + `pso`, not `sy`. + (PDFPIC): Stop constructing `pdfpic*temporary-file` string. + Stop testing `systat` register. Stop sourcing and deleting + temporary file. + 2023-04-21 G. Branden Robinson <g.branden.robin...@gmail.com> * tmac/pdfpic.tmac: Refactor to make comprehensible some diff --git a/tmac/pdfpic.tmac b/tmac/pdfpic.tmac index 1ba5c004e..72a860fde 100644 --- a/tmac/pdfpic.tmac +++ b/tmac/pdfpic.tmac @@ -44,7 +44,6 @@ . rm pdfpic*file-extension . rm pdfpic*file-name-base . rm pdfpic*temporary-directory -. rm pdfpic*temporary-file . rr pdfpic*do-conversion . rr pdfpic*offset-mode . rr pdfpic*indentation @@ -84,8 +83,7 @@ . as pdfpic*command " \\\\R@pdfpic*height (p;\\2)@ . as pdfpic*command /p' . ec -. as pdfpic*command " > \*[pdfpic*temporary-file] -. sy \*[pdfpic*command] +. pso \*[pdfpic*command] . rm pdfpic*command .. .ec @@ -199,16 +197,8 @@ skipping '\\$1' . return . \} -. ds pdfpic*temporary-file \\*[pdfpic*temporary-directory]/pdfpic\n[$$] -. pdfpic@get-image-dimensions \\$1 -. if \\n[systat] \{\ -. pdfpic@error retrieval of '\\$1' image dimensions failed with \ -exit status \\n[systat]; skipping -. return -. \} -. so \\*[pdfpic*temporary-file] -. sy rm \\*[pdfpic*temporary-file] . +. pdfpic@get-image-dimensions \\$1 . nr pdfpic*did-pdfinfo-work 1 . if !r pdfpic*width .nr pdfpic*did-pdfinfo-work 0 . if !r pdfpic*height .nr pdfpic*did-pdfinfo-work 0 _______________________________________________ Groff-commit mailing list Groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit