Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Rebol mode for Emacs

 [1/20] from: d4marcus:dtek:chalmers:se at: 16-Dec-2000 17:21


Those who use the editor Emacs may be interested in an updated version of rebol.el. Previously almost nothing seemed to work correctly in it. Now it works quite ok. The syntax highlighting can be a bit slow though, so if you have a very slow computer you might want to comment out some of the lines. However, I've tested it with a 30 and a 50 kB file, and even though it takes a couple of seconds to parse it I hardly find it annoying. It's so nice to have proper indentation and color-syntax highlighting. Once you start using it, there's no turning back. You'll find it at: http://www.dtek.chalmers.se/~d4marcus/r Marcus ------------------------------------ If you find that life spits on you calm down and pretend it's raining

 [2/20] from: whip:cs:unm at: 16-Dec-2000 13:32


Howdy, Marcus: YOU ROCK!! Way to go! This rebol.el is awesome! I hacked on that original for a day or more trying to figure out the nesting close braces problem with scant to show for it. I sort of had something that was sort of working but mostly more broken than when I started.. arg! Also, I notice you seem to have solved the problem with the {} braced strings munging the whole parsing state. Wow-- and semi colons do the right syntax coloring and everything! Great job great job great job!! :-) By the way, Your README file has a sentence that just drops off about the original creator of the mode, Joe Marshal, told you something or another? Also, by the way, if you're interested, a while ago I asked one of my professors who's a big emac'er for help on the rebol mode and he told me he wasn't so good with elisp, but he gave me this referal: "Olin Shivers <[shivers--lcs--mit--edu]>, who is world famous for his ability to hack his deep experience with, knowledge of, and fondness for, elisp." I never ended up contacted the fellow-- My excuse being this crazy whirlwind of stuff to deal with that keeps me constantly context switching, but thought you might be interested... I know Sterling will be just as happy too. Now Holger's a total VI guy, so he'll just sneer at our delight... ha ha, but some things can't be helped. ;) Totally grateful!! (-: -jeff

 [3/20] from: d4marcus:dtek:chalmers:se at: 17-Dec-2000 14:27


On Sat, 16 Dec 2000, nop wrote:
> By the way, Your README file has a sentence that just drops off > about the original creator of the mode, Joe Marshal, told you > something or another?
Oops, forgot to finish that sentence. :-) Here's an update: Btw, previous author Joe Marshall told me that he actually preferred the closing brackets to be aligned with the contents of the block. This is not in line with RT's style guides, but I may have to agree with him.
> Also, by the way, if you're interested, a while ago I asked one of > my professors who's a big emac'er for help on the rebol mode and he > told me he wasn't so good with elisp, but he gave me this referal: > "Olin Shivers <[shivers--lcs--mit--edu]>, who is world famous for his
I'm not sure he'd appriciate replying to an awful lot of stupid questions from me. Actually, what I'd really prefer is if someone could update the Elisp manual and make it comprehensive for a newbie like myself. Especially on how to build a major mode from scratch, or modify an existing one. Which variables that are important, how to make indentation functions etc. Anyway, I'm glad you enjoyed it. :-) Marcus ------------------------------------ If you find that life spits on you calm down and pretend it's raining

 [4/20] from: al:bri:xtra at: 18-Dec-2000 7:43


> Oops, forgot to finish that sentence. :-) Here's an update: > > "Btw, previous author Joe Marshall told me that he actually preferred the
closing brackets to be aligned with the contents of the block. This is not in line with RT's style guides, but I may have to agree with him." Hear, hear! Andrew Martin Victorian rebol... ICQ: 26227169 http://members.nbci.com/AndrewMartin/

 [5/20] from: allenk:powerup:au at: 18-Dec-2000 7:22


----- Original Message ----- From: "Andrew Martin" <[Al--Bri--xtra--co--nz]> To: <[rebol-list--rebol--com]> Sent: Monday, December 18, 2000 4:43 AM Subject: [REBOL] Re: Rebol mode for Emacs
> > Oops, forgot to finish that sentence. :-) Here's an update: > > > > "Btw, previous author Joe Marshall told me that he actually preferred
the
> closing brackets to be aligned with the contents of the block. This is not > in line with RT's style guides, but I may have to agree with him." > > Hear, hear!
That's 3GL talk. 4GLs are more often the REBOL way. Cheers, Allen K

 [6/20] from: al:bri:xtra at: 18-Dec-2000 15:33


> That's 3GL talk. 4GLs are more often the REBOL way.
I thought it was 5GL talk. Here's one thing: One Here's many: [One Two Three] It's much like one character: #"A" and many characters: "A B C D E" A parenthesis: (1 + 3) * 2 is one thing, too. So too is a tag!: <a href="www.rebol.com"> and those tags that require a closing tag: <a href="www.rebol.com">Rebol's HQ on the web</a>. are one thing as well. They are all containers. The standard you assign to whitespace formatting for block!, string!, paren!, tag! and HTML/XML should be the same. Andrew Martin Know one thing, know many... ICQ: 26227169 http://members.nbci.com/AndrewMartin/

 [7/20] from: sterling:rebol at: 18-Dec-2000 13:32


