~:: kalyan ::~

January 29, 2009

emacs tweak

Filed under: emacs, Linux, Script — Tags: — skalyanasundaram @ 5:34 pm

Backspace
While programming in emacs have you ever felt, you have a tab character (it is “\t” and not 8 contiguous space) and when you press backspace, instead of deleting the “\t” character, it deletes the characters one by one. It happens atleast in c, c++ mode and but not in python-mode. So you press a tab character to undo that press backspace 8 times. Isnt that tedious?

In the background the backspace character is attached to a function called “backward-delete-char-untabify”. This first converts the tab to chars and delete one character.

Lets fix it,

put this in your .emacs

(gloabl-set-key [backspace] ‘backward-delete-char)

This function does only one job, just delete the preceding character, including “\t”.

This gets applied globally everywhere in emacs. But we want to do this only when do programming. Lets do this only when we load the c-mode by doing the following

(add-hook ‘c-mode-hook ‘(lambda ()
(local-set-key [backspace] ‘backward-delete-char)))
Add this to the specific mode’s hook where ever you want to fix.

Update

Ofcourse, the above was a poor man’s solution. I did not mention it fully. When c-mode gets loaded the backspace is bound to c-electric-backspace. This take two direction based on the inputs and a variable.

first it checks the variable c-hungry-delete-key, if its true, it calls c-hungry-delete-backward which delete all the whitespace including the new line. By default this is set to nil. If you want this do M-x c-toggle-hungry-state.

Otherwise it calls the function pointed by the variable c-backspace-function. By default it points to backward-delete-char-untabify. This is where we reach if you have not modified any variable.
Now we have two solution,

1. set the variable “c-backspace-function” to “backward-delete-char”
2. The backward-delete-char-untabify again operate based on the variable “backward-delete-char-untabify-method” by default its untabify. It can take 4 values,
“untabify” – convert tab to space and delete one char
“hungry” – delete all the tabs, space backward
“all” – delete all the tabs, space and newline backward
nil – delete only one character whatever it is.

Our expectation is to delete one tab at a time. So set the variable backward-delete-char-untabify-method to nil. That should do the job

January 27, 2009

emacs tweak

Filed under: emacs, Linux, Script — Tags: — skalyanasundaram @ 8:36 pm

If you are working on a perl file and using emacs then emacs can really help. By default the perl-mode is loaded. Thats bit old I guess. Instead use cperl-mode which is much more improved than the perl-mode. With the cperl-mode you can get

  • Electric mode, its when you type if it automatically generate if () {}…
  • Better font-lock mode for perl
  • Help. Keep your cursor on some keyword for example use after a few seconds the minibuffer will show the help of use operator.

So make sure to replace the perl-mode by cperl-mode by doing the following in your .emacs

(defalias 'perl-mode 'cperl-mode)
and also load all the functionality by,
(setq cperl-hairy t)

Apart from this I also use flymake-mode which compiles your program as you type and mark it when there
is an error found. Load the file,
(load "~/.emacs.d/flymake.el") and enable the flymake mode.

I also see this flymake can work for c,c++,java, but haven't tried that. I also see some php extensions.

June 9, 2008

Emacs project

Filed under: emacs, General, Linux, open-source — Tags: — skalyanasundaram @ 3:46 pm

I had faced several configuration issue while using emacs as my primary development environment. All is configurable,. but it is just to put together.

I use desktop.el, cscope+.el, etags and each one of them annoyed by conflicting desktop files, having cscope key bindings while using erc or gnus, conflicting etgas between multiple projects correspondingly…

I had tried few things like, ecb, cedet but nothing suited for my requirement. So this is the initiative to make it nice.

I had kept my epr file here and here

March 23, 2008

Brainshare week

Filed under: dhcp, General, life, Linux, open-source — Tags: — skalyanasundaram @ 6:18 am

Made my first trip to Brainshare, in SLC. Things went well. Customers partners and issues, requests, satisfication, queries and many more. I had given a talk in BrainShare on DNS/DHCP on OES2 linux, the new features and migration. There were two sessions. I guess in the first session many ppl find it difficult in my indian accent. I could correct that to some extend in my second sessions but still I guess it was difficult.

