groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 54/115: [pdfpic]: Refactor (`sy` -> `pso`).


From: G. Branden Robinson
Subject: [groff] 54/115: [pdfpic]: Refactor (`sy` -> `pso`).
Date: Thu, 1 Jun 2023 10:46:09 -0400 (EDT)

gbranden pushed a commit to branch branden-2022-06-01
in repository groff.

commit 28dedd7be2f6ac6f3f3974643aab45234ba2cf30
Author: G. Branden Robinson <g.branden.robinson@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 9246c0dff..abb33a47a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2023-04-26  G. Branden Robinson <g.branden.robinson@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.robinson@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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]