1 ; file: shift-sel-to-pasted.scm 2 ; copyright (c) 2016-2020 dmn <graahnul.grom@gmail.com> 3 ; license: GPLv2+ 4 ; 5 ; Make lepton-schematic shift selection to pasted objects 6 ; (when you copy and paste an object, the pasted one will be selected). 7 ; 8 ; Posted on the geda-user mailing list: 9 ; http://www.delorie.com/archives/browse.cgi?p=geda-user/2016/10/22/20:39:25 10 11 ; Usage: 12 ; Add the following to your gschemrc configuration file: 13 ; ( primitive-load "/path/to/shift-sel-to-pasted.scm" ) 14 ; 15 16 ( use-modules ( schematic selection ) ) 17 ( use-modules ( schematic window ) ) 18 ( use-modules ( schematic hook ) ) 19 20 21 ( define ( select-pasted objs ) 22 ( for-each deselect-object! (page-selection (active-page)) ) 23 ( for-each select-object! objs ) 24 ) 25 26 27 ; top-level code: 28 ; 29 ( add-hook! paste-objects-hook select-pasted ) 30