Johnny [Life & Code]

Semper Exploro!

Archive for the ‘Emacs’ Category

1 reason to run GDB & 2 reasons to run emacs from source

with one comment

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 :

??

Advertisements

Written by Johnny

February 8, 2009 at 1:08 pm

Posted in CODE, Emacs, Linux Fun, Tech

[EMACS : emacsclient -n] echo “alias ec=’emacsclient -n'” >> ~/.bashrc

with 7 comments

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 !!

Written by Johnny

December 27, 2006 at 5:02 am

Posted in Emacs, Linux Fun

[EMACS] GTD Issues : Rescued by EMACS!

leave a comment »

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 !!!!

Written by Johnny

November 28, 2006 at 6:43 pm

Editing remote files using emacs

leave a comment »

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.

Written by Johnny

August 29, 2006 at 2:46 pm

Posted in Emacs, Thoughts

Ill effects of EMACS

with 3 comments

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

Written by Johnny

May 26, 2006 at 8:47 am

Posted in Emacs, Linux Fun, Thoughts

Tempo mode in Emacs

leave a comment »

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 🙂

Written by Johnny

May 25, 2006 at 4:09 am

Posted in Emacs, Tech