Hi Maxime & Sarah, Ludovic Courtès skribis: > Hmm, thinking out loud, what about this: use the same trick as you did, > but replace ‘define-public’ instead of ‘let’ & co., so as to be less > intrusive. > > (define-syntax-parameter current-definition-location > (identifier-syntax #f)) > > (define-syntax define-public* > (syntax-rules () > ((_ prototype body) > (define-public prototype > (syntax-parameterize ((current-definition-location > (identifier-syntax (current-source-location)))) > body))))) > > Since there’s code that assumes ‘package-location’ returns the location > of the (package …) sexp, we could add a ‘definition-location’ field in > , defaulting to ‘current-definition-location’, or tweak > ‘location’ to include both. Below is an attempt at doing this. As discussed on IRC, the first patch switches the ‘location’ field to a more compact format that may reduce load time by a tiny bit, though it’s hard to measure. The second patch introduces an extra field for the definition location; that means that records now occupy an extra word, which is not great, but unfortunately OTOH location is slightly smaller. Example: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,use(gnu packages base) scheme@(guile-user)> ,use(gnu packages accessibility) scheme@(guile-user)> ,use(guix) scheme@(guile-user)> (package-location footswitch) $1 = #< file: "gnu/packages/accessibility.scm" line: 257 column: 4> scheme@(guile-user)> (package-definition-location footswitch) $2 = #< file: "gnu/packages/accessibility.scm" line: 254 column: 0> scheme@(guile-user)> (package-location hello) $3 = #< file: "gnu/packages/base.scm" line: 79 column: 2> scheme@(guile-user)> (package-definition-location hello) $4 = #< file: "gnu/packages/base.scm" line: 78 column: 0> --8<---------------cut here---------------end--------------->8--- Thoughts? Thanks, Ludo’.