Yeah! Way to go! Like Jeff, I still dream of getting those close brackets balanced with the open and not the body of the block. Perhaps that is not yet to be. Anyway, this is a great update to the REBOL Emacs mode. Thanks Marcus, Sterling

 [8/20] from: jeff:rebol at: 18-Dec-2000 19:31


> Yeah! Way to go! Like Jeff, I still dream of getting > those close brackets balanced with the open and not the > body of the block. Perhaps that is not yet to be.
Maybe it is meant to be. Here's a quick hack that makes it work. Add this line to rebol.el to the function rebol-indent-line, right after these three lines:
> ;; Don't alter indentation of a ;;; comment line. > nil > (if (listp indent) (setq indent (car indent)))
Add this: (if (looking-at "[ \t]*[]]") (setq indent (- indent 4))) That's on line 96. That's it and then you have proper REBOL style formatting of close braces. :-) -jeff

 [9/20] from: jeff:rebol at: 18-Dec-2000 19:52


Might want to change that additional line from:
> (if (looking-at "[ \t]*[]]") (setq indent (- indent 4)))
To: (if (looking-at "[ \t]*[])]") (setq indent (- indent 4))) so that parens also nest in the standard style. -jeff

 [10/20] from: dan:rolander:marriott at: 19-Dec-2000 8:31


I've never had the patience to really learn Emacs, but now I think it might be time. I downloaded the Win32 binaries, but I can't figure out how to load rebol.el. There isn't a .emacs file as mentioned in the readme. Can anyone help with this? Thanks, Dan

 [11/20] from: dan:rolander:marriott at: 19-Dec-2000 14:54


Thanks Jeff! Dan

 [12/20] from: jeff:rebol at: 19-Dec-2000 11:11


Howdy, Dan:
> ... I can't figure out how to load rebol.el. There isn't a > .emacs file as mentioned in the readme. Can anyone help with > this? > > Thanks, Dan
Ah... someone makes the first steps into the world of Emacs... < wiping away a sentimental tear... > (-: ======================================================== == Folks, please pardon this quick tip sheet on emacs == ======================================================== So, with win emacs (or any emacs), to get to your .emacs, do: C-x C-f ~/.emacs (Control-x Control-f is find-file.. probably your most common emacs command) Then you can add the stuff from the readme file. You can always load an elisp file in emacs like this: M-x load-file I recommend working through the emacs tutorial when you start out: (C-h T) Also, you can always find out about various features in emacs by doing: M-x apropos Those M- and C- mean Meta- and Control-, respectively, meaning you press meta key (or escape) and press the thing that comes after it, like: M-x means meta key plus the key 'x'. Meta is often the alt key. C-x means a ^X, (control-x). When you type M-x you see a M-x appear in the lower left hand corner. Then you type out a full command, like 'apropos'. Everything in emacs has a full command associated with it, but most things are bound to key sequences. When typing a full command (a M-x command) you can hit tab for emacs to attempt to complete it, or just return if you've typed enough for it to figure out. If you hit return and there's a few possibilities then emacs will show you a list of the possibilities. When ever you need help, hit control-h twice, and you'll get a handy menu of ways for emacs to help you. Then just play with emacs for the next 20 years of your life, discovering new capabilities every other week or so. Bon voyage! -jeff

 [13/20] from: d4marcus:dtek:chalmers:se at: 20-Dec-2000 19:00


On Mon, 18 Dec 2000 [jeff--rebol--net] wrote:
> > Yeah! Way to go! Like Jeff, I still dream of getting > > those close brackets balanced with the open and not the > > body of the block. Perhaps that is not yet to be. > Maybe it is meant to be.
Well, you know why I wrote that, don't you? It's the same old story: A - "So, what about this bug...?" B - "That's not a bug, it's an intentional feature! We wanted it to be like that. Really, we did." A - "Oh...er... B - "You mean you didn't like it...?" *sob* A - "No no, I liked it, I liked it! Please don't cry..." In case you wondered about that. :-)
> Here's a quick hack that makes it work....
Hey it works! I guess quick hacks are the best hacks. Thanks!
> -jeff
You're the jeff that wrote: / (setq tab-width 4) ; Added these two. -jeff / / (setq tab-stop-list ... / aren't you? It seems as if you know Elisp quite well, and also modified some of it long time ago. Makes one wonder why you didn't fix all of it right away. Oh well, doesn't matter now. ;-) Marcus ------------------------------------ If you find that life spits on you calm down and pretend it's raining

 [14/20] from: d4marcus:dtek:chalmers:se at: 20-Dec-2000 19:00


