Emacs configs and Github

November 7, 2009 Leave a comment

Its been quite a while since I last had time to write something! Well, not so much as lack of time, but maybe lack of stuff to write about. I have been working in a completely different domain for the last 3 months or so.

Anyways, one of the many things I did to keep my work environment sane and to make my emacs experience better, was to learn a bit of elisp. Then I almost threw away from the previous ~/.emacs that I had, and moved everything together in ~/.emacs.d . Now I’d say thats not the most brilliant idea, since, I made the decision and realised the backup was a week old!

However, my emacs configuration is a lot better now than what it used to be. Things are kept and maintained in a more logical order, or so I presume. Oh! and Github! I now have a real backup system, complete with delta and such.

For the more curious of you, here is the link to the public git repo of my emacs configuration directory.

So let me know how I can improve the elisp-foo in there. Also do share your own methodologies of maintaining your emacs config, the plugins and so on.

Categories: Linux Tags: ,

Managing my windows

May 17, 2009 4 comments

Hah, what a joke. I have been using XMonad for about a year now (well I kept trying different things in between, but came back to it everytime). The most prominent ones (based on how long I used it) other than XMonad are StumpWM, Awesome (2.x) and Openbox.

This morning however, I was particularly inclined to give ratpoison a try once more. Yes, its StumpWM old stable, but still I thought that since I know C better than Lisp, I might enjoy the experience after all. An hour later of searching through DeviantArt for beautiful ratpoison setups to inspire me, I came across ScrotWM (sounds awkwards I know). It is in AUR, so a makepkg later I was ready to run a spanking new WM, which turned out to be quite a disappointment since xft fonts won’t work, and google didn’t turn up enough documentation. Hell, it aint any different from Awesome and XMonad either.

So, I was getting cosy with a decent ratpoison setup, and a problem with gaps showing up alongside the terminal borders, led me to google and finally to Musca. Yet another window manager. Phew. The developer apparently inspired from dwm and ratpoison, tried to combine the best of both worlds. Guess what, its got a huge thread in the Arch Forums too. How come I didn’t notice it earlier?

So then, as it turns out, Musca is ratpoison (or StumpWM for that matter) with the keybindings done right. MPlayer has some problems getting fullscreen, till I used -fstype=none (yea my friend google told me that), made an alias to set it right once and for all. Its written in C, and only 1 file! Tried reading the source, not much luck there though.

Hence, Musca stays on my system for the time being, and till I re-energise myself to configure it to my hearts content, I am back to XMonad.

Categories: Linux Tags:

Idling at home!

May 15, 2009 1 comment

In between browsing stackoverflow and going back to watching movies, at times I feel like writing something. Well not literature per se, its coding I am talking about. I am at this strange junction where language, syntax and paradigm comes across as easilly understandable, however, none of my pet projects ever gets to see the end of it.

Its either “oh boy this database querrying stuff is boring”, or “html and css? hmm lets drop this whole web app thing”, and sometimes sudoku is too challenging while project euler isn’t interesting at all to spend an afternoon chasing maths.

I do read the programming sections in arch forums and ubuntu forums, and yes stackoverflow too, which brings me back to this feeling that despite having studied CS I dont have much coding experience. I know computational theory is quite good but we really had too much theory in unniversity.

So, for this week, I chose yet another language to take a sneak peak into. Ruby. The poignant guide is one of the most amusing texts I have read so far. I seriously hope someday studying all this languages will open my mind to a different dimension where the programming gods finally bless me and I get to complete my first pet project.

Categories: General Tags:

Live CD ain’t all that easy

May 13, 2009 1 comment

Whoa. I have been hearing about the linux-live thing for a while now, thought of using it for making a live-cd of the LFS project I was working on for the final year project. Now, while I did follow the LFS book, I wanted to ship with slightly more recent versions of the packages and ended up with kernel 2.6.29

First it complained about AUFS support not being there (yes I forgot to compile that module :P) then the linux-live script worked fine but the resulting iso would only boot into a blank screen. I wish I knew enough to find out what the actual problem was 😦

Turns out there is (was?) another live cd making script available. Larch. Though evidently it is supposed to have been made keeping Arch in mind, the site claims it is compatible with other distros too. Hmmm. Guess what I got with it?

Kernel Panic – Not Syncing: Attempted To Kill Init Error

Wonder what went wrong! Then I got a plan, lets livify the Arch that I use as my main system. 10 minutes later I was starring at the same error. Whoa. I was kinda relieved as I thought that my initscripts were at fault here.

