delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2019/09/02/10:49:09

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Date: Mon, 2 Sep 2019 16:27:24 +0200 (CEST)
From: Roland Lutz <rlutz AT hedmen DOT org>
To: "Majenko Technologies (matt AT majenko DOT co DOT uk) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
Subject: Re: [geda-user] gschem interaction from external processes
In-Reply-To: <CAPp8_DpMmfLQ1MzYkSyXCQ6KiGxf1+TBLz12s0ztRL7qK4sCCw@mail.gmail.com>
Message-ID: <alpine.DEB.2.20.1909021622220.1424@nimbus>
References: <CAPp8_DqaZpOpdKFrUF7HC9sbCG2ag0a2iuWQrSkOY76U1kRQ6g AT mail DOT gmail DOT com> <alpine DOT DEB DOT 2 DOT 20 DOT 1909021356320 DOT 1863 AT nimbus> <CAPp8_DpMmfLQ1MzYkSyXCQ6KiGxf1+TBLz12s0ztRL7qK4sCCw AT mail DOT gmail DOT com>
User-Agent: Alpine 2.20 (DEB 67 2015-01-07)
MIME-Version: 1.0
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-2003997736-1567434444=:1424
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Mon, 2 Sep 2019, Majenko Technologies (matt AT majenko DOT co DOT uk) [via 
geda-user AT delorie DOT com] wrote:
> For saving I simply iterate over any open windows (not sure if that's 
> really needed?)

It is.

> and then callĀ gschem_action_activate (action_file_save_all, item); on 
> that window.

That's in principle the right thing to do.  The problem is that "Save all" 
doesn't do the right thing--saving each modified page, asking for a 
filename if necessary--but calls s_page_save_all which doesn't do any user 
interaction.

That's where the spurious "untitled_1.sch" files come from.  To be more
precise, it's a combination of three kinds of undesireable behavior:

- If gschem has been invoked without specifying file names on the command
line, or all pages have been closed at some point (including reverting a
single open page, as you pointed out), an untitled page is created.  This
page is still present in the background after other files have been
opened.

- "Save all" doesn't care if a page has been changed; it simply saved all
pages to their internally assigned filename.

- For unsaved buffers, "Save all" doesn't ask for a filename like "Save"
does but simply uses the auto-generated "untitled_1.sch" filename.


> [Reverting is] made even more complex by the fact that you can't modify 
> the GList of pages whilst iterating that GList of pages - so I just dump 
> the page pointers into a temporary array first and work from that 
> instead. It seems to work.

In what kind of situation would you use a "Revert all" action?

--8323329-2003997736-1567434444=:1424--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019