On Tue, 19 Dec 2000 [jeff--rebol--net] wrote:
> > ... I can't figure out how to load rebol.el. There isn't a > > .emacs file as mentioned in the readme. Can anyone help with
Oh, forgot that this could be a problem. Shame one me. ;-) However, .el-files usually don't come with any documentation at all. At best only advanced usage features of the mode is described, and that is definately not a newbie's first concern. Until a couple of months ago, I wouldn't have known how to install a new mode-file either. The tutorial (C-h t) and the FAQ (C-h F) mention them, but I don't think they describe how to install new modes.
> So, with win emacs (or any emacs), to get to your .emacs, > C-x C-f ~/.emacs
Thanks, I think I'll add this tip to the README. Marcus ------------------------------------ If you find that life spits on you calm down and pretend it's raining

 [15/20] from: jeff:rebol at: 20-Dec-2000 21:48


Howdy, Marcus: Was just looking at the wrong spot in the code at the time, not thinking about quick hacks, trying to figure out how to fix the numerous other things that were wrong with the mode (which you did a great job of fixing, did I mention? (-:) It was taking too much time, had to abandon and launch off into a million other things. But it's funny. I've lived with a half broken REBOL emacs mode for the like last three years. Now I can't even imagine it.. (Sorry folks to be yacking on about an editor on the mailing list, but when you've written tens of thousands of lines of code in your favorite, very personalized editor, and it suddenly knows how to grok, colorize, and format all this code you've been feeding it, boy it makes you rather emotional -- Ha ha (: ) Hey-- when I get back from the holiday, I've got some other elisp for running a rebol sub process with com-int, and stuff. I'll clean it up and put it up somewhere. Sterling and I also have rmail send our mail through REBOL, and have it call REBOL to add attachments and detach them. It's also pretty easy to have an elisp function that takes your current buffer and filters through a REBOL script, which opens up lots of possibilities. Cheers! -jeff

 [16/20] from: d4marcus:dtek:chalmers:se at: 24-Dec-2000 17:18


On Wed, 20 Dec 2000 [jeff--rebol--net] wrote:
> Hey-- when I get back from the holiday, I've got some other > elisp for running a rebol sub process with com-int, and > stuff. I'll clean it up and put it up somewhere.
Sounds interesting.
> It's also pretty easy to have an elisp function that takes > your current buffer and filters through a REBOL script, > which opens up lots of possibilities.
Like for example? Except for 'do-ing it, I can't think of anything ATM that I would like to do with an entire buffer. But I can imagine others would, like running it through colorize, and send it to the contrib library. Or to update an embedded script. However, you don't have to take the whole buffer. For example, you could 'do the marked region. You could run 'help on the word under the pointer. Or you could... er, something else. Btw, I updated the file slightly now. The indentation fix is included of course, but font-lock also works better now. Previously it only recognized every other keyword of the same type, for example in "reduce reduce" only one of the the words were colored. This happened because it required each word to be pre- and proceeded with a space or tab, otherwise it would for example match "skip" in "select/skip", or "read" in "my-read_function", because "- _ /" etc wasn't considered as word seperators. It was a "damned if I don't - damned if I do" situation, but I fixed it by changing the syntax table. So... Anyway, it works ok now. :-) Still located at: http://www.dtek.chalmers.se/~d4marcus/r Merry Christmas! Marcus ------------------------------------ If you find that life spits on you calm down and pretend it's raining

 [17/20] from: allenk:powerup:au at: 31-Dec-2000 10:40


Marcus's updated version is available from REBOL ORG. http://rebol.org/rebol.el The old one is still there as http://rebol.org/oldrebol.el Cheers, Allen K

 [18/20] from: dan:rolander at: 31-Dec-2000 9:22


Thanks Allen. I've got it and it works great. Excellent job Marcus! Dan ----- Original Message ----- From: "Allen Kamp" <[allenk--powerup--com--au]> To: <[rebol-list--rebol--com]> Sent: Saturday, December 30, 2000 7:40 PM Subject: [REBOL] Re: Rebol mode for Emacs
> Marcus's updated version is available from REBOL ORG. > http://rebol.org/rebol.el
<<quoted lines omitted: 26>>
> > > > > > Btw, I updated the file slightly now. The indentation fix is included
of
> > > course, but font-lock also works better now. Previously it only > recognized
<<quoted lines omitted: 5>>
> for > > > example match "skip" in "select/skip", or "read" in
my-read_function ,

 [19/20] from: d4marcus:dtek:chalmers:se at: 1-Jan-2001 20:34


On Sat, 30 Dec 2000, Dan Rolander wrote:
> I finally figured out how to use rebol.el with emacs and it seems pretty > cool. But I've been trying to get your updated el file and I can't get > access to your web page. I get this error:
Strange. I've tried it with two browsers without any problems. Marcus ------------------------------------ If you find that life spits on you calm down and pretend it's raining

 [20/20] from: dan:rolander at: 30-Dec-2000 13:45


Hey Marcus, I finally figured out how to use rebol.el with emacs and it seems pretty cool. But I've been trying to get your updated el file and I can't get access to your web page. I get this error: Forbidden You don't have permission to access /~d4marcus/r/ on this server. Dan ----- Original Message ----- From: "Marcus Petersson" <[d4marcus--dtek--chalmers--se]> To: <[rebol-list--rebol--com]> Sent: Sunday, December 24, 2000 11:18 AM Subject: [REBOL] Re: Rebol mode for Emacs [stuff deleted]

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted