X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qux.com; s=default; h=To:References:Message-Id:Content-Transfer-Encoding:Date: In-Reply-To:From:Subject:Mime-Version:Content-Type:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=UDKsUpJ/K5dAOd/yGgNUeVc7P9fMeZanafcNZA4uZoQ=; b=laHGG30uE9sHtmEXhqHu4iVgBA kdXgLKsh95KZlfq/IVLDMxSWsLYgHVKp5wuFH8Jqh/Z/xOKUE6y5qfw4tF6sVK88sq5uJqKleJSjJ k/5QtXRk2TxoC7wIWswTzlx6aj5A+++LQmW2fsHAw43z/1mxA32ZyHDHBpBkZCR+aYNM=; Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [geda-user] Annoying object selection behaviour in gschem > 1.6.2 From: "Roger Williams (roger AT qux DOT com) [via geda-user AT delorie DOT com]" In-Reply-To: Date: Sun, 23 Oct 2016 16:44:39 -0400 Message-Id: References: <1477080832 DOT 2909 DOT 106 DOT camel AT linetec> <201610212041 DOT u9LKfw5r031245 AT envy DOT delorie DOT com> <1477089908 DOT 2909 DOT 123 DOT camel AT linetec> <1477129015 DOT 2909 DOT 130 DOT camel AT linetec> <141F9C23-F141-42FE-A760-834BBDAA7C2F AT qux DOT com> <86CE0804-4DB5-402E-9D6A-CAC8C69BF910 AT qux DOT com> To: geda-user AT delorie DOT com X-Mailer: Apple Mail (2.3124) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - meta.viewyourip.com X-AntiAbuse: Original Domain - delorie.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - qux.com X-Get-Message-Sender-Via: meta.viewyourip.com: authenticated_id: raw AT qux DOT org X-Authenticated-Sender: meta.viewyourip.com: raw AT qux DOT org X-Source: X-Source-Args: X-Source-Dir: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u9NKiihU023730 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 Thanks, Dmitry! I didn't realise that I could do all of this with Scheme – I will dig into this more! -- Roger Williams Chief Technical Officer, Qux Corporation > On 23 Oct 2016, at 13:56, dmn (graahnul DOT grom AT gmail DOT com) [via geda-user AT delorie DOT com] wrote: > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ; > ; Select entire object by selecting one of its attributes: > ; > > ( use-modules ( gschem selection ) ) > ( use-modules ( gschem window ) ) > ( use-modules ( gschem hook ) ) > ( use-modules ( geda attrib ) ) > > > ( define ( on_select objs ) > ( let > ( > ( parent #f ) > ( attrs '() ) > ) > > ( for-each > ( lambda( obj ) > > ( set! parent (attrib-attachment obj) ) > > ( if parent > ( begin > > ( set! attrs (object-attribs parent) ) > > ( for-each > ( lambda( attr ) > ( select-object! attr ) > ) > attrs > ) > > ( select-object! parent ) > > ) > ) ; if parent > > ) > ( filter attribute? objs ) > ) > > ) ; let > ) ; on_select() > > > ( define ( multi_select_on ) > ( add-hook! select-objects-hook on_select ) > ( run-hook select-objects-hook ( page-selection (active-page) ) ) > ) > > ( define ( multi_select_off ) > ( remove-hook! select-objects-hook on_select ) > ) > > ( global-set-key "F1" 'multi_select_on ) > ( global-set-key "F2" 'multi_select_off ) > > ; > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > Right?