unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: excalamus@tutanota.com
Cc: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: Re: How to use project.el
Date: Sun, 22 Nov 2020 04:55:47 +0200	[thread overview]
Message-ID: <05e31c25-71c8-0973-41a3-0e705370c839@yandex.ru> (raw)
In-Reply-To: <MMcJtNV--3-2@tutanota.com>

On 21.11.2020 03:03, excalamus@tutanota.com wrote:
> 
> 
>> To get the most benefit from the package, you should install the latest version from GNU ELPA ('M-x list-packages', then install 'project'). The latest version is 0.5.2.
>>
>> To see the full list of commands defined in that package, type 'C-x p C-h'.
>>
>> You can also read the full description of the package with 'C-h P project RET'.
>>
> Thank you, I was unfamiliar with 'C-h P'.
> 
> I have updated to 0.5.2 and it's more like what I would have expected.  Actually, several functions mirror my own project management code.  My use-case is, of course, specific to me, but I see overlap.  I wonder if any of my code, or its ideas, may be useful?  Who is project.el's point person?

That would be me.

>   I develop Python and prefer to interact through shell directly by sending commands to the comint buffer.   At this point the main command is 'xc/sh-send-command'.  This sends something like 'python main.py' or 'pyinstaller main.spec' to the appropriate shell and steps.  I create a shell, either by name or on the fly, similar to 'project-shell' with 'xc/create-shell'.  Everything else is just a helper.
> 
> It's all hacky stuff I've made in the moment over time.  This weekend, I hoped to create project profiles, a plist or something, with :root, :venv, :entry-point-file, etc., so that I can switch between shells and associated command sets easily, maybe also formalize it (hence my looking into project.el first).
> 
> Thoughts?

In general, I like things to happen automatically for the user. For 
instance, if you are working on a Python project, shouldn't there be 
some file in the project root directory which will indicate which 
virtualenv to use?

Then your workflow could be something like call (project-root 
(project-current)), then read that file, then set the venv for the 
current buffer to the appropriate value.

And :root, is that project root? The idea in project.el is that you can 
write a function which will determine it, again, programmatically, 
based, say, on the current directory (usually by traversal up the tree 
and looking for some directory markers).

Of course, you can whip up a project backend which will plug into 
project-find-functions, but allow you, as the user, to set up everything 
manually, with manual switching between "profiles", etc. I'm just not 
sure why you would prefer that.

As for switching, there is the project-switch-project command.



  reply	other threads:[~2020-11-22  2:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 14:52 How to use project.el excalamus--- via Users list for the GNU Emacs text editor
2020-11-20 19:34 ` Jean Louis
2020-11-20 23:34 ` Dmitry Gutov
2020-11-21  1:03   ` excalamus--- via Users list for the GNU Emacs text editor
2020-11-22  2:55     ` Dmitry Gutov [this message]
2020-11-23 16:22       ` excalamus--- via Users list for the GNU Emacs text editor
2020-11-23 22:19         ` Dmitry Gutov
2020-11-24  3:54           ` excalamus--- via Users list for the GNU Emacs text editor
2020-11-25  1:54             ` Dmitry Gutov
2020-11-25  2:55               ` excalamus--- via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05e31c25-71c8-0973-41a3-0e705370c839@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=excalamus@tutanota.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).