Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1834 > unrolled thread

Using includes in Emacs

Started byCecil Westerhof <Cecil@decebal.nl>
First post2014-03-27 11:37 +0100
Last post2014-03-27 11:14 -0700
Articles 2 — 2 participants

Back to article view | Back to comp.lang.postscript


Contents

  Using includes in Emacs Cecil Westerhof <Cecil@decebal.nl> - 2014-03-27 11:37 +0100
    Re: Using includes in Emacs luser- -droog <mijoryx@yahoo.com> - 2014-03-27 11:14 -0700

#1834 — Using includes in Emacs

FromCecil Westerhof <Cecil@decebal.nl>
Date2014-03-27 11:37 +0100
SubjectUsing includes in Emacs
Message-ID<87ppl8vsfa.fsf@Equus.Decebal.nl>
I am happily trying ‘some’ things with postscript again. It was a
little bit getting used to it after a while, but I am getting used to
it again.

The code I am writing is almost 1400 lines. That is a bit long. In
principal it are different modules. I am using Emacs and with
    C-c C-c

I get a view in Emacs. Is there a way to split the source in several
files and include them? I know about ‘run’, but that only works
without ‘-dSafer’. I could also use ‘gs’ with ‘-f filename’, but that
would be an external command.

At the moment I am using the following:
    (progn
      (shell-command (concat "cd " postscript-dir "; "
                             "gs -sDEVICE=pdfwrite"
                             "   -dNOPAUSE"
                             "   -dBATCH"
                             "   -dSAFER"
                             "   -dQUIET"
                             "   -sOUTPUTFILE=" output-file
                             "   -f meander.eps"
                             " " input-file))
      (find-file (concat postscript-dir output-file)))

It works, but it is not really perfect.

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [next] | [standalone]


#1837

Fromluser- -droog <mijoryx@yahoo.com>
Date2014-03-27 11:14 -0700
Message-ID<550b9fd4-1c1e-47df-be85-ad2d199732c1@googlegroups.com>
In reply to#1834
On Thursday, March 27, 2014 5:37:13 AM UTC-5, Cecil Westerhof wrote:
> I am happily trying 'some' things with postscript again. It was a
> little bit getting used to it after a while, but I am getting used to
> it again.
> 
> 
> The code I am writing is almost 1400 lines. That is a bit long. In
> principal it are different modules. I am using Emacs and with
>     C-c C-c
> 
> I get a view in Emacs. Is there a way to split the source in several
> files and include them? I know about 'run', but that only works
> without '-dSafer'. I could also use 'gs' with '-f filename', but that
> would be an external command.
> 
> 
> At the moment I am using the following:
>     (progn
>       (shell-command (concat "cd " postscript-dir "; "
>                              "gs -sDEVICE=pdfwrite"
>                              "   -dNOPAUSE"
>                              "   -dBATCH"
>                              "   -dSAFER"
>                              "   -dQUIET"
>                              "   -sOUTPUTFILE=" output-file
>                              "   -f meander.eps"
>                              " " input-file))
>       (find-file (concat postscript-dir output-file)))
> 
> It works, but it is not really perfect.
> 

There are some other options suggested in this SO question.
http://stackoverflow.com/q/7587408/733077

There's another SO question where I suggested psinc but
wrote a bad example, and the OP posted a modified script
that would ignore indentation on the `run` lines, so my
example would actually work.
But I'm not finding it now.

I did try once to use M4 for this. The biggest problem
(and it would be the same for cpp) I found was the
difference in syntax. As soon as you put `include(`blah.ps')`
in your ps code, it /must/ be preprocessed before it
will execute. Using regular `run` commands and psinc,
you can still execute everything "straight" by using 
-dNOSAFER.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.postscript


csiph-web