From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Niklas Eklund Newsgroups: gmane.emacs.devel Subject: Re: Add zuul.el package to ELPA Date: Tue, 30 Aug 2022 16:59:13 +0000 Message-ID: <87czchzmzi.fsf@posteo.net> References: <874jxuj3q1.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29011"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 30 20:08:06 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 1oT5eg-0007NP-1c for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Aug 2022 20:08:06 +0200 Original-Received: from localhost ([::1]:52874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT5ee-0007e4-Kd for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Aug 2022 14:08:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4a8-0003lL-RD for emacs-devel@gnu.org; Tue, 30 Aug 2022 12:59:20 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:60053) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4a5-0000vN-9B for emacs-devel@gnu.org; Tue, 30 Aug 2022 12:59:20 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 7E1AC240028 for ; Tue, 30 Aug 2022 18:59:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1661878755; bh=Qvh6tryBz/2R4u5Oiz41zqNkcYTt6adFSO0ZEuT444M=; h=From:To:Cc:Subject:Date:From; b=MeLaRW49iOfocQNUUDLxaXoQEgequZbbmvqaq97qbxpg3bMI5dUpiSiFLLISru5Jz 9gB1hfvhNe2xNq8eqW/A2H2rO5zBLNoubomWOd2STKxKiri6zW1EgCOOsW7l9scMjC S2ONjfLI902FeeFtOoh/GREwOdyau9v8ZDbWZwtOU1oWTJFHguLmXkVfiS93zTUznW ExePXs7spFkOvL5rp3zxELnC+8J4zky0ufcZa9QrIYNrjJNicZFycoUDd5JUignIgQ szLSblrYtWYDNLIDHtGsBXKFg/blFSm0+w+heBWlxTbyCJYhAtYewrI1cbD+fGsQUT 7XfvS+9YgpVHg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MHD6p4F9hz9rxK; Tue, 30 Aug 2022 18:59:14 +0200 (CEST) In-Reply-To: Received-SPF: pass client-ip=185.67.36.65; envelope-from=niklas.eklund@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_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-Mailman-Approved-At: Tue, 30 Aug 2022 13:33:08 -0400 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:294376 Archived-At: Stefan Monnier writes: > Niklas Eklund [2022-08-29 18:37:26] wrote: > >> Hello, >> >> I would like to add a package that I have developed named zuul.el, >> https://git.sr.ht/~niklaseklund/zuul.el, to ELPA. > > I can do that, but it requires you change the copyright line to state it > is owned by the FSF, as usual. The patch below does that (and a few > more things which you probably want to double-check). Absolutely, I will apply that :) > I notice that the doc says that it doesn't provide any commands other > than those used from `zuul-log-mode`, then I wonder why these are > autoloaded, since presumably by the time you can use them > `zuul-log-mode` is active and hence the package has been loaded. Thanks for the patch and feedback, the autoloaded commands could indeed be removed. > > Stefan /Niklas > diff --git a/.gitignore b/.gitignore > index 1d8f1fc7f6..2e852834d1 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -1,2 +1,3 @@ > /zuul-autoloads.el > +/zuul-pkg.el > *.elc > diff --git a/README.md b/README.md > index a84d091e17..f3e83404a5 100644 > --- a/README.md > +++ b/README.md > @@ -105,4 +105,4 @@ The `zuul.el` package supports [Connection Local Variables](https://www.gnu.org/ > > # Contributions > > -The author might try to include the package into ELPA in the future, which means that if you want to contribute you must have a copyright assignment. > +The author might try to include the package into GNU ELPA in the future, which means that if you want to contribute you must have a copyright assignment. > diff --git a/zuul.el b/zuul.el > index 178022180f..b7340dc61c 100644 > --- a/zuul.el > +++ b/zuul.el > @@ -1,6 +1,6 @@ > ;;; zuul.el --- Interface to Zuul -*- lexical-binding: t; -*- > > -;; Copyright (C) 2022 Niklas Eklund > +;; Copyright (C) 2022 Free Software Foundation, Inc. > > ;; Author: Niklas Eklund > ;; URL: https://git.sr.ht/~niklaseklund/zuul.el > @@ -371,7 +371,6 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and LIMIT." > > ;;;; Commands > > -;;;###autoload > (defun zuul-switch-build () > "Switch to another build." > (interactive) > @@ -379,7 +378,6 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and LIMIT." > (zuul--open-build-log > (zuul--builds zuul--current-build)))) > > -;;;###autoload > (defun zuul-switch-buildset () > "Switch to a build from a specific buildset." > (interactive) > @@ -387,7 +385,6 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and LIMIT." > (zuul--open-build-log > (zuul--buildsets zuul--current-build)))) > > -;;;###autoload > (defun zuul-open-build-in-browser () > "Open build in browser." > (interactive) > @@ -397,7 +394,6 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and LIMIT." > "/t/" zuul-tenant > "/build/" .uuid "/console")))) > > -;;;###autoload > (defun zuul-run-build-command () > "Run build command from build log." > (interactive) > @@ -406,7 +402,6 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and LIMIT." > (detached-compile command) > (compile command)))) > > -;;;###autoload > (defun zuul-next-build () > "Switch to next build." > (interactive) > @@ -422,7 +417,6 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and LIMIT." > (cdr (assoc next-index builds-with-index)))) > (zuul--open-build-log next-build))) > > -;;;###autoload > (defun zuul-previous-build () > "Switch to previous build." > (interactive) > @@ -438,7 +432,6 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and LIMIT." > (cdr (assoc previous-index builds-with-index)))) > (zuul--open-build-log previous-build))) > > -;;;###autoload > (defun zuul-quit-build () > "Kill buffers associated with build." > (interactive) > @@ -459,7 +452,6 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and LIMIT." > .change))))) > (seq-do #'kill-buffer)))) > > -;;;###autoload > (defun zuul-previous-command () > "Navigate to previous command." > (interactive) > @@ -468,7 +460,6 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and LIMIT." > (when (re-search-backward re-prompt nil t) > (goto-char (match-end 0))))) > > -;;;###autoload > (defun zuul-next-command () > "Navigate to next command." > (interactive) > @@ -484,7 +475,7 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and LIMIT." > (with-connection-local-variables > (seq-find > (lambda (it) > - (string= (plist-get it ':name) zuul-tenant)) > + (string= (plist-get it :name) zuul-tenant)) > zuul-tenant-configs))) > > (defun zuul--project-root (project) > @@ -492,7 +483,7 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and LIMIT." > (if-let ((tenant-config (zuul--tenant-config)) > (project-root (cdr > (assoc project > - (plist-get tenant-config ':project-roots))))) > + (plist-get tenant-config :project-roots))))) > (concat (file-remote-p default-directory) project-root) > (message "Project root for %s wasn't found, falling back to `default-directory'" project) > default-directory)) > @@ -854,13 +845,13 @@ Optionally provide extra parameters PARAMS, PARSER, METHOD, BUFFER or HEADERS." > (let* ((annotations > (seq-map (lambda (candidate) > (cl-loop for config in annotation-config > - collect `(,(plist-get config ':name) . > - ,(funcall (plist-get config ':function) candidate)))) > + collect `(,(plist-get config :name) . > + ,(funcall (plist-get config :function) candidate)))) > candidates)) > (annotation-widths > (cl-loop for config in annotation-config > collect > - `(,(plist-get config ':name) . > + `(,(plist-get config :name) . > ,(thread-last annotations > (seq-map (lambda (it) (length (alist-get (plist-get config :name) it)))) > (funcall (lambda (it) > @@ -871,17 +862,17 @@ Optionally provide extra parameters PARAMS, PARSER, METHOD, BUFFER or HEADERS." > `(,(cl-loop for config in annotation-config > concat > (let* ((padding 3) > - (str (alist-get (plist-get config ':name) annotation)) > - (width (alist-get (plist-get config ':name) annotation-widths)) > + (str (alist-get (plist-get config :name) annotation)) > + (width (alist-get (plist-get config :name) annotation-widths)) > (new-str > - (if-let* ((align (plist-get config ':align)) > + (if-let* ((align (plist-get config :align)) > (align-right (eq 'right align))) > (concat (make-string (- width (length str)) ?\s) > str (make-string padding ?\s)) > (concat > (truncate-string-to-width str width 0 ?\s) > (make-string padding ?\s))))) > - (if-let ((face (plist-get config ':face))) > + (if-let ((face (plist-get config :face))) > (zuul--propertize-face new-str face) > new-str))) > . ,candidate)) > @@ -1019,33 +1010,33 @@ Optionally provide extra parameters PARAMS, PARSER, METHOD, BUFFER or HEADERS." > > (defun zuul--data-playbook-name-str (data) > "Return name of playbook in DATA." > - (let-alist (plist-get data ':playbook) > + (let-alist (plist-get data :playbook) > .playbook)) > > (defun zuul--data-playbook-phase-str (data) > "Return the phase of playbook in DATA." > - (let-alist (plist-get data ':playbook) > + (let-alist (plist-get data :playbook) > (concat (upcase (substring .phase 0 1)) > (substring .phase 1)))) > > (defun zuul--data-play-name-str (data) > "Return the name of play in DATA." > - (let-alist (plist-get data ':play) > + (let-alist (plist-get data :play) > .play.name)) > > (defun zuul--data-task-name-str (data) > "Return the name of task in DATA." > - (let-alist (plist-get data ':task) > + (let-alist (plist-get data :task) > .task.name)) > > (defun zuul--data-task-role-str (data) > "Return the role of task in DATA." > - (let-alist (plist-get data ':task) > + (let-alist (plist-get data :task) > (or .role.name ""))) > > (defun zuul--data-task-duration-str (data) > "Return the duration of task in DATA." > - (let-alist (plist-get data ':task) > + (let-alist (plist-get data :task) > (let ((duration > (float-time > (time-subtract > @@ -1055,12 +1046,12 @@ Optionally provide extra parameters PARAMS, PARSER, METHOD, BUFFER or HEADERS." > > (defun zuul--data-host-name-str (data) > "Return the name of the host in DATA." > - (pcase-let* ((`(,hostname . ,_data) (plist-get data ':host))) > + (pcase-let* ((`(,hostname . ,_data) (plist-get data :host))) > (symbol-name hostname))) > > (defun zuul--data-host-cmd-str (data) > "Return the command of the host in DATA." > - (pcase-let* ((`(,_hostname . ,data) (plist-get data ':host)) > + (pcase-let* ((`(,_hostname . ,data) (plist-get data :host)) > (cmd-str (let-alist data .cmd))) > (if (stringp cmd-str) > cmd-str > @@ -1068,7 +1059,7 @@ Optionally provide extra parameters PARAMS, PARSER, METHOD, BUFFER or HEADERS." > > (defun zuul--data-host-result-str (data) > "Return the result of the host in DATA." > - (pcase-let* ((`(,_hostname . ,data) (plist-get data ':host)) > + (pcase-let* ((`(,_hostname . ,data) (plist-get data :host)) > (result > (let-alist data > (if .failed