From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.help Subject: Re: How to use project.el Date: Sun, 22 Nov 2020 04:55:47 +0200 Message-ID: <05e31c25-71c8-0973-41a3-0e705370c839@yandex.ru> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34205"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: Help Gnu Emacs To: excalamus@tutanota.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 22 04:00:59 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kgfcY-0004Ho-Mp for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Nov 2020 04:00:58 +0100 Original-Received: from localhost ([::1]:50776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgfYH-0001MM-9V for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 21 Nov 2020 21:56:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgfXv-0001M7-R5 for help-gnu-emacs@gnu.org; Sat, 21 Nov 2020 21:56:11 -0500 Original-Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]:35665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgfXh-0001k9-3S for help-gnu-emacs@gnu.org; Sat, 21 Nov 2020 21:56:11 -0500 Original-Received: by mail-ej1-x62e.google.com with SMTP id f23so18464328ejk.2 for ; Sat, 21 Nov 2020 18:55:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=lP0rV/T937hOsfbw2vs9TvWBvvIo2AA3RfOYTKkO9Gw=; b=H/Z0+X7OczaEYD/5qee3iLPtKuRFZIpicql1c5xwBQSyrw8Mw9N8AAq9whfivRVzUA AKkvD7WnZuJyB0+i0H2UDH7Eu25eGqCfHj7O5EcGtpEXymWDwnApa/MYveW+zYZKkWfR GlgvEEzNZDdTkzZPkCjImYY3YHwGfl6bFPUs6zIDik2hOKjMQukq9G4lFmWZ/YnqIYlK gNCSjRF50oGnynd206zNqPQ0VlKcnfNFaCJjapyfw0ey1lqKfQ529KY6zfAklCRSigZd J3SErlLImEFpLqDFzxlX8/vGgmegEM8dAuCB76xCuFA5uk+yAQraZnpzmY5kcz777hvw p+Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=lP0rV/T937hOsfbw2vs9TvWBvvIo2AA3RfOYTKkO9Gw=; b=GgcJenMLOBEND47ouZIBcXm+lkHcYbvMBacc//EdNhw7kMhbLarSfQmAMaIJgMbNxo 05/r+yyFubGJ/lqQSlkxbirKYfnfTgztpOqV/UctlHYWiFkvNDt6xYLkoM0U5e9kKsMq BvHBXseHAfyemQx6Rz8fG5GyH9aZrKjKThu+cEqVLESqaQU86BsRfq+MPeDsJU1aBv8R iybqsHvWtWtKKsYjU9UQB/Qm4iFICrHfTf1wwzwMrpyueEi2Mx13eDb3lvLzJzqvphFO 54FPEuXud1ULa37yHgHetZbagTEZdMnjYbjyxMttThAb9isHZ6E13hzwytO65VUFrNry +z2A== X-Gm-Message-State: AOAM530373cQuHI2AM0aKl0AJ565aWzK6oI+ZSzbTc2syP0BTnuV8Qk6 HV9vMHs/nFdvQFbHXR2p4suOWiqsirsXoQ== X-Google-Smtp-Source: ABdhPJwK7sj8UKyBGuUehWLXbuv1YTxOQCSoRqlZDyCmBecY14GnyHeRTe3H9csH9o4SBnphmh9Imw== X-Received: by 2002:a17:906:60d4:: with SMTP id f20mr40728367ejk.156.1606013749390; Sat, 21 Nov 2020 18:55:49 -0800 (PST) Original-Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id g20sm3132819ejk.3.2020.11.21.18.55.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 21 Nov 2020 18:55:48 -0800 (PST) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=raaahh@gmail.com; helo=mail-ej1-x62e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125465 Archived-At: 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.