Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripting IDE

Reinhard Neurocam
Registered User
Join date: 29 Oct 2005
Posts: 3
02-09-2006 03:59
Hi guys,

the above lsl.el mode didnt' quite work for me (dunno why), so I've rolled my own, as a variant of cc-mode. This simply modifies the standard c-mode indentations to be more consistent with the non-GNU type indentations of the SL-editor, and adds a bunch of font-lock keywords (using the ones from above, PLUS all current lsl-function names).

Seems to work for me, please let me know if you have problems and/or suggestions for improvements.

Cheers,
Reinhard

[v2: updated script: 09/02/2006, 14:23 CET]
[v3: minor improvements, more keywords added, 11/02/2006 13:00 CET]

UPDATE: the problem seems to be that copy&paste'ing from this page breaks the file, so here's a link now: http://www.aei.mpg.de/~repr/SL/lsl-mode.el
Stoph Longully
Registered User
Join date: 22 Oct 2006
Posts: 1
Awesome work Reinhard
11-11-2006 11:59
Thanks for your nice emacs lisp code. It (combined with lslint) have REALLY sped up my development time.

Some comments:

*. Most importantly, it doesn't deal with commenting correctly.
If you hit c-c c-c it starts lines with /* instead of //
and ends lines with */ which is unneeded.

*. There are commands and constants it doesn't recognize for me even though
some (all?) are listed in the lisp code. I list the ones I've noticed below:

llSetScale
llResetScript
llSensorRepeat
llSensor
llGetOwner
llGetCreator
llDialog
llGetAttached
llRequestPermissions
llListFindList
llDetectedKey
llDetectedName
llGetSubString
llStringLength
llSetLinkAlpha
llSetLinkColor
llListen

PERMISSION_ATTACH
LINK_ROOT (but does get LINK_SET)


ALL_SIDES
PRIM_SIZE
PRIM_ROTATION
PRIM_POSITION

*. Minor point: It highlights the word "for" even when embedded in other words.
For instance in:

x_for_man = 0.033;

* "elseif" is highlighted even though it should be "else if" and
"elseif" generates an error.

*. I added the following to my site-lisp.lsl in order to compile the
code with lslint using c-c c-y within emacs:

(add-hook 'lsl-mode-hook
(lambda()
(set (make-local-variable 'compile-command) (concat "c:\\lslint\\lslint " (buffer-name))))
(global-set-key "\C-c\C-y" 'compile))

--------------------------

Thanks again for what is a great tool as it stands. Just putting my 2cents in.

Stoph
Adam Marker
new scripter
Join date: 2 Jan 2004
Posts: 104
update for LSL 1.13
01-02-2007 20:54
As part of the Shill project , I'd like to update one or more of the emacs LSL mode files with the keywords current for LSL 1.13.

I've examined both Phoenix' and Reinhard's files, and I can't tell how to safely update the keyword lists. Any emacs guru willing to consult with me for a bit? Payment: mode file updated for 1.13.
Turkey Scofield
Registered User
Join date: 30 Jan 2007
Posts: 1
lsl-mode extention
02-22-2007 08:02
I modified Reinhard 's lsl-mode.el and make new mode lsl-error-mode.el(Thanks for good job, Reinhard.)

http://www2.ttcn.ne.jp/tatsu/elisp/lsl-mode.el
http://www2.ttcn.ne.jp/tatsu/elisp/lsl-error-mode.el

These new elisp gives you following function.

1. Call lslint
In the script buffer, If you hit C-c C-c then lslint is called and display its results *LSL SYNTAX ERROR* buffer.
(Thanks Stoph. Your code gave me a hint.)

2. Jump to error location
In the *LSL SYNTAX ERROR* buffer, If you hit <Return>, C-m or C-j on the ERROR/WARN line then the cursor jumps to the error location of the script. And you can close this buffer hit <Space>.

3. Correct comment function(update 2/24/'07)
Comment starts with // instead of /* */
And comment insert/delete key is assigned M-;

To install these script, put lsl-mode.el and lsl-error-mode.el in your user elisp directory. And you have to install lslint and set lslint location to the variable 'lsl-checker-lslint-path'.
Ex. (setq lsl-checker-lslint-path "~/local/bin/lslint";) ... to your ~/.emacs

I couldn't add Stoph's another requirements. Because it is so hard to customize font-lock-keywords. And I'm sorry that I cannot give you good advice about keywords update, Adam.

My debug environment
OS: Mac OS X 10.4.8
Emacs: GNU Emacs 22.0.92.1 (i386-apple-darwin8.8.2, Carbon Version 1.6.0)
lslint: v0.2.7debug by masa, built 2006-12-07
Scott Bristol
Registered User
Join date: 20 Jan 2007
Posts: 13
03-10-2007 15:14
I modified the lsl-mode.el too and just integrated your nice error mode and comment change into my modified file Turkey. I also copied your wrapping approach for comment-dwim for comment-region so that should work now too.

My lsl-mode.el has an updated list for constants, functions,... (generated semi-automatically from the wiki mirror I use, I hope I missed nothing), I fixed the problem with the keyword highlighting when they are part of other words and changed some of the fonts around a bit.

I also added some skeleton-mode-abbrevs for all the state-handlers and a forloop (just recently, maybe there are other common elements that could use one too) and a (very simple) eldoc function that will display the function signature for all the ll* functions (semi-automatically from the wiki again, please report missing or wrong ones) when the point is on the name (not inside the parens of the argument list, as I said, very simple implementation) of one of those functions.

http://sociopack.net/lsl-mode.el
http://sociopack.net/lsl-error-mode.el (I didn't modify this but I include the link just in case Turkey's mirror disappears)

Please contact me via IM if you find any errors or have ideas for improving it further (I might be able to help).

Edit: Cleaned up the code a lot and put the updated version in the same place. The updated version now tries to byte-compile itself on load so if you put it anywhere where you can't write byte-compile it yourself after every change you make (the byte-compiled copy must be newer than the .el file to stop it from trying to byte-compile itself).
Rhonda Rokocoko
Registered User
Join date: 8 Nov 2007
Posts: 3
WHere can I find this last version?
06-06-2008 10:12
A whois query for sociopack.net returns "domain not found" Are the above .el files available somewhere else?

Thanks,
Rhonda
Xah Toll
Registered User
Join date: 2 Jun 2008
Posts: 2
09-27-2008 23:43
i'm trying to maintain the latest lsl-mode.

You can find the few source code here:
http://xahlee.org/sl/ls-emacs.html

i'm working on to improve the mode slowly, but i haven't been doing lsl much...

comment welcome.
Xah Toll
Registered User
Join date: 2 Jun 2008
Posts: 2
LSL Function Templates available
12-06-2008 13:11
i just created a set of lsl function templates. It allows you to do similar like command name completion, but insert all the parameter values.

download at: http://xahlee.org/sl/ls-emacs.html

Xah ∑ http://xahlee.org/
Xah Toll
Registered User
Join date: 2 Jun 2008
Posts: 2
new version of xlsl-mode
02-17-2009 14:00
A new version of xlsl-mode is released. This version now provides menu support.

download at: http://xahlee.org/sl/ls-emacs.html
1 2