Gettin The Sweet Sauce 64

Forum rules
Share your brain ;)
User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Wed Sep 04, 2013 11:07 am

Creating an emacs environment for enlightened programming:

I'll be honest, I'm really truly unhappy with my little WM. I'm always hacking at the source of it to get special little things out of it. Then I rm the binary, then I remake the package, then I reinstall the whole thing. It sucks. I don't like it.

It's because I wrote it in C that I can't just easily hack it in a live-mode to make it exactly what I want. On the other hand, if it was written in....let's say....Common Lisp, then I could boot into it and make changes from inside of it. I think that's how I should go about making this damn thing work. The problem is that our current emacs environment only supports emacs-lisp and Scheme. While I probably COULD do it in scheme, that is very possibly a painful process. So, let's set up an environment to program some Common lisp with.

First off, I need a compiler for it. I like CMUCL, but that was deprecated by Debian. So, let's go with Steel Bank Common lisp, which is available in the Debian Repos.

Code: Select all

apt-get install sbcl
I considered pulling the cvs (in development) version of slime to add to our build, but let's try the Debian packaged one for the sake of simplicity.

Code: Select all

apt-get install slime

Now if everything just works OOTB, open emacs and use "M^x slime" to open a session through emacs to SBCL.
Image
...that was surprisingly easy. Now we can get down to coding in commmon lisp.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
slartie
Grump
Posts: 416
Joined: Tue Jun 18, 2013 12:35 pm
Location: Denmark
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by slartie » Wed Sep 04, 2013 11:14 am

And I'll just mention StumpWM for good measure.

http://www.nongnu.org/stumpwm/
Stumpwm is a tiling, keyboard driven X11 Window Manager written entirely in Common Lisp.

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Wed Sep 04, 2013 11:42 am

As I mentioned, I'm not happy with my current WM. I don't really like twm all that much either...and since I'm already running a VERY common-lisp based system....let's build an awesome tiling WM written in common lisp to work from. This is one of the things that never really worked on Gangbang, either (although I did try to get it all fixed...but no new iso). This should be like a DOUBLE victory, and tilers work well for development environments.

First, we need a few more Debian Packages:

Code: Select all

apt-get install sbcl sbcl-doc cl-clx-sbcl cl-ppcre autoconf
Then we need the source for stumpwm, which we'll 'git' off of git, since we already know that the Debian one doesn't seem to work on Sid OOTB. After that, we'll change into the directory where we downlaoded the scoure, and build it.

Code: Select all

git clone git://git.savannah.nongnu.org/stumpwm.git
Ironically, Makeinfo doesn't exist as a Debian package...but here's a cool trick:

Code: Select all

sudo apt-get install texinfo
Now we can actually make our package work configure and build hopefully.

Code: Select all

cd stumpwm
./configure && make
If all goes as planned, you should have a stumpwm* binary in the folder with the source, which you can then hack the path into your .xinitrc, and if all goes well again...boot into.

Image

...and EDIT:
Image
It works like a champ. ;) C^t ? brings up a prompt, C^t ! brings up a line to launch urxvt. We'll hack on the userspace soon.

DAMMIT SLARTIE!!!!!! I'm working on teaching them how to make this work!!!! (See above post...I was typing when this bald sob added his post!)
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
slartie
Grump
Posts: 416
Joined: Tue Jun 18, 2013 12:35 pm
Location: Denmark
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by slartie » Wed Sep 04, 2013 12:08 pm

Love you too, Joe :)

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Wed Sep 04, 2013 12:19 pm

slartie wrote:Love you too, Joe :)
Lisp-hackers are a special breed. ;)

Speaking of, now we know how to launch help...and that little splash screen at the upper right hand side of my screen MUST go. So, let's use some lisp-hacking right now.

