Loading ...
Sorry, an error occurred while loading the content.

Re: Simple printing "patch" for MacVim

Expand Messages
  • Matt Tolton
    ... Don t you have to have ghostscript installed to have ps2pdf on your system? --~--~---------~--~----~------------~-------~--~----~ You received this message
    Message 1 of 26 , Jul 4 1:49 AM
    • 0 Attachment
      > set printexpr=system('(ps2pdf\ '.v:fname_in.'\ '.v:fname_in.'.pdf;open\ -a\
      > Preview\ '.v:fname_in.'.pdf;sleep\ 60;rm\ '.v:fname_in.';rm\
      > '.v:fname_in.'.pdf)&')

      Don't you have to have ghostscript installed to have ps2pdf on your system?

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Nico Weber
      ... That deletes the pdf after 60 seconds as well. I don t know if Preview is happy about that. Nico --~--~---------~--~----~------------~-------~--~----~ You
      Message 2 of 26 , Jul 4 1:55 AM
      • 0 Attachment
        >>> It's a bit sad that this has to be 5k what could be a 120 byte
        >>> change.
        >>> But who cares about 5k these days :-P
        >> TBH, I think that the automator solution is more complex than
        >> necessary for this task. Why aren't we doing something like this:
        >> set printexpr=system('(open\ -a\ Preview\ '.v:fname_in.';sleep\
        >> 60;rm\
        >> '.v:fname_in.')&')
        >
        > And what about:
        >
        > set printexpr=system('(ps2pdf\ '.v:fname_in.'\
        > '.v:fname_in.'.pdf;open\ -a\ Preview\ '.v:fname_in.'.pdf;sleep\ 60;rm
        > \ '.v:fname_in.';rm\ '.v:fname_in.'.pdf)&')
        >
        > It first converts the postscript to pdf, so you won't be asked to
        > save the file.

        That deletes the pdf after 60 seconds as well. I don't know if Preview
        is happy about that.

        Nico

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Nico Weber
        ... This fails if Preview takes more than 60 seconds to open the file (entirely reasonable on my iBook when lots of other programs are open). The automator
        Message 3 of 26 , Jul 4 2:05 AM
        • 0 Attachment
          >> It's a bit sad that this has to be 5k what could be a 120 byte
          >> change.
          >> But who cares about 5k these days :-P
          >
          > TBH, I think that the automator solution is more complex than
          > necessary for this task. Why aren't we doing something like this:
          >
          > set printexpr=system('(open\ -a\ Preview\ '.v:fname_in.';sleep\ 60;rm\
          > '.v:fname_in.')&')

          This fails if Preview takes more than 60 seconds to open the file
          (entirely reasonable on my iBook when lots of other programs are
          open). The automator solution seems to work fine, and while it's a bit
          complex, it (seemingly) works reliably.

          Nico

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Frank Hellenkamp
          ... I have a ps2pdf in /usr/bin/ so I *think* it s part of the system (I m not sure.) Have someone a clean system without that much fiddling, which I have done
          Message 4 of 26 , Jul 4 3:11 AM
          • 0 Attachment
            >> set printexpr=system('(ps2pdf\ '.v:fname_in.'\ '.v:fname_in.'.pdf;open\ -a\
            >> Preview\ '.v:fname_in.'.pdf;sleep\ 60;rm\ '.v:fname_in.';rm\
            >> '.v:fname_in.'.pdf)&')
            >
            > Don't you have to have ghostscript installed to have ps2pdf on your system?

            I have a ps2pdf in /usr/bin/ so I *think* it's part of the system (I'm
            not sure.)

            Have someone a clean system without that much fiddling, which I have
            done with mine?

            I *have* an extra ghostscript install but it's in /opt/local/bin/,
            because it's a macports install.


            Frank

            --
            frank hellenkamp | interface designer
            jonas.info@... | mail
            +49.30.49 78 20 70 | tel
            +49.173.70 55 781 | mbl
            +49.1805.4002.243 912 | fax
          • Frank Hellenkamp
            ... The thing is, that the automator workflow in itself eats much resources, and thereof takes longer. The simpler scripting solution works much faster on my
            Message 5 of 26 , Jul 4 3:17 AM
            • 0 Attachment
              >>> It's a bit sad that this has to be 5k what could be a 120 byte
              >>> change.
              >>> But who cares about 5k these days :-P
              >> TBH, I think that the automator solution is more complex than
              >> necessary for this task. Why aren't we doing something like this:
              >>
              >> set printexpr=system('(open\ -a\ Preview\ '.v:fname_in.';sleep\ 60;rm\
              >> '.v:fname_in.')&')
              >
              > This fails if Preview takes more than 60 seconds to open the file
              > (entirely reasonable on my iBook when lots of other programs are
              > open). The automator solution seems to work fine, and while it's a bit
              > complex, it (seemingly) works reliably.

              The thing is, that the automator workflow in itself eats much resources,
              and thereof takes longer. The simpler scripting solution works much
              faster on my g4 powerbook, than the automator-solution.

              So it depends. We could wait much longer than 60 seconds, but sure, it
              is a hack, and you will have an extra process in the background for that
              time.


              Frank

              --
              frank hellenkamp | interface designer
              jonas.info@... | mail
              +49.30.49 78 20 70 | tel
              +49.173.70 55 781 | mbl
              +49.1805.4002.243 912 | fax
            • Frank Hellenkamp
              ... That won t be a problem, when the file is open. The actual file won t be removed from the filesystem until it s closed. Frank -- frank hellenkamp |
              Message 6 of 26 , Jul 4 3:18 AM
              • 0 Attachment
                >>>> It's a bit sad that this has to be 5k what could be a 120 byte
                >>>> change.
                >>>> But who cares about 5k these days :-P
                >>> TBH, I think that the automator solution is more complex than
                >>> necessary for this task. Why aren't we doing something like this:
                >>> set printexpr=system('(open\ -a\ Preview\ '.v:fname_in.';sleep\
                >>> 60;rm\
                >>> '.v:fname_in.')&')
                >> And what about:
                >>
                >> set printexpr=system('(ps2pdf\ '.v:fname_in.'\
                >> '.v:fname_in.'.pdf;open\ -a\ Preview\ '.v:fname_in.'.pdf;sleep\ 60;rm
                >> \ '.v:fname_in.';rm\ '.v:fname_in.'.pdf)&')
                >>
                >> It first converts the postscript to pdf, so you won't be asked to
                >> save the file.
                >
                > That deletes the pdf after 60 seconds as well. I don't know if Preview
                > is happy about that.

                That won't be a problem, when the file is open. The actual file won't be
                removed from the filesystem until it's closed.


                Frank

                --
                frank hellenkamp | interface designer
                jonas.info@... | mail
                +49.30.49 78 20 70 | tel
                +49.173.70 55 781 | mbl
                +49.1805.4002.243 912 | fax
              • Matt Tolton
                ... Let s just not delete the file, then. It will be cleared after awhile, anyway. The automator solution is slower, and it is overkill.
                Message 7 of 26 , Jul 4 11:32 AM
                • 0 Attachment
                  > This fails if Preview takes more than 60 seconds to open the file
                  > (entirely reasonable on my iBook when lots of other programs are
                  > open). The automator solution seems to work fine, and while it's a bit
                  > complex, it (seemingly) works reliably.

                  Let's just not delete the file, then. It will be cleared after
                  awhile, anyway. The automator solution is slower, and it is overkill.

                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_mac" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Matt Tolton
                  ... I don t have ps2pdf on my system. However, I poked around a bit and found pstopdf, which DOES look like it is distributed with OS X.
                  Message 8 of 26 , Jul 4 11:41 AM
                  • 0 Attachment
                    > I have a ps2pdf in /usr/bin/ so I *think* it's part of the system (I'm not
                    > sure.)

                    I don't have ps2pdf on my system. However, I poked around a bit and
                    found pstopdf, which DOES look like it is distributed with OS X.

                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_mac" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • björn
                    Hi, I ve pushed a patch which uses Nico s original suggestion without the delete , i.e. just open the file in Preview and let it handle conversion to pdf.
                    Message 9 of 26 , Jul 5 8:53 AM
                    • 0 Attachment
                      Hi,

                      I've pushed a patch which uses Nico's original suggestion without the
                      "delete", i.e. just open the file in Preview and let it handle
                      conversion to pdf.

                      Although pstopdf is installed by default on both 10.4 and 10.5 it does
                      not give the user any feedback that its processing the file. This is
                      weird when you're trying to print a large file because it seems like
                      nothing is happening. So using that is out.

                      Lots of people think using Automator is overkill. I agree. For now
                      we'll rely on OS X to delete the temp files for us. I guess this
                      could create problems if somebody never reboots their computer and
                      prints large documents several times a day, each day of the year.
                      When that user complains we may already have implemented a nicer
                      printing system so that we may smugly reply "download the latest
                      release!". (One can always hope!)

                      Björn

                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_mac" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    Your message has been successfully submitted and would be delivered to recipients shortly.