Sawfish
Advertisement

How to search lisp funcitons & variables

ack

Ack is something like 'find + grep', written in perl. In Debian, it is renamed 'ack-grep'.

Quickstart: Prepare ~/.ackrc. Teika kazura's example:

# define 'rep type'; this is something like alias to *.jl
--type-set=rep=.jl
# use less by default and set its options
--pager=less -R -M --shift 5 -i
# always color
--color

Sample session:

$ cd sawfish-1.3.4
$ ack "max-height"

Output; matched parts get highlighted:

src/windows.c:55:DEFSYM(max_height, "max-height");
src/windows.c:1253:`max-height', `min-width', `max-width', `height-inc', `width-inc',
lisp/sawfish/wm/commands/size-window.jl:54:        (y-max (cdr (assq 'max-height hints)))
lisp/sawfish/wm/windows.jl:259:                               'max-width 'max-height) hints)) 65535))
lisp/sawfish/wm/state/maximize.jl:275:      (max-height (cdr (assq 'max-height hints)))
...

Note that the search is recursive. If you want to exclude C files, then either of these do the job:

  • $ ack --nocc "max-height" - by disabling 'cc' files. Or '--norep' ignores *.jl files, as defined in ~/.ackrc
  • $ ack "max-height" lisp/ - by specifying directories.

By default, *.jlc files are ignored.

Don't forget to search for librep and rep-gtk source.

emacs tags

If someone knows it, please write it here. Note that in rep, these three definitons exist:

  • (define (func-name args,
  • (defun func-name (args,
  • Sfunc-name (in C files.)

Latest source is preferred over old byte-compiled file

In librep/sawfish, the latest source *.jl file is used, instead of the not-updated byte-compiled *.jlc files, unlike emacs. This is extremely useful in testing.

output to stderr

Example:
(format standard-error "last-command: \"%s\"\n" last-command)

To use this technique for UI, remember that stdout and stderr are redirected to /dev/null in wm/customize.jl.

Nested X Server

Sometimes it is interesting to run X11 programs inside a different X server. This can be done via tools like Xnest or Xephyr. If you want you can use a different user account so you can run completly different configurations for the processes running inside the virtual servers.

IMPORTANT TODO: look if it is possible (and how) to get Xinerama or similar things.

Xnest

Xnest is an old server, that runs as a window of another. It is the part of X. Simplest thing is to run it as DISPLAY :2 and without access checks.

$ Xnest -ac :2
$ export DISPLAY=:2
$ sawfish

You can try with a more complex version, one that sets root window to black, loads xauth info (created with first command), uses two "monitors" of 400*300 (you will get :2.0 and :2.1), disables keyboard extension (this helps if the layout is non US) and then launches different programs, making sure sawfish handles all the screens.

$ echo localhost > ~/.xauth
$ Xnest -br -auth ~/.xauth -scrns 2 -geometry 400x300 -kb :2
$ export DISPLAY=:2
$ sawfish --multihead &
$ export DISPLAY=:2.0
$ xterm &
$ export DISPLAY=:2.1
$ xeyes &

Xephyr

Xephyr is similar to Xnest in what it does, but it has a newer code base and supports some modern X extensions (even if host server doesn't) such as Composite, Damage, RandR. For the best possible performance it uses SHM images and updates the shadow framebuffer via the Damage extension. It also has a visual debugging mode for observing screen updates.

Notice the size parameter is different.

$ Xephyr -ac -screen 800x600 :2
$ export DISPLAY=:2
$ sawfish


patch in mail archive

Note that in the web interfarce of the mailing list archive, some @ signs are not displayed. (It should be. Think of foo@bar.net -> foo bar net.) This can be problematic for texinfo files. Use the original message in your mua or download the gzipped text.

Advertisement