[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Project idea: a poor man's VC backend

From: Doug Lewan
Subject: RE: Project idea: a poor man's VC backend
Date: Thu, 15 Jan 2015 13:10:23 +0000

> -----Original Message-----
> From: help-gnu-emacs-bounces+dougl
> To:
> Subject: Re: Project idea: a poor man's VC backend
> Thanks for this suggestion; it is a very good one.  However, what
> I *really* would like to do is learning how Emacs' VC works.

Excellent! That is a major part of the GNU philosophy.
Emphasize it!
I once had the task of designing a debugger and GDB was
the only thing around to learn from.

> Now I have another problem.  I decided to start reading the code for
> VC,
> and after seeing the lisp/vc directory with its 41 files, felt a bit
> overwhelmed.  Any suggestions on where to start reading to actually
> understand anything?

First, look at the names of all those files and understand
which ones you shouldn't care about at the beginning.
(All those ediff files, for example, probably don't offer the big picture.)

Next I'd recommend that you look inside vc.el.
The commentary in the top matter alone gives good hints
about the history and design.
A significant part of this is to understand
that VC never calls a function for a specific version control system directly.
Instead, it figures out what the VC system is and then
picks the right set of functions and variables to use and then
assign them to a common set of variables.
(This is a common lisp technique and well worth learning
if you don't already know it.)

To delve into the code proper I might look 
at the help for C-x C-v C-v (M-x vc-next-action).
It's a vague concept, essentially "do the right thing".
Figure out how it decides what the next action should be.
Then study that action to see what variables (see above) it uses.
Those are your hooks into adding to the mode.

I hope this helps.

Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 224 or ext 4335

"This is a slow pup," he said continuing his ascent.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]