From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Project.el - running processes in root Date: Thu, 04 Jun 2020 21:53:33 +0000 Message-ID: <87img65wh2.fsf@thornhill.no> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="102195"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 04 23:59:58 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jgxu2-000QSP-59 for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Jun 2020 23:59:58 +0200 Original-Received: from localhost ([::1]:53626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgxu1-0005nO-6K for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Jun 2020 17:59:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgxo1-0000g9-Iu for emacs-devel@gnu.org; Thu, 04 Jun 2020 17:53:45 -0400 Original-Received: from mail1.protonmail.ch ([185.70.40.18]:37870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgxny-0000Kc-4u for emacs-devel@gnu.org; Thu, 04 Jun 2020 17:53:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=protonmail; t=1591307617; bh=UQSrWIb13juTVE4OwA8e6UHc2DgyY+CbwmUAX7Ynupw=; h=Date:To:From:Reply-To:Subject:From; b=aoiDGa/OyIZD/Go8uczA6LA+lwEtzUr7cyXZA0Mmn4u0sbgISefruJHYWZjlq4Q3W jLXWu6P+V/dY4kXuYaECpTAikn06imig5HRnQxo15mMetLkzB5Xd/Q9062pFFLCnjj lfAmdD/DEeCF3j4MtSeqj0itQ+wIQPdpM41494XPmq8XjtO/Ct6FX5FUcPiSQ/USpk gCQrjGSbW2BufFow19AShgnTSji/RpNIhVqpgFhiWGTOzNSL0iXTWqoZQj7vLXNayS MqCKe798UKdx6StjEC6P8hfZguAKBIiDGxkhelHTnN26y2NFYvnkb9b05W4GDfFccC HtYdEUO4cQePQ== Received-SPF: pass client-ip=185.70.40.18; envelope-from=theo@thornhill.no; helo=mail1.protonmail.ch X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/04 17:53:38 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Mailman-Approved-At: Thu, 04 Jun 2020 17:57:59 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251867 Archived-At: Hello! What is the best way to run a subprocess in root of a project currently? Right now I've made a small convenience macro for this: (defmacro with-project-root (&rest body) "Dynamically bind default directory to project root." (declare (debug t) (indent 0)) `(let ((default-directory (project-root (project-current)))) ,@body)) Then I can: (defun elm-repl () "Create a new buffer with Elm repl started and switch to it." (interactive) (with-project-root (switch-to-buffer-other-window (make-comint "Elm Repl" "elm" nil "repl")))) This seems like a nice solution, but if there already exists something like this, please tell. Otherwise, would this be something appropriate for project.el to expose? Have a nice day, Theo