Had a chance to attend the Hack week demo from the middle. Srini, calvin, Brady’s,.. demo was amazing. The sharing of tasks, notes using giver and evolution meeting setup and openoffice animations all seems to me great stuff. The session was started before I go, so dont know how much i missed it.

Hope this week I get chance to work with NCP and DST folks closely and get some brain food.

Apart from the work could not get much time. We tried to go Antelope island and ofcourse nothing to see much and the to SLC temple, again we cant enter but we could get into assembly hall and other buildings. I met sister low in the assembly hall and the surprising thing is she welcomed me in Tamil. She is basically Malasian and grown up in a tamil family. She showed us the pin drop where with out a mike and speakers you could hear a pin drop sound. Basically to explain the tallent of the mormons civil architects in the earlier.

Moved to provo today or yesterday. Lets see about this week.

(Photos latter)

January 1, 2008

Happy New Year

Filed under: emacs, General, life, Linux, open-source — skalyanasundaram @ 11:47 am

After the Mumbai trip, had a chance to go to home. Novell had announced a shutdown for four days.  Good for me, home food, sleep, TV, Movie  and sleep all the remaining time. Unfortunately Jan 1st is the working day. I planned to return and not to take leave and I need to take more leaves on this month itself.  But I decided not to spend the new year in the travel, so did a day time travel. But still I thought I am going be late for just few mins or seconds for the new year. I was sad but luckily I got down at banaglore at 11:55, people started firing crackers for the new year. I felt like my arrival is being celebrated at bangalore. 😉 hehe I should be happy. Had called up few of my friends and slept alone thats all.

Emacs: 
I do not want the ERC> prompt. It actually confuses, because every channel buffer has the same prompt. Either remove it and keep a simple “>” mark like rcirc or make like #emacs>,  #dns> depend on the channel name. This following code actually helps

(setq erc-prompt (lambda ()
(if (and (boundp ‘erc-default-recipients) (erc-default-target))
(erc-propertize (concat (erc-default-target) “>”) ‘read-only t ‘rear-nonsticky t ‘front-nonsticky t)
(erc-propertize (concat “>”) ‘read-only t ‘rear-nonsticky t ‘front-nonsticky t))))

October 11, 2007

gmailfs

Filed under: Linux, open-source, web — skalyanasundaram @ 8:41 am

I came across of this gmailfs while crawling for fuse related stuff. It is a very (beautiful && (useful for the required ppl)). A normal gmail user might not want this. It is very useful for the file transfers. For file transfer we do attach the file in the mail and save it as a draft atleast i did and this gmailfs also does the same. But it is basically a file system. It does more than that

I dont need to bring my pen drive to take copy of my docs from office to my home. I can simply do cp myfiles ~/gmailfsfolder and in home I can do cp ~/gmailfsfolder MyFolder. Thats all. Isnt useful. But the only problem is you have keep your gmail password in the conf file as plain text.

How i configured gmailfs for my account is here

October 9, 2007

dhcp-ldap patch temporarily not available

Filed under: dhcp, Linux, open-source — skalyanasundaram @ 11:48 am

