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 To: "Majenko Technologies (matt AT majenko DOT co DOT uk) [via geda-user AT delorie DOT com]" Subject: Re: [geda-user] gschem interaction from external processes In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-2003997736-1567434444=:1424" 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 Precedence: bulk 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--