Posts

Showing posts with the label Lisp

Elisp utility to open SQLplus from a remote host

If you are in a situation when you have to login to an intermediate or jump host to open SQLplus session to your database, here is a utility that you can make use of. You can store this utility in your .emacs file. Then the utility can be invoked interactively from inside Emacs, by typing "Alt-x open-remote-sqlplus-session-interactive". With autocmpletion, you can specify the session alias that you would like to open. To make the best use of the utility, you need to specify the list of jump hosts and the SQLplus connection strings in the "alias-to-jumphosts-alist" variable. If you need to run any custom commands immediately after opening SQLplus session (in addition to commands in your login.sql or glogin.sql files), you can add these commands in list-of-sqlplus-setup-commands. I find this utility to be a tremendous time saver. Hope you also find it the same way. Here is the utility as a gist:

Loading Lisp file from URL in Emacs

On a given day, I have to login and work from multiple Linux boxes. One thing I find annoying is that every time I make a change to my .emacs file, I have to copy the changes to all the hosts. There are multiple ways to circumvent this issue. One way I find useful is to maintain my custom file as a gist in github (or any where you can host your .emacs file) and use the following code snippet in the .emacs to load the file from the URL. (with-temp-buffer   (shell-command "curl -Ls https://gist.github.com/raw/372f5e3e8aca632d9b82/hello-world.el" (current-buffer))   (eval-buffer)) Let me explain what this code snippet does: It creates a temporary buffer. With the temporary buffer as the current buffer, it fetches the contents of the URL into the current buffer. It evaluates the current buffer. Remove the temporary buffer. If the sample code above works for you, if you eval the "(hello-world)", it will say "hello world" in the mini buffe...

Difference between function, macro and special form in Lisp

A very good description of the differences between function, macro and special forms in Lisp. Read all the way through the end of the email thread.

Good tutorials on Emacs Lisp

There are two pages that I would highly recommend to get started with Emacs Lisp. Xah Lee's tutorial on Emacs Lisp . Steve Yegge's Emergency Elisp . Of course you should always have the Emacs Lisp reference manual handy.

Customizing colors in comint package in Emacs

The default foreground of prompt (gdb, shell, etc.) in the comint package in Emacs is blue. If you are working in PuTTY, the default background is black. Imagine blue on black background. Looks nasty! You can customize the color of the prompt by using the comint-highlight-prompt variable. For e.g. I am using yellow foreground in my system. Here is how I have customized it by adding these lines in my ~/.emacs : (copy-face 'default 'comint-highlight-prompt) (set-face-foreground 'comint-highlight-prompt "yellow") In short, the first lines creates a font-face variable by copying the default face and the second line changes the foreground value of that font-face variable to "yellow". Scott A. Kuhl's .emacs file helped me a lot in understanding how to customize this. Thanks to him.

A Common Lisp eBook

You may love Common Lisp, or you may not. The author of the book Practical Common Lisp seems to be bubbling with all positive testimonies to make you try Common Lisp. At least for me, from the Emacs learner's perspective, I think this book would tend to be good reference material. After all, there is nothing wrong in giving a language a try.