The link for the project dhcp-ldap integration which i had mention in my previous page (http://home.ntelos.net/~masneyb/dhcp-3.0.5-ldap-patch) is temporarily not available due to Brian’s personal reason. I had requested him to provide a new link in some other public server.

Till then hold on. If anybody is interested i can generate the whole patch and give you.

Hope I will get a reply from him soon.

It is back again here

May 23, 2007

Using Thunderbird instead of evolution

Filed under: General, Linux, open-source — skalyanasundaram @ 1:47 pm

I generally keep changing things. Desktop place, Window manager , applications…

So this time i have tried out thunderbird as a replacement for evolution

It looks pretty in some feature but not in every aspects.

The features i like

  1. Each account is maintained separately, the mails which are not falling through any filter sits in inbox of that account. But in case of evolution it is different. There will a common inbox there all unfiltered messages will go which i dont like to organize them manually.
  2. The second damn thing i like is themes. Evolution cant support this feature. Look at my vista look at linux 😉 thunderbird-vista
    Just for a change. I can show up to my windows friends. 😉 The firefox users feel more comfortable with this theming feature it is as same as firefox
  3. The third feature i like is add-ons. There are lot as usual . The add-ons i am using is
    • Talk back — http://talkback.mozilla.org/
    • Splash screen — Just show splash screen fully customizable even the image , text , color, font(http://splash.mozdev.org/)
    • Signature switch – If you have multiple signature you can add them. (http://mozext.achimonline.de/)
    • Provider for google calender atthunderbird (http://mozilla.kewis.ch/) It works really. 🙂 I think there is small bug it always set thing one hour late. Yes it uses the xml address (ORANGE one). But in evolution it uses the ICL address (GREEN one). But after adding up the address in evolution it gives read only calender. Not sure it is bug or some configuration. I have clearly checked it.
    • Gmail UI — to provide gmail effect like archiving and searching. I think it works with small bugs. Not using much. I always want my mails to be classified. Not interested to put everything in a single archive folder.
    • Contact side bar – this is another good addon. I liked it. Shows the address book in the left pane. Quick add when a new mail is sent.
    • Filters i like it. Filters are associated with the account and they are not global like evolution. In evolution many times i had this problem of missing of mails. It just goes to some other folder due to the misconfiguration of filters.
  4. The other feature i like is lightening . Yes a calender program. Ofcourse u can configure with sunbird as a separately application. But who wants to maintain one more application. So lightening comes handy , it is a add-on on thunderbird. It works well i guess. I have not faced any problem. I have configured google calender and worked with it.
  5. Display mails as thread. It shows a tree view with a vertical dot view. That looks nice. Eyes just need to follow the link when the thread is too big. But in evolution there is nothing provided. Only arrow button to show it has child mails and indentation is maintained which i felt little difficult.

As of now i have not configured IMAP on both the mail client. So let it be with my groupwise.

The feature which i dont like or which i feel missing in thunderbird comparing to evolution

  1. Task maintenance is missing out in thundebird which evolution provides perfectly.
  2. Online LDAP servers can be used. ( i think it is available in thunderbird also)
  3. Integration with gaim accounts and system calender. I have just said in evolution sync with gaim. It is done simply. The task i can and appointments i can see in my gnome calender. It is just cool. Thunderbird has to add these feature
  4. Evolution can export the address book vcard format or as csv (evolution-addressbook-export –format=csv >contact_list.cvs
    ). There should be ldif format supported. But i felt difficult converting them to thunderbird. Thunderbird was showing some field matching for exported CVS formated address book that mostly goes bad. Somhow from google i exported the CVS file and that mostly worked except for few contacts
  5. When i send a mail evolution does it silently. It first keep it in outbox and send it in the background. But thunderbird keep running in front. There will be progress bar running and showing connected to this outgoing server and sending. Which need to be done at the back. (Does any setting available for that, i guess i have not missed it out)
  6. It will have more support on groupwise accounts probably (I have never tried it but seen ppl using it like johnny) because groupwise and evolution is supported by Novell and i am an employee of Novell 🙂
  7. Finally evolution looks native. 🙂 may be used to be it.

Lets see. For now i am using thunderbird. Heared some new features are coming out in the lattest build (labeling like gmail, layout changing which already in thunderbird. I like the task management and contact detail syncing feature from evolution. I will switch back to evolution after some time when i feel i need a change or when some attractive feature available which ever comes first

May 21, 2007

Browsing net at emacs with w3m

Filed under: emacs, Linux, open-source, web — skalyanasundaram @ 3:38 am

I thought should try out w3m support at emacs. Ok it looks good but not up to the expectation.

See the search result of tajmahal. Ofcourse it looks better but it does not support the CSS which is almost used by all the web site nowadays. Javascript support is not available. I think there are some alpha packages which tries these things.

emacs-tajmahal-w3m

My wordpress blog. The columns which are in right hand side gone down. 😦

emacs-myblog-w3m

After using firefox and with its great addons support no one will think of using emacs for browsing.

April 9, 2007

failover support for dhcp

Filed under: dhcp, Linux, open-source — skalyanasundaram @ 5:48 pm

Was feeling bored little and wrote off the failover support piece for the dhcp. That is available in here . I have not done much of testing. Since it reads the configuration  and convert back to the expected conf file format i think i dont need to test the whole failover . But still i will test all the failover possibilities atleast once. But not now. Still the perl script is bending, will do it in some other day.

Older Posts »

Blog at WordPress.com.