Emacs : eldoc mode and c-eldoc mode

May 22, 2010 CDK 1 comment

eldoc mode as the name suggests provides documentation for Elisp files. This is a very useful and cool mode and shows the function signature in the mode-line when your cursor is on a particular function.  It also provides info on the variables. Check out the screen-shots below.

eldoc : Function signatures

eldoc : Variables description

To start eldoc mode, add the following to your .emacs file

;;Turn on documentation in elisp mode
(add-hook 'emacs-lisp-mode-hook
          '(lambda ()
	     (turn-on-eldoc-mode)))

c-eldoc mode is eldoc mode for c. It displays the arguments of C functions while one is programming.

c-eldoc

To add c-eldoc mode, get the latest c-eldoc.el, copy it in your load-path and then add then following to your .emacs file.

(add-hook 'c-mode-hook 'c-turn-on-eldoc-mode)
Categories: Code, Emacs

Emacs : PKGBUILD mode

May 5, 2010 CDK 2 comments

Discovered an amazing major mode for Emacs a few days back to edit PKGBUILDs. Essentially based on shell mode with the following extra bindings specific to PKGBUILDs.

C-c C-a pkgbuild-tar
C-c C-b pkgbuild-makepkg
C-c C-e pkgbuild-etags
C-c RET pkgbuild-update-md5sums-line
C-c C-r pkgbuild-increase-release-tag
C-c C-u pkgbuild-browse-url

I especially like pkgbuild-update-md5sums-line – very useful.

It also has some other cool functions. Check it out here.

My fork of the same is available here.

Categories: Arch, Code, Emacs

Google Talk invisible mode in Pidgin

January 22, 2010 CDK 10 comments

Setting the status invisible for a GTalk account has been a problem for a while now. Although there are third party plugins available, (like the one here) most of them do not seem to work. The basic reason of this is, although Google Talk is basically based on XMPP , it handles invisibility, away etc in a different way. And according to this ticket on the pidgin bug track, they don’t quite like it :P . After going through a bit of documentation mentioned here, I came up with the following xmpp console commands to make invisibilty work without a problem in pidgin for google talk.

1) This requires the XMPP console so start that plugin. It comes by default in Pidgin and can be enabled via Tools->Plugins.

2) Start the XMPP console. Tools -> XMPP Console.

For more information on the upcoming steps, check the documentation linked above.

3) Send the following XML in the XMPP console.

<iq type='get' to='gmail.com'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>

4) Now get your current status list. Change username to your gmail username before sending :P

<iq type='get' to='username@gmail.com' id='ss-1' >
  <query xmlns='google:shared-status' version='2'/>
</iq>

This list can be pretty big if you have many saved messages. The output should be something like.

<iq to='username@gmail.com/89089080' from='username@gmail.com' id='ss-1' type='result'>
	<query xmlns='google:shared-status' status-min-ver='2' status-max='512' status-list-max='3' status-list-contents-max='5'>
		<status/>
		<show>dnd</show>
		<invisible value='false'/>
	</query>
</iq>

Observe the invisible value there. That is what we will be manipulating to the our status to invisible.

5) Now, to set your status to invisible, send the following in the xmpp console.

<iq type='set' to='username@gmail.com' id='ss-2'>
  	<query xmlns='google:shared-status' version='2'>
		<invisible value='true'/>
       </query>
</iq>

Although, the pidgin status does not change, you are infact invisible. You can check in gmail or ask someone on your chat list :D

6) To get out of invisibility, send the following.

<iq type='set' to='username@gmail.com' id='ss-2'>
  <query xmlns='google:shared-status' version='2'>
    <status/>
	<show>dnd</show>
	<invisible value='false'/>
</query>
</iq>

Here the invisible line is important. Other lines are a copy paste of the result of your status list with some minor changes.

This can be a bit tedious, but if anyone is ready to make a plugin out of it, the currently non working one linked above would be a good start.

Enjoy the power of invisibility.

Special thanks to Amod for helping me to test this.

Categories: Code, General, Open Source

Pidgin Plugins for peace of mind

January 21, 2010 CDK Leave a comment

I guess the title says it all :P

1) Group Blocker

This plugin allows you to block an entire group in plugin. Nice if you have a group of Irritating people in your chat list.

An Arch package for this is available on AUR here.

2) Away on Lock

Pidgin has a feature to set your status to away after a while if idle. However, this feature is known to be quite buggy especially on the Windows version of Pidgin.

The following plugins can be used for the same –

For Linux – Away on Lock. An arch package for the same can be found on the AUR here.

For Windows – Lock ‘n’ Roll

Lock ‘n’ Roll does not change the status if it is busy, invisible or already away. I see this as a bug in the busy case. The code is quite simple to understand and edit and also has documentation. If anyone has a pidgin windows devel environment, that can be changed easily.

Other Third Party Pidgin Plugins.

Since this is the first post of this year, Happy New Year people :)

Categories: Arch, General, Linux

Hashbang #! and amarok1 on Arch

December 7, 2009 CDK 1 comment

The #! at the start of bash, ruby, python scripts is called the hashbang. Its use with the Amarok install –

One or two days after writing the article about amarok1 installation on Arch, a new version of amarok1 with ruby1.9 support was uploaded. As most of the ruby scripts for amarok1 still work only with ruby1.8, I decided to keep my old version. Today, while I was looking through a few bash scripts, I realized that using #! in the needed ruby scripts was a better option. So, now I use the  AUR package and just change the hashbang lines in my scripts to point to ruby1.8 exec. If only I had realized this earlier :P :P

Anyways, more info about hashbang here.

Categories: Arch, Code, Linux