Georg Bauhaus <[email protected]> writes:

On 29 Dec 2013, at 22:47, [email protected] wrote:

I don't have a good use case for
editing without a project file; anyone else?

It may not be immediately obvious to a mode user what "project file”
means: .gpr, .apr, .prj, Makefile?

Yes; these do all have more specific names:

.gpr -> GNAT project file

.apr -> ?
    perhaps you meant .adp, which is one of the default extensions for
    an Emacs Ada mode project file

.prj -> Emacs Ada mode project file

As a list of use cases,

- if using another compiler besides GNAT,

Definitely requires either a project file or ~/.emacs customization of
Emacs Ada mode defaults (or file variable customization, as you point
out below).

- if running emacsclient as the editor of choice,

I'm not clear why that matters - I don't use emacsclient.

- if editing a multiple-unit source text in one file; e.g. test cases,
  trying Ada features in a "temporary" unit,

If doing this with GNAT, you need a way to invoke gnatchop first; a
Makefile would be my choice.

then I think that doing nothing mode specific (like handling project
setup) should still allow editing Ada source text without restrictions
(see below for a potential solution).

"editing without restrictions" is not clear to me.

You can _always_ open an Ada file, change the contents, and save them.

The requirement for a project file or other customization arises when
you want specific case exceptions, or non-default compilation or
cross-reference commands.

For example, using the more traditional tool of file variables could
be expected to be sufficient, certainly less overwhelming than
anything that appears bureaucratic, and outside "normal" Emacs
conventions.

The Emacs Ada mode project variables all have elisp defaults, so this is
possible.

For the OP use case of case exceptions, you can set
ada-case-exception-file in a file variable, and that will be used to
create the default project.

I will add another tutorial example that illustrates using file
variables instead of a project file.

This is useful even with project files; it allows overriding project
settings for one file. I use it in Ada files that declare OpenToken
grammars.

Some newbies might find it
overwhelming, so we'd have to make that mode optional.

Would it not be easier to have Emacs just ask whether it should create
a suitable project file if the algorithm does not find one to select?

That's what the default project file is for. Note that this is a purely
internal structure, it is not written to disk.

If Ada mode works better when it knows a project, then, since IDEs can
usually create project files, let powerful Emacs help itself!  8-)

I'd rather not pollute the disk unless specifically requested.

Although it might make sense to provide a function that writes out the
current project settings to a file that the user specifies. That would
ease the transition from file variables to project file.

But, is this a real use case? How many people actually do real editing
without any project file?

--
-- Stephe


_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to