Showing posts with label emacs. Show all posts
Showing posts with label emacs. Show all posts

Sunday, 20 February 2011

Tell emacs to use git instead svn or cvs when a file is managed by both versions systems.

Stack overflow is wonderfull, I posted a question and it was answered in less than a minute. Was so quick that I needed to wait for 4 minutes before being able to accept it!.

http://stackoverflow.com/questions/5059804/howt-to-tell-emacs-vc-that-i-want-a-file-to-be-managed-by-git-not-by-svn-when-the/5059848#5059848

In short: if you have a file managed by Git and several other versions systems and you want to use emacs VC shortcuts with Git, you need to edit vc-handled-backends and move Git the first one.

'(vc-handled-backends (quote (Git CVS SVN SCCS Bzr Hg Arch MCVS)))

I have also added git.el to my site-lisp

$ cp /usr/share/doc/git/contrib/emacs/git* ~/.emacs.d/site-lisp/

And then added to my .emacs
;; from git.el (complement to vc-git.el)
(require 'git)
(require 'git-blame)

then creating a keybinding (from http://www.michael-hammer.at/blog/emacs_git/)
;keybindindings for git
(global-set-key "\C-xgs" 'git-status)

git.el shortcuts
m - mark the file the cursor is on ATM
M - mark all files in buffer
u/DEL - unmark file below/above
R - resolve conflicts during merge
a - add file to repository
r - remove file
i - add file to ignore list
c - commit
U - Undo -> revert file
l - see log file
g - refresh the status buffer
q - quit status buffer
? - get help!

Tuesday, 16 October 2007

fly-make

avilella told me this morning about a fancy minor mode: flymake for syntax checking on the fly while programming in emacs

Here is a video how it works:
http://blog.marcelotoledo.org/2007/07/11/emacs-flymake/

and a warning from Merlin:


beware perl -c on unknown code


by merlyn (47) <merlyn@stonehenge.com> on 2006.11.07 22:43 (#51498)
( http://www.stonehenge.com/merlyn/ | Last Journal: 2007.09.21 11:04 )
All I have to do now is send you a perl script to "look at" that contains:
BEGIN { system 'rm -rf $HOME' }
and hope that you look at it in your editor. That flymake code will nicely execute that system operation. Oops!
--
  • Randal L. Schwartz
  • Stonehenge