From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: NonGNU ELPA package submission: EPIO Date: Fri, 01 Apr 2022 17:10:26 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6326"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Daniel Hutzley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 01 23:11:27 2022 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 1naOYJ-0001TL-68 for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Apr 2022 23:11:27 +0200 Original-Received: from localhost ([::1]:56542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1naOYH-0000dx-Uo for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Apr 2022 17:11:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naOXT-0008NZ-Gq for emacs-devel@gnu.org; Fri, 01 Apr 2022 17:10:35 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:61626) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naOXQ-0001Ht-3V for emacs-devel@gnu.org; Fri, 01 Apr 2022 17:10:34 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 90E6B4427FA; Fri, 1 Apr 2022 17:10:30 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 37FAD4427F5; Fri, 1 Apr 2022 17:10:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1648847428; bh=a7Wdt+sgw2p9LDZk7xhoqJ7h95gjwjt4+5G7nJDF3cg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=cA3rnZDDIzHzQkyut8JjB8YEDlaOV+ojg6HtS+jW0NxLifOKsbjqRUdPxqfGDZexw fvCfisEgi5Otst6XkSdu/hBUpA/zW+03vqvD4qIM4Or7nj1vb36ElhVIkEma9U+Ptr LFxpzENyqKVYJyjQWatljxW1zV8ADAy/7T2RLtElnH+zvKFFV9oK7HHWgTVxOXVOEI Tbnyw42+sqi3LpkmQop2ijcjbeLqKBtMtK/U5lA4+bfC3ZsXmuvJ68llI+rmktpHMG 764VH8tMLrsKYox+57VJtT7U4nn5K5iAOPVwnWQ1etFloi42fvzx0rbU7bcE2mwjb2 mH30YpxJhzTAw== Original-Received: from ceviche (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id F3B3A1204D4; Fri, 1 Apr 2022 17:10:27 -0400 (EDT) In-Reply-To: (Daniel Hutzley's message of "Fri, 1 Apr 2022 11:59:05 -0700") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:287686 Archived-At: Daniel Hutzley [2022-04-01 11:59:05] wrote: > I apologise for the vagueness of the README, I'll update it when I > have the chance (I forgot to include the license footer anyway, so > that'll be updated). While it is similar interface-wise to the > PlatformIO-Mode they link on their page (again, I'll update the README > with links when I get the chance), the internals are almost completely > different (this plugin has no dependencies outside of EMACS, is > documented in TexInfo, etc.). As for what PlatformIO is, it is a free > (their writings do suggest an ideological rationale here) system for > developing on embedded platforms such as Arduino (distinctly not > web-based). Their CLI tool (Apache-2.0 license) is used, which does > not depend on a server (after a bit of additional research, opt-out > telemetry does exist, though it is documented, minimal, togglable, and > auditable in the source code. I'll include this in the edit) outside > of those commands which would not function without (namedly, the > commands for the features listed on > https://docs.platformio.org/en/latest/plus/pio-account.html and the > system for managing libraries for interacting with different boards). > I will update the documentation to cover all of this, along with a > setting which disables telemetry using an environment variable and > licensing info. Are there any other changes that are blocking here? I see you distribute this code under the MPL-2.0. I'm not very familiar with that license but a brief web search suggests this is not compatible with the GPL, which makes it arguably "illegal" to distribute your code (since it can't be used without linking it with GPL code). Any chance you could change it to GPLv3+? Also see below the patch resulting from my "destructive" reading habits. I think integration with `project` would be the most important feature. Stefan diff --git a/epio.el b/epio.el index 60b56400cb..dbf7156819 100644 --- a/epio.el +++ b/epio.el @@ -1,4 +1,4 @@ -;;; epio.el --- PlatformIO support for EMACS +;;; epio.el --- PlatformIO support for EMACS -*- lexical-binding: t; -*- =20 ;; Copyright (C) 2022 Danielle Hutzley =20 @@ -16,9 +16,11 @@ =20 ;;; Commentary: =20 -;; This is a minor mode designed to make working with PlatformIO projects = easier. -;; It is loosely based off of ZachMassia/PlatformIO-Mode, but uses standar= d EMACS -;; functionality to avoid dependencies. +;; This is a minor mode designed to make working with PlatformIO projects +;; easier. It is loosely based off of ZachMassia/PlatformIO-Mode, but uses +;; standard Emacs functionality to avoid dependencies. + +;; TODO: Integration with `project'? =20 ;;; Code: (require 'compile) @@ -31,12 +33,10 @@ =20 (defcustom epio-mode-prefix (kbd "C-c i") "EPIO keymap prefix." - :group 'epio :type 'key-sequence) =20 (defcustom epio-pio-path "pio" "The path of the PlatformIO command-line tool." - :group 'epio :type 'string) =20 ;;; Compilation mode @@ -51,7 +51,7 @@ =20 (define-compilation-mode epio-compilation-mode "EPIO" "EPIO compilation mode." - (add-hook 'compilation-filter-hook 'epio-compilation-filter nil t)) + (add-hook 'compilation-filter-hook #'epio-compilation-filter nil t)) =20 ;;; Auto-enable =20 @@ -65,12 +65,15 @@ (defun epio--platformio-command (project &rest arguments) "Run PlatformIO in the given PROJECT with the given ARGUMENTS." (let* ((default-directory (epio--get-pio-project project)) + ;; FIXME: seq-reduce + concat is O(N=B2), better use `mapconcat'. + ;; FIXME: What about spaces or other special chars in `arguments'? + ;; You should likely pass those through `shell-quote-argument'. (arguments-with-spaces (seq-reduce (lambda (acc elt) (concat acc = " " elt)) arguments "")) (command (concat "pio -c EPIO" arguments-with-spaces))) (when (null default-directory) (user-error "Not in PlatformIO project!")) (save-some-buffers (current-buffer)) - (compilation-start command 'epio-compilation-mode))) + (compilation-start command #'epio-compilation-mode))) =20 (defmacro epio--defcommand (name docstring arguments) "Helper to create an EPIO command NAME using the given ARGUMENTS and DOC= STRING." @@ -106,11 +109,10 @@ ("i" epio-init+update-workspace))) map) "EPIO keymap after `epio-mode-prefix'.") -(fset 'epio-command-map epio-command-map) =20 (defvar epio-mode-map (let ((map (make-sparse-keymap))) - (define-key map epio-mode-prefix 'epio-command-map) + (define-key map epio-mode-prefix epio-command-map) map) "Keymap for EPIO mode.") =20 @@ -120,10 +122,8 @@ ;;;###autoload (define-minor-mode epio-mode "PlatformIO support for EMACS." - :lighter " EPIO" - :keymap epio-mode-map :group 'epio - :require 'epio) + :lighter " EPIO") =20 (provide 'epio) ;;; epio.el ends here