On 02/10/2010 07:05 AM, Dave Milter wrote:
> On Sat, Jan 16, 2010 at 6:22 AM, Eric M. Ludlam<eric@...> wrote:
>> As for the specifics, if you use:
>> C-h v ede-project RET
>> You will see a bunch of abstract (sort of) methods called "project-*",
>> including a project-compile-project. For:
>> C-h v ede-target RET
>> you will see project-compile-target (and debug).
>> If ede-cpp-root (or a subclass) were to implement these, they would be
>> hooked into the menu item, and run that code.
> Thanks, for answer.
> So I wrote:
> (defclass my-ede-cpp-root-project (ede-cpp-root-project eieio-instance-tracker)
> (custom_build_cmd :initarg :custom_build_cmd
> :initform ""
> :type string
> :custom string
> :documentation "Set this field to shell command
> for build your project")
> "My class for ede projects"
> :method-invocation-order :depth-first
> (defmethod project-compile-project ((obj my-ede-cpp-root-project)
> &optional command)
> ;; (message "compile %s cmd %s" (object-name obj) (oref obj
> (compile (oref obj custom_build_cmd))
> and thats works as expected,
> now I want to add "debug" ability.
> As I see from source code, and your email I need redefine project-debug-target.
> (defclass my-ede-target (ede-target)
> "My class for ede targets"
> (defmethod project-debug-target ((obj my-ede-target))
> (message "Implement me")
> But, how can I tell ede that from targets of my-ede-cpp-root-project project
> it should create objects of my-ede-target?
> I mean how I connect my-ede-target and my-ede-cpp-root-project?
There is already a ede-cpp-root-target class, so you can create a method
for that, since there is no default. The funny thing about
ede-cpp-root, is it just tries to put a thin wrapper over what is more
likely a complex bit of code, so the 'target' is just a bit of a guess,
but it will give you the hook needed to do what you want.