guile gnome-terminal macros take 2


I have added even more functionality to the guile gnome-terminal
module, thanks to all the hints and tips I got here.

The hooks on mouse clicks even work!  So now you can do:

     (define (generic-handler term tag)
       (system (string-append "xterm -T " tag " -e lynx " tag "&")))
     (define handlers-alist
       `(("http://[a-zA-Z0-9\.-/~%=]*" . ,generic-handler)
	 ("ftp://[^ ]*" . ,generic-handler)))
     (define (mouse-click-cb term button row col mods)
       (display (list 'button button))
       (display (list 'col col 'row row))
       (display (list 'mods mods))
       (if (and (= button 1)
		(equal? '(shift) mods))	;; shift-left button handles url's
	   (for-each (lambda (x)
		       (let* ((pattern (car x))
			      (handler (cdr x))
			      (tag (terminal-regexp term col row pattern)))
			 (if tag
			     (handler term tag))))
     (terminal-add-hook-on-click mouse-click-cb)

This code allows you to shift-click with the left button and go to a
url on your screen.

I really don't know what else is desired since this is all *I* need
(context mouse clicks and macros off of the menu that do stuff).
Suggestions welcome...

oh btw, you still need to patch gnome-terminal.c (details below) cuz i
still haven't tried maciej's guile patch.


-------------from the README----------------------------

This is a gtk module that allows you to customize your gnome-terminal
with Guile.

Your gnome-terminal.c's main() function should call scm_boot_guile() like so:

	main (int argc, char *argv [], char **environ)
		scm_boot_guile (argc, argv, main_terminal_program, environ);
		return 1;

Remember to recompile gnome-terminal with additional options of:

	-lguile -lqthreads -ldl -lreadline -lm

After compiling the module (, put's
directory in the current LD_LIBRARY_PATH and execute it like so:

	gnome-terminal --gtk-module=guileterm

The module looks for

Both of these .scm files are in the distribution's "scripts" directory
and should be copied manually.  Sorry...

Your personal settings should go in:


The default example ``system.gnome-terminal.scm'' adds a few menu
items and maps shift-button-1 to a "url-goto" which should call:

	xterm -e lynx [url]

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