Next: Recent Changes Up: Tools Previous: Installation

lego-mode: Customisation

Notice that the following customisation options work for both Emacs and XEmacs unless otherwise stated.

  1. How can I start the LEGO process on another machine?

    You need to start LEGO via a remote login, a remote shell is not sufficient, because it cannot handle interactive interrupts. Insert

    (setq lego-shell-echo-input nil) ;;substitute the machine of your choice for BIG_JOBS (setq lego-prog-name "rlogin BIG_JOBS") (add-hook 'lego-shell-hook-before-displaying-buffer (function (lambda () (lego-simple-send "stty nl" nil t) (lego-simple-send "lego" nil t) (lego-simple-send (format "Cd \"%s\"" (expand-file-name lego-shell-working-dir)) t t)))) in your .emacs file.

  2. How can I display LEGO modules and the LEGO shell buffer in colour?


    (add-hook 'lego-mode-hook '(lambda () (font-lock-mode 1))) (add-hook 'lego-shell-hook-after-displaying-buffer '(lambda () (font-lock-mode 1))) in your .emacs file.

  3. How can I display the LEGO shell in a separate frame?

    If you are an Elisp hacker, I'd appreciate it if you could help me to tidy up the following. If not, don't worry, just insert in in your .emacs file.

    (cond (window-system (defvar lego-shell-screen nil) ;; customise the frame here (put 'lego-shell-screen 'screen-defaults '((name . "Lego shell") (left . 10) (top . 10) (height . 20) (width . 98) (vertical-scroll-bars . t))) (cond ((string-match "XEmacs\\|Lucid" emacs-version) (put 'lego-shell 'screen-name 'lego-shell-screen) (add-hook 'lego-shell-hook-after-displaying-buffer (function (lambda () (put 'lego-shell 'screen (car (screen-list)))))) (add-hook 'lego-exit-lego-hook (function (lambda () (let ((lego-shell-screen (get 'lego-shell 'screen))) (cond (lego-shell-screen (delete-screen lego-shell-screen)))) )))) ((string-match "^19" emacs-version) (eval-after-load "lego-mode" '(progn (let ((lego-shell-buffer-regexp (regexp-quote lego-shell-buffer-name))) (or (member lego-shell-buffer-regexp special-display-regexps) (setq special-display-regexps (cons lego-shell-buffer-regexp special-display-regexps)))) (add-hook 'lego-shell-before-displaying-buffer (function (lambda () (make-local-variable 'default-frame-alist) (setq default-frame-alist (append (get 'lego-shell-screen 'screen-defaults) default-frame-alist)) ))) (add-hook 'lego-shell-hook-after-displaying-buffer (function (lambda () (modify-frame-parameters (car (frame-list)) (get 'lego-shell-screen 'screen-defaults))))) ))))))

  4. How can I change the behaviour of legogrep?

  5. How can I run a different version of LEGO?

    Use the variable lego-prog-name e.g.,

    (setq lego-prog-name "lego.test") Alternatively, configure (setq lego-prog-name-ask-p t) and you will be asked which program to run when the inferior LEGO process starts up. Click here if you would like to invoke a version of LEGO on another machine.

LEGO Team <>
Last modified: Fri Aug 30 15:49:38 BST