Monday, August 21, 2006

Elisp

The default yes-or-no-p function in Emacs is a total nightmare. However, one can alias it to y-or-n-p in order to enter y for "yes" and n for "no". But, it has its own quirk, which is not to clear the minibuffer after entering y or n. So, I wrote this tiny function to clear the minibuffer after the y/n response is typed. It's a useless & fun function to have.

(defun clear-y-or-n-p (prompt)

(interactive)
(prog1 (y-or-no-p prompt) (message nil)))

Another function, that actually does something is this:

(defun indent-buffer ()

"Indent the current buffer"
(interactive)
(indent-region (point-min) (point-max) nil))

This indents the entire buffer (or the rectangle) according to the current indentation. Very handy when editing files which have various levels of "2-spaces/4-spaces per tab" indentation(Ugh!).

Wednesday, August 09, 2006

19-19

His fingers were sweaty. Gripping the mouse as hard as real-world physics will allow him, he concentrated hard on the monitor in front of him ; eyes behind hard-rimmed glasses, searching frantically for that elusive rocket-launcher. Tension reaching a culminating point. One wrong move, one misfire, one sneeze even and it was all possibly over. The crosshair focussed intently in the centre of the screen. "The Temple Of Retribution." Retribution for what? he could'nt help but wonder. "All my life, I've been here. Walking through simulated walls, speaking with AI, completing quests. All from a dark corner in the room. Void. There are no dreams anymore. Just nightmares....of a fearsome creature from the depths of Hell." Convulsing in the darkness, looking at the scrolling lines of text in the chat rooms - One frag left. "I don't know the time anymore, or what day it is. The sweet smell of flowers, the cracking dawn of light, the melancholy of a sunset or the exhilaration of rain - Just memories now." He could see the rocket launcher ahead. The opponent was just rounding the corner of the central arena. "The fury of death. And the swiftness of rebirth. It's all just a respawn." The Tibetan Book Of The Dead. "The Red Rose. The last sight for the eyes." Mortality. "It's a scary thought. The thought of not thinking anymore." Silence. "I am". Time hit standstill. He stood rooted to the ground. Nothing mattered.Not the flipping rocket launcher hanging inches off the ground or the opponent lunging for it. Not the sight of a rocket hurtling at breakneck speed towards him, creating a tiny sonic boom behind it. Not the sneer of an invisible face. Microseconds later, the screen went black. The mouse was left dangling. The room was empty. A life was born. A new one. It was tabula rasa all over again.