What can I do to help?

Derek Atkins warlord@MIT.EDU
30 Sep 2002 19:49:17 -0400


gnucash@cbbrowne.com writes:

> I would think it almost certain that something analagous to that, which,
> as it happens, is /already supported/, is /MUCH/ more appropriate than
> "loading all the files in a directory."

Actually, there are reasons for both.  The "load everything in a
directory" is certainly appropriate for, say, adding new reports.  I
think it would be great if all a user (or, say, third party!) had to
do to add a new report was to add the file to some well-known
directory.  This way you don't need to modify any existing files in
order to add new reports.

Similarly, with optional packages, I'd like to be able to plug these
in by having a plugins directory that contains scm files that
minimally contain:

        (gnc:module-load "<this-module>" 0)

This way you don't need to modify main.scm every time you create a
new module (which is hard for third parties).

[snip]
> If you need to add an extra directory, such as ~/.gnucash, throw it into
> gnc:*load-path* and "stuff'll work."

No, it wont.  I still need the hook to call it.  I'd like to see a
world where third parties can supply gnucash plugins that can be
dropped into place without modifying anything in gnucash.

> Conclusion:  While it's not hard to make a "load all these files"
> function, I'd much rather suggest using the existent methods of 
> gnc:depend, gnc:support, gnc:load, and gnc:*load-path*.  

This requires a priori knowledge of what exists.  While this is great
for a .gnucash-init.scm file, or within packages, it is not reasonable
for a plug-in model, IMHO.

> The "hook" that is needed is for some reasonably conspicuous part of the
> startup process to perform the following:
>
> ;;; Start user defined portion of processing...
> (define gnc:*load-path* 
>    (cons 
>        (string-append (getenv "HOME") "/.gnucash") 
>        gnc:*load-path*))
> 
> (if (file-exists? (string-append (getenv "HOME")
>                                  "/.gnucash/customizations.scm"))
>     (gnc:load "customizations.scm"))

Yes, this definitely needs to be in there....

However, I'd like an equivalent to /etc/init.d/rc?.d/* for plugins,
too.

Thanks,

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available