Re: how to get a structure/module tree?



Teika Kazura wrote:

> On Mon, 22 Mar 2010 22:53:54 +0100, clemens fischer wrote:
>
>> My original problem is very simple:  Do I need to start off my
>> ~/.sawfish/rc file with "(require 'apps-menu)"?  I want to set the
>> symbol user-apps-menu.
>
> (define-special-variable user-apps-menu value) does.  It's defvar +
> setq. Like emacs lisp, defvar doesn't change the value if it's already
> bound. But d-s-v always sets the value. In librep, defvar at the same
> time declares it's dynamically scoped. (I often say "it's global", but
> good programmers may frown. ;)

So let them, it's a good approximation when talking to C-programmers.
Thanks for the tip.  Anxious to find out, I just tried without the
require after seeing in $libdir/sawfish/wm/user.jl that .sawfish/rc is
handled specially:  it works.  But not for everything, some things like
run-shell-command aren't defined before evaluating the forms in
.sawfish/rc, the values go into a module called 'user.

>> Is there a tool giving a tree of modules, maybe starting with the
>> assumption that all exported symbols are required by the user?
>
> So probably you don't need it, but as far as I know, no. (But boundp
> can be used.)

In the "TRUE LISPISH WAY" it should be possible to rebind and wrap the
structure handling primitives so they output debug trace information.

  $ rep
  rep 0.90.5, Copyright (C) 1999-2000 John Harper
  ...
  user> ,expand (structure () () ())
  (%make-structure (%parse-interface (quote ()))
    (lambda () (open rep.module-system)) (lambda () ()))
  user>

So it might suffice to make a debugging version of [1], which possibly
keeps track of the nesting level or at least sends the modules open'ed
or access'ed to stderr.

[1] share/rep/0.90.5/lisp/rep/module-system.jl

> Use 'system'. 'Command' in Sawfish is what's bindable to key / mouse
> event. They have different namespace from functions. (You can't run
> a function by key / mouse unless there's a wrapper command.)
> run-shell-command is a command wrapper of 'system' function, and it
> has a configurator support; when you choose that command in the
> configurator, you can enter the shell command name.
>
> Glad you're intersted in Sawfish.

And thank you for helping me!


clemens



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]