emacs-devel
[Top][All Lists]
Advanced

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

Re: Opaque objects and Emacs documentation


From: John Yates
Subject: Re: Opaque objects and Emacs documentation
Date: Tue, 21 Jul 2020 16:29:54 -0400

Wrote this up but not sure where in the thread to inject it.

Here is my understanding of Dmitry's design:

A backend's hook function, when presented a context (is this
always a directory?), is expected to answer the implicit
question "Do you recognize this as a form of project for which
you are prepared to take responsibility?".  The function returns
nil if no, non-nil if yes.  Returning non-nil effectively asserts
that the presented context is an instance of the form of projects
handled by that backend.  The value returned ia a backend private
identification of that project instance (i.e. an intance handle).

"Takig responsibility" entails being prepared to support a -
potentially growing over time - set of project methods.  The
non-nil object returned by a backend hook function will be
presented at the invocation of a project method.  This allows a
backend to know the specific project instance upon which it is
being asked to operate.

The project.el dispatcher never interprets an instance handle.
It merely holds onto it and then presents it to a backend as part
of a method invocation.  The handle only needs to capture (in a
backend private fashion) enough context to allow carrying out the
various methods.

As an engineering concern the backend should be able to execute
the expected methods in an acceptably responsive manner.  For a
traditional directory tree-based project identified by some VCS
feature on a local file system a mere pointer to the project's
root directory may be sufficient.  Other forms of project (say
a more complex topology than a single directory tree, complex
permissions issues, remote connections, etc) may prompt a backend
to capture more information in its project instance handles.
But that is an entirely backend private design decision.

On Tue, Jul 21, 2020 at 3:09 PM Dmitry Gutov <dgutov@yandex.ru> wrote:
On 19.07.2020 17:48, Eli Zaretskii wrote:
> Because having user commands
> that allude to "project instance" without even a minimal explanation
> of what that is makes our documentation of such commands almost
> useless, and the question that bothers me is how to keep the quality
> of our documentation at its usual high level while using these or
> similar design and implementation patterns.

I started replying to say that you are welcome to propose improvements
for better description of allowed semantics, but then again, you
probably meant something like more details about which cons cell
contains which values.

In the meantime, I have added more text to Commentary in project.el.
Please take a look whenever convenient.



--
John Yates
505 Tremont St, #803
Boston, MA 02116

reply via email to

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