Archive for the ‘Emacs’ Category
1 reason to run GDB & 2 reasons to run emacs from source
CODE :
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 ..
EMACS : emacs 23 (in cvs) gives you MultiTTY Support , XFT Font rendering (and more). Looks better with XFT and multitty support rocks !
LIFE :
??
[EMACS : emacsclient -n] echo “alias ec=’emacsclient -n’” >> ~/.bashrc
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)
m-x shell
blah@foo:~> ec test.test
emacs is kewl !!
[EMACS] GTD Issues : Rescued by EMACS!
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 !!!!
Editing remote files using 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.
- To use : http://textsnippets.com/posts/show/366
- If u are using Suse Linux Enterprise Desktop 10 you may need : texinfo rpm
- TRAMP Project page : http://savannah.gnu.org/projects/tramp/
Ill effects of EMACS
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
Tempo mode in Emacs
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
(require 'tempo)
;;; (setq tempo-interactive t)
(add-hook 'c-mode-hook
'(lambda ()
(local-set-key [f11] 'tempo-complete-tag)
(tempo-use-tag-list 'c-tempo-tags)
))
;;; Templates appended to c-tempo-tags
(tempo-define-template "c-debug-pf"
'("printf(\"%s(%d):%s:" r "\\n\", __FILE__, __LINE__, __PRETTY_FUNCTION__);">)
"include"
"Insert a printf statement with info on location"
'c-tempo-tags)
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
BTW,
__FILE__ , __LINE__ and __PRETTY_FUNCTION__ are GCC magic identifiers







