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: Add zuul.el package to ELPA Date: Tue, 30 Aug 2022 10:22:56 -0400 Message-ID: References: <874jxuj3q1.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15809"; 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: Niklas Eklund Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 30 16:24:12 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 1oT29z-0003ve-32 for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Aug 2022 16:24:11 +0200 Original-Received: from localhost ([::1]:55940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT29x-0005Y2-EA for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Aug 2022 10:24:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT290-0004rF-MN for emacs-devel@gnu.org; Tue, 30 Aug 2022 10:23:11 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT28v-0004sr-HV for emacs-devel@gnu.org; Tue, 30 Aug 2022 10:23:09 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0AD0C4426FA; Tue, 30 Aug 2022 10:23:04 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3C59A4426E3; Tue, 30 Aug 2022 10:23:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1661869381; bh=o7HqeB4nM8Syes/KYAi5WJjVZ0UgJcdTeoCKGKhyKww=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TnzM8It/SNinmA3ji7roubzwYaMDEtsqoihS2nRQk+92z3G+sEdlTYINEPc5l+CJ7 En6hU4F0nPQOLFMf5XZd8QtOvToRL5TvMiuKgy69d6RY9DX+fud8XRJBxRnxGyAKIu P9NkhO884Kdo7jrlAhdz/5MPLD8Fy+p4EIcx1N6nMgMNyhqphXgUDAfujsT870X4p2 ur51xSYIB/5b0t566qGsVhHYgaLBKx0AhlHQrGFLFflK4oJ2SCmRo5nok2Hp+UbtyF eBlPpVJFAhyOXKqKyODM7aKI7wfnvEwDWVqAI7EwWZmCFepsPU/zvYvAfAF8FRgrVn 1USF1oVUrnMLA== Original-Received: from pastel (unknown [45.72.195.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 04D27120728; Tue, 30 Aug 2022 10:23:00 -0400 (EDT) In-Reply-To: <874jxuj3q1.fsf@posteo.net> (Niklas Eklund's message of "Mon, 29 Aug 2022 18:37:26 +0000") 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:294347 Archived-At: --=-=-= Content-Type: text/plain 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). 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. Stefan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=zuul.patch 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 --=-=-=--