[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: current working file name in gschemrc



On Friday 19 November 2010 12:22:05 Kai-Martin Knaak wrote:

> I'd like to replace this with the name of the schematic. The lp command can
> set the base name of the file with the option -t. But how would I teach
> gschemrc to automatically fill in the file name of the current schematic?
> Is there some way to access the file name like this:
> 	(print-command "lp -d PDF -t $CURRENTFILENAME")

Hi Kai-Martin,

You will be pleased to hear that this is doable without my Scheme API branch.  
But everything Paul Tan has told you so far has been wrong. :-(

What we're going to do is to override the Scheme function that is called to 
show the print window, so that it first resets the print-command with the 
filename of the current file.

You'll need to add the following to your gschemrc:

  (define %file-print file-print)
  (define (file-print)
    (print-command (format #f "lp -d PDF -t \"~A\"" (get-selected-filename)))
    (gschem-use-rc-values)
    (%file-print))

It is horrible and nasty, but it seems to work.

Regards,

              Peter

-- 
Peter Brett <peter@xxxxxxxxxxxxx>
Remote Sensing Research Group
Surrey Space Centre

Attachment: signature.asc
Description: This is a digitally signed message part.


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user