Showing posts with label emacs. Show all posts
Showing posts with label emacs. Show all posts

Saturday, December 6, 2008

Start X Painlessly

Perhaps I should start this post in V. S. Naipaul style with a dedication 'To Sajith for asking me why' ;). Watching over my shoulder while I was working on my laptop, he asking me why I used this particular command to start the X Window server.

$ openvt startx

As command line junkie I work on linux console most of the time, only starting graphical X server with startx command when needed. The problem with using startx command is that it locks up the terminal by printing numerous warnings and messages while the X server starts and thus making the terminal unusable. Also I limit the number of virtual terminal on my computer to just two instead of standard six on gnu/Linux operation system.

So, the openvt command provided by the console-tools package helps me spawn a new virtual terminal and that's where all the warning and messages are printed leaving me to continue working in peace. Another added advantage to this is that I can do startx from a Emacs shell instance too, this is neat!.

Monday, November 10, 2008

Emacs Urdu Language Support

Here a quick heads up on Urdu language support on Emacs-snapshot-gtk (1:20080228-1ubuntu1) on Ubuntu Hardy Heron. Apart from the missing characters and even language direction gets messed up, its good to see some Unicode support but there is a long way yet, I still have to use gedit for editing language files.

Thursday, October 9, 2008

The Youngest "Learning GNU Emacs" Fan

My 11 month-old niece Guna takes liking to my Learning GNU Emacs book. Took few quick shots with my mobile phone, reminds me of Tim Pietzcker's Youngest "Learning Python" Fan post on O'Reilly way back in 2004.

kid playing with emacs book kid playing with emacs book kid playing with emacs book kid playing with emacs book

Tuesday, June 3, 2008

Kompare to the rescue

If you have been reading this blog for the past week then you already know that I am in NLP Summer School in IIIT-Hyderabad. And while doing a project comparing the results of various dependency parsers we had to read through large text files to find the errors and its a real pain. Well, I strong believe in the motto of letting the computer do the dirty work. I would have preferred to use a editor like Vim or Emacs with multiple spilt windows to compare the files and their diff's output. However I found that the KDE's GUI based Kompare (frontend to diff, comp or cmp) to be better suited for this project since my team mates are linguists and quite new to gnu/Linux. Also almost all the lab machines have it installed KDE as default desktop envirnoment.

The above screenshot shows kompare in side-by-side mode and just by using arrow keys or the mouse we could manipulate both the windows at the same time and tally our results. It did help to finish the job quickly but its still a pain.

Thursday, January 10, 2008

Emacs 'Save All'

Don't think that this post is yet another fanatical rant advocating the use of Emacs. Nay, there are enough people doing that already :P . The other day someone remarked that emacs didn't seem to have the 'Save All' open files option which is so often seen in other editors. Instead of jumping on the poor fellow and chocking him to death shouting "If we put all the Emacs options into the toolbar, it would be as long as the great wall of china" , I pondered. Perhaps the answer lies in the fact that Emacs belongs to a age when (screen) editors weren't yet common-place and it does a lot of things in its own way instead of the what is normally expected of decent editors today.

Often these kind of prejudices put off many people from learning Emacs, thus earning the remark of having a (very) steep learning curve. After all if you don't like anything in Emacs you can pick enough Elisp to make work it your way at a later on. Emacs is great grand daddy of all opinionated software, its incantations and finger twisting key binding are all result of habits and preferences of lisp programmers and of RMS(Richard M. Stallman)'s of course. And to end this entry let me mention that emacs does have a save-some-buffers to save all the open files in one go.

Thursday, November 22, 2007

How To Start StumpWM

Stumpwm Logo

That seems to be on minds of many who want to use the swanky StumpWM Lisp-based Window Manager for X. Written entirely in Lisp StumpWM takes REPL programming paradigm to the next level, some people have compared this one to the original Symbolic Lisp machines feature wherein any running program's source can be displaced and modified on the fly.

There is an open bug for StumpWM package (#356948) on Debian BTS for explaination about starting the StumpWM. Instead of launching StumpWM from Emacs or SLIME here created myself a simple shell script called "startstumpwm".

#!/usr/bin/env clisp (asdf:operate 'asdf:load-op 'stumpwm) (stumpwm:stumpwm)

After setting the execute persmission to file with chmod a+x startstumpwm I set an entry into my ~/.xinitrc and start the X server with 'startx' command.

exec startstumpwm

There you go ! Perhaps this will help you until the StumpWM gets its proposed /usr/bin/startwm binary in the next package upload.

Wednesday, November 14, 2007

Emacs Annoyance with Multi-line SSI directives

Talking about SSI(Server Side Includes) is out of place in the world abuzz with web applications developed with programming languages like PHP, ASP, JSP, Python, Ruby and Perl. But do note that there are a lot of web pages out there( perhaps like your universities information pages ;o) that are still powered by SSI.

Here is one annoyance that I face while editing SSI directives using Emacs. When I type a SSI directive with a certain value that spans more than a line Emacs warps around the line which it is not what we want. To avoid this try turning off the "Word Wrap in Text Modes (Auto Fill)" setting in Emacs.

Editing a SSI Directive in Emacs

Emacs Word wraps the line (ooops!)

Emacs SSI word wrap problem

Turn off Emacs Auto Fill Mode

emacs disable auto fill

PS: After writing this entry I realised that the file name in screenshot is ".shmtl" instead of ".shtml". Please kindly excuse I am getting too lazy

Friday, November 9, 2007

Disable emacs backup files on remote machines

Like most systems administrators of the day I learnt vi and used it extensively. Unlike Emacs, vi was standard text editor across many Unix platforms. However times have changed Emacs is now available almost everywhere and also that I have now moved away from system administration towards academics I find myself using emacs more often.

Whenever you save a file, emacs copies the current version to file with same name followed by a tilde(~). Its a good idea to allow emacs to back up files like this since you can revert back to older version of the edited files easily. However this not a good idea when editing files say on publicly accessible remote web server. Since I use AngeFtp to retrieve and edit file in emacs I set ange-ftp to disable backup files in my ~/.emacs file.

(setq ange-ftp-make-backup-files nil)

Wednesday, November 7, 2007

Entertaining Lisp Tutorial From Lisprati.com

Casting SPELs In Lisp Book Cover

Here is a very entertaining Lisp Tutorial Casting SPELs In Lisp from Lisprati.com's Conrad Barski, M.D . This comic book like tutorial teaches the basics of lisp programming language by writing a text based adventure like game.

If you are a Emacs user like me, then there is a Emacs Lisp Edition of the book too. However the book is only translated into only one language Turkish. I guess translating this book into other languages would be a wonderful idea. Get in touch with Conrad if you are interested.

Lastly, If you don't like lisp then you may try the examples in Ruby and Haskell (almost) too.

Happy Spell Casting!!

Popular Posts