Since we built it from git, we has no config file. So open up your term C^t ! urxvt (if you know what's good for you) and type:

Code: Select all

touch .stumpwmrc
Now, we can use this file to make permanent changes to our stumpwm environment.
Image

Oh yhea.

Now I know that this isn't really a "sauce64" thing per-se, but hacking lisp is 99% of what this entire distro is about. So, I think that it should count. I guess that we could go through now and start cutting out all of the misc bloat that we had to pull in during the build process. I may keep most of it around, though, since I'm going to be working with common-lisp a great deal. Happy hacking.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Wed Sep 04, 2013 8:17 pm

Okay, so after dealing with my new toy (stumpwm)...and then working on getting some decent low-level control with my own C-based WM with a little assistance form Unia...I cranked up my new lisp-machine in a box to find out that I was running some kind of cracked-out NOT-sbcl inferior-lisp.

Well, that's probably because even if we can get all of our packages from Debian...they don't even know how to configure them to work right. Nobody speaks lisp these days.

So, open up your .emacs file...and repeat after me to get slime+sbcl to work inside of emacs like a Ménage à Trois of common-lisping.

Code: Select all

;;Get slime to associate with sbcl
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
(setq inferior-lisp-program "/usr/bin/sbcl")
(require 'slime)
(slime-setup)
Debian puts slime in a weird spot, so we're just working around that to make sure that while inside emacs (M^x slime) == calling sbcl. If it works right, you'll get a totally sweet {CL-USER>} prompt. Otherwise, you're going to be stuck looking at a totally hideous REPL with about 6 lines per prompt.

Image

(edit: Toolbar added for dramatic effect)
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by machinebacon » Thu Sep 05, 2013 4:59 am

Damnit, this thread calls for a new edition -- guess what ;)
Thanks Joe for the instructions - as we know: Debian (and DM/DD) suck.
..gnutella..

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Thu Sep 05, 2013 6:35 am

^^ In regards. I got Slime+sbcl+emacs working on my 32-bit sid/exp system. It should be as simple as following those instructions and then copying my .emacs file over to my Sauce64 system...right?

WRONG!!!

Debian hates lisp. I've decided. So, assuming that you're doing this on Sauce64...you'll be missing an entire package that is required to make it work.

Code: Select all

apt-get install cl-swank
If you try to fire up slime inside of emacs, you'll get ye' olde inferior-lisp again, and it will boot immediately into a backtrace (that's for lisp debugging, in case you're new to this.) So, since I pulled a Slartie and removed/purge my emacs23, and pulled in emacs24...I can tell you how to get it to work here as well:

Code: Select all

;;Get slime to associate with sbcl
;;the path MAY be emacs or emacs24...depending on build
(add-to-list 'load-path "/usr/share/emacs24/site-lisp/slime/")
(setq inferior-lisp-program "/usr/bin/sbcl")
(require 'slime)
(slime-setup)
Append the above into your .emacs file after getting the swank-loader (cl-swank) from Debian. If you're getting errors, allow me to recommend a quick 'file / -name slime' search to let you know where in the hell apt put your files. You may have to adjust the 'load-path "foo/bar/slime' to get that part to work right on your particular system. The return on your search will probably include the recipes from ELPA...but you want the one that's an actual directory. It should be in /usr/share/whatever. I need to test this on a few more systems to figure out how they're all different.

Image
Last edited by DebianJoe on Thu Sep 05, 2013 7:13 am, edited 1 time in total.
Reason: pics or it didn't happen
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by machinebacon » Thu Sep 05, 2013 7:45 am

Stupid little question once again: in the Debian repos we also find a package called "xemacs21" which is obviously not Emacs. IIRC this was something like a 'drop-in' Emacs when development in real Emacs got stuck or something like this.

Any opinions on this masterwork? How about vile, zila and jove? Climacs? Are they worth to mention, and who has tried some/all of them?
..gnutella..

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Thu Sep 05, 2013 8:15 am

Xemacs v. Emacs == politics. I tend to shy away from corporate-backed projects, which is what xemacs is. Plus, emacs is a standard. They're highly cross-compatible.

Vile == I use vi only when necessary, so I'll keep my keychains TYVM.

Zile == Midground between functionality and lightweightedness. I don't use it, because nano!

Climacs (good name)/no opinion. Haven't used it. Seems cool at first glance.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
slartie
Grump
Posts: 416
Joined: Tue Jun 18, 2013 12:35 pm
Location: Denmark
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by slartie » Thu Sep 05, 2013 9:52 am

Xemacs - If you like the "good old days" and simply want to be stuck in Emacs 21.x land, then xemacs could be for you. That's an oversimplification of course, but a lot of the stuff in e24.x will never find its way to Xe. Version-wise they're so far apart now that I find Xe to be irrelevant. Xe fans will object to that of course, but they can just suck it.

Vile - no. just no.

Zile - Completely pointless in my opinion. I have a lot of those ... opinions. Just like we have editors. As DJ says - nano.

Climacs - I was excited about this one, but people lost interest in it 4-ish years ago, and nobody has been poking at it since. Probably because of the several implementations in the trunk of emacs 24.x> that are going to achieve the same thing.

Jove - feels like an emacs that can't do all the things I want it to do. Simplification just for the sake of it. It's closer to being "just an editor" more than anything else. Just another waste of time when you want to get into the core of what the emacs philosophy is - a self contained work environment.

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Thu Sep 05, 2013 10:19 am

I'm pretty much going to agree with Slartie 100%, even though it's in my nature to argue. The true power of emacs is that it's useful for everything with a little bit of work.

It's almost impossible to figure out what to "add to the environment" that stays on an emacs theme, as it can be made to do all of the things with minimal hacking. Climacs? Well, I JUST finished getting a killer common-lisp implementation to get along with emacs...so it's not really needed anymore. I've also covered getting gnuguile (scheme) to play with it. You can even (via pymacs) get it to work with a totally different language.

With being highly extensible comes not really needing much more than a solid base in getting it to do what you want it to. The reason for emacs over other lispy editors is that there are huge quantities of hacks already sitting around to simply be loaded and used.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Wed Sep 11, 2013 7:15 am

Let's get back on track with doing fun stuff from emacs.

I know I've discussed "M^x Shell" and Bacon linked to "M^x eshell", but since the question "How do you check your email" came up the other day, and we're all divided about what the best way to check email is...let's look at a simple command that bring emacsensei to the land of the Knights-of-the-cli.

Code: Select all

M^x ansi-term
This one is really easy, and it's not one of my normal "add 50 lines of lisp to your .emacs file" type of tips. It's far more flexible than that. The essential beauty of the ansi-term is that it's a terminal window within emacs that will allow you to feed it an exec line on startup. I normally just go with /bin/bash and launch whatever program I want after that. The ansi-term supports....ANSI! Thus, a trivial version of curses programs can be run inside of it. Let's launch htop for fun.

Image

Awesome.

So, why do I mention this in regards to email? Well, MUTT is favorite of many *nixers. So, you could technically set up your MUTT client, and then launch it from within emacs. Pretty cool, right?

Assuming that you're a pervert, you could also run vim inside of emacs (negating all "vim is better text editor" arguments), or run emacs -nw --ansi-term in emacs -nw --ansi-term in emacs -nw --ansi-term in emacs -nw --ansi-term (I did this earlier just for fun...it's stupid, and your keybinds end up all over the place.) The only thing limiting the possibilities of emacs here is your imagination.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
slartie
Grump
Posts: 416
Joined: Tue Jun 18, 2013 12:35 pm
Location: Denmark
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by slartie » Wed Sep 11, 2013 9:42 am

It should be mentioned that the ansi term can be somewhat sluggish since everything is piped through the lisp interpreter. Curses based programs can be a bit of a teeth puller, but it gets the job done.

User avatar
xaos52
The Good Doctor
Posts: 190
Joined: Thu Aug 15, 2013 11:59 am
Location: Eernegem, Belgium

Re: Gettin The Sweet Sauce 64

Unread post by xaos52 » Wed Sep 11, 2013 4:44 pm

As promised, here are my emacs config files.

my github repos

Thanks to Joe for reminding me to post them.
Hope they are usefull to any emacser in these forums.

PS: Read the README.md file first.
Connected. Take this REPL, brother, and may it serve you well.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by machinebacon » Wed Sep 11, 2013 5:10 pm

xaos52 wrote:As promised, here are my emacs config files.

my github repos

Thanks to Joe for reminding me to post them.
Hope they are usefull to any emacser in these forums.

PS: Read the README.md file first.
Thank you thank you thank you :)
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Gettin The Sweet Sauce 64

Unread post by GekkoP » Fri Sep 13, 2013 8:18 am

Well, what can I say. DebianJoe already shown me the light about emacs on #! forums. Now this is even better. I got emacs24, grabbed a couple of configs from DJ file and I just wrote a file in org-mode to see what's the fuss was all about.

Thanks for the info about emacs-w3m. I'm about to check that lisp manual pointed out in the fist page of this awesome topic. Give me time, boys, I want to learn some of your crazy stuff. And I want emacs set as my default editor for everything, of course.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by machinebacon » Fri Sep 13, 2013 11:48 am

export EDITOR=emacsclient
actually, and run emacs in --daemon mode. Just my opinion. And TBH I am not extremely pleased with emacs-w3m.... but that's w3m's fault.
..gnutella..

User avatar
slartie
Grump
Posts: 416
Joined: Tue Jun 18, 2013 12:35 pm
Location: Denmark
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by slartie » Fri Sep 13, 2013 3:03 pm

w3m is a little whiny bitch. That's why I tend to stick to elinks for all my TTY browsing and Chromium for everything else.

Getting stuck in with emacs is the best way to learn. Go exploring in the package list and check out random stuff, just to see how it works. Hell, you might stumble on something that will be useful to you.

Anything with parenthesis (lisp) - paredit is amazing.
Snippet-o-holic - yasnippet is for you.

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Fri Sep 13, 2013 4:18 pm

Jumping in and just starting somewhere is the best way I learn anything. I make mistakes, and then later realize why they're mistakes...and correct them, and just roll on like that. I will say that Xaos52's configs are a killer way to get a highly efficient setup done very quickly without having to learn the el-hacking side of it immediately. Still, you'll want to change things and learn as you go. Using more emacs tends to make you want to use more emacs tends to make you want to use more emacs, which is appropriately recursive.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

Post Reply