Luckily, my project guide accepted the work without the live-cd and here I am stuck with a final year project and no idea how to show it to the rest of the world!

Categories: Linux Tags: ,

Just found NERDTree !!

February 15, 2009 Leave a comment

Thats right, a nerdtree. Pretty strange name for a plugin but I guess its quite justified if you consider only nerds use a console text editor so much as to consider turning it into an IDE, slow and steady.

Nerdtree is a plugin for vim.

vim with nedtree plugin

This allows you to browse that directory of yours and open a file in the editor.  Press ‘?’ in the nerdtree window to see what else can be done with it.

Oh and you start nerdtree with “:NERDTree”.

Categories: General Tags:

What time is it?

February 9, 2009 Leave a comment

People using a panel probably has a clock somewhere in there. I know I did, when I used gnome-panel and then later pypanel/tint2 with openbox. Recently, though, I changed to pure openbox, with no panels and system tray. Yes, thats kinda boring, but I still use an old 15″ CRT display and screen real estate is something I don’t like to waste.

Now, while openbox’s key bindings took care of my window managing needs, I started missing the small little clock at the corner. I had conky set up just to display the time and date, but more often than not, it was under the browser or the pdf I was glancing through.

A panel, just for the sake of a clock? Nah thats just preposterous. Then I realised that I already had xbindkeys running, for the mpd controls and all that. So I wrote a really-tiny-little script that displays the time, date and battery for 5 seconds and then goes away.

For the time being, its just a shell script running in an urvtc instance. Maybe someday I will put it in zenity or something like that. However, for what its worth, it shows me the time at a key press, and lets me carry on the good work.

echo “DATE :: $(date +”%Y, %dth %B – %A”)”
echo “TIME :: $(date +”%r %Z”)”
echo -n “BATTERY :: $(acpi|grep -Eo “[0-9%,:]{3,}”|tail -n1)”
sleep 5

Nice and easy, and a proof of the insane customizability of a linux desktop.

Categories: Linux Tags:

Setting up slime (emacs and sbcl)

February 7, 2009 6 comments

I decided to have a go at slime again. After having tried to learn lisp for a couple of weeks last year, I decided its time I learned something job oriented and hence spent a lot more time in python and java. However, not that I am getting bored, I am back to slime :).

I never got used to emacs really, but since slime looks like the best thing for lisp, and the cusp repl somehow doesnt work for me, I took the plunge again.

Installed the emacs-cvs and slime-cvs from the arch repositories,

pacman -S emacs-cvs slime-cvs

Now, after slime is installed it prints some lines, telling you to put certain things in your ~/.emacs . Strangely though, after I started slime from emacs, the REPL didn’t look familiar!! It was different last time, only I forgot what the difference is.

And then the “comma” didn’t work. It’s supposed to bring up a command prompt but instead it just printed a literal comma! Wonders wonders…

After almost a couple of hours of googling, and trying a bunch of things, I went in to #emacs @freenode, and learnt from there that slime now doesnt even load the REPL by default, and it was only then that I noticed that I wasn’t typing at the REPL but at the *inferior-lisp* buffer. No wonder the “comma” didnt work as well as a lot of other stuffs.

So, here is how the new slime works, you got to load up the repl and other stuffs manually. Here’s the slime part of my ~/.emacs

(eval-after-load “slime”
(setq slime-lisp-implementations
‘((sbcl (“/usr/bin/sbcl”))
(clisp (“/usr/bin/clisp”)))
common-lisp-hyperspec-root “/home/sujoy/documents/hyperspec/”)
(slime-setup ‘(slime-asdf
(setq slime-complete-symbol*-fancy t)
(setq slime-complete-symbol-function ‘slime-fuzzy-complete-symbol)
(add-hook ‘lisp-mode-hook (lambda () (slime-mode t)))))

(require ‘slime)

I am using SBCL, and put in these lines in my sbcl config to start the swank server automagically when sbcl starts 🙂

(require ‘asdf)
(push “/usr/share/emacs/site-lisp/slime/” asdf:*central-registry*)
(asdf: oos ‘asdf:load-op ‘swank)

; start swank
(setf swank:*use-dedicated-output-stream* nil)
(setf swank:*communication-style* :fd-handler)
(swank:create-server :dont-close t)

Well, I wrote none of this stuffs myself, mixed and matched from various configs to give me something that actually worked. Hopefully, this will save someone an hour of looking through old configs.

Categories: Programming Tags: ,