From: Xah Lee
Subject: Tips for Using Linden Scripting Language with Emacs
Date: 
Message-ID: <1174723827.983151.201360@d57g2000hsg.googlegroups.com>
This page contains some tips on using the Linden Scripting Language
with the Emacs text editor.

SYNTAX COLORING

To make your code automatically syntax colored, put the following
line:

(add-to-list 'auto-mode-alist '("\\.lsl\\'" . c-mode))

in your emacs customization file (usually “~/.emacs”).

Alternatively, you can add the following line:

// -*- mode: c -*-

to the first line of your file. Then, whenever you open that file,
emacs will switch to the C mode.
Reference Lookup

The following will let you lookup a word under cursor in a LSL
reference site.

Add the following to your emacs customization file.

(defun lsl-lookup ()
"Look up the Linden Scripting Language's term in a browser.\n
If a region is active (a phrase), lookup that phrase."
 (interactive)
 (let (myword myurl myurl2)
   (setq myword
         (if (and transient-mark-mode mark-active)
             (buffer-substring-no-properties (region-beginning)
(region-end))
           (thing-at-point 'word)
           ))
 (setq myurl (concat "http://rpgstats.com/wiki/index.php?title="
myword))
 (setq myurl2 (concat "http://wiki.secondlife.com/wiki/" myword))
 (browse-url myurl)
 (browse-url myurl2)
))

You can set up a keyboard shortcut to quickly run this command. For
example, if you want M-1 to run the command, put the following in your
emacs customization file.

(global-set-key (kbd "M-1") 'lsl-lookup)

----
This post is archived at
http://xahlee.org/sl/ls-emacs.html

  Xah
  ···@xahlee.org
∑ http://xahlee.org/