Archive for the ‘Emacs’ Category
GDB : Compiling from Project Archer, you get to have python scripting inside gdb. This opens up numerous possibilities and nice tricks that helps you to debug faster. http://tromey.com/blog/?cat=17 has few example + demo scripts. Falling in love with these ..
I use emacs shell extensively. so when i grep for some thing and i need to open the file, i have to visit the file (c-x c-f) eventhough imy emacs shell is in the current directory. so
echo “alias ec=’emacsclient -n'” >> ~/.bashrc
m-x server-start (you can add this to ur .emacs)
blah@foo:~> ec test.test
emacs is kewl !!
Have you ever wondered that you have sincerely worked on tasks all day and at the end you find that therez still lot to do .. And do you use EMACS most of the time writing code, patching bugz, making good software, making software good ..
Well .. yes .. thatz me (a little!!).. The first thing I do when i switch on my laptop is … start EMACS!! . I daily use EMACS to write code in c and c# .. yes i write C# in Emacs.
Well Anyway, the coolest thing (among lot other coolstuff ) is the ‘timeclock-in’ and ‘timeclock-out’ functions.
you can timeclock-in to a project and timeclock-out.. at the end of the day you could use timeclock-generate-report.
Found a simple page detailing this : http://www.delorie.com/gnu/docs/emacs/emacs_437.html
If you are more serious about using EMACS as your planner , then planner.el is the right thing .. I’m not joking here … have a look at joe’s site : joesteeve.org . Everything you see there is by EMACS !!!!
I write code in my laptop and sometimes i have to do the same on my test machines. I dont want to look into my laptop and try to do the same on other machines (well .. not copying files.. . … ). As usual Emacs has something ..
TRAMP- `Transparent Remote (file) Access, Multiple Protocol’. With it i can edit remote files very easily.
Every Emacs user has to admit this… Using emacs has a lot of disadvantages..
1. Suddenly your standard keyboard looks too big with unwanted keys… Especially the "Insert, home … page down", arrow keys , Num pad … Sometimes i feel like cutting the right side off my keyboard
2. Navigating in other word-processors like 'open office' becomes a tedious task…. to do something you have to use your mouse (sometimes)…
3. Its very addictive… Sometimes when u are discovering a new feature… it can distract you away from work.
Well if you have experienced anything like this … feel free to add it in the comments
When debugging or learning code i use a lot of printf statements to understand the execution path and things like that. I know there are better ways to learn the code …. But I like these printfs… So in emacs this is how i do it using the tempo mode. koool
(defvar c-tempo-tags nil
"Tempo tags for C mode")
;;; C-Mode Templates
;;; (setq tempo-interactive t)
(local-set-key [f11] 'tempo-complete-tag)
;;; Templates appended to c-tempo-tags
'("printf(\"%s(%d):%s:" r "\\n\", __FILE__, __LINE__, __PRETTY_FUNCTION__);">)
"Insert a printf statement with info on location"
Add this line (i'm sure there ia better way to add this .. but for now ….)
(global-set-key "\C-x\C-q" 'tempo-template-c-debug-pf)
So from now on inside any buffer if you press C-x C-q… it'll insert the line
printf("%s(%d):%s:\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
You can add any number of templates
__FILE__ , __LINE__ and __PRETTY_FUNCTION__ are GCC magic identifiers 🙂