From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#19537: Manual documents nonexistent functionality of package-upload-buffer Date: Mon, 15 Jul 2019 08:50:43 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="197841"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Kelly Dean , 19537@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 15 14:51:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hn0Rh-000pI4-Qo for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Jul 2019 14:51:09 +0200 Original-Received: from localhost ([::1]:38212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn0Rg-0004yE-Nh for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Jul 2019 08:51:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40160) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn0Rd-0004xv-2F for bug-gnu-emacs@gnu.org; Mon, 15 Jul 2019 08:51:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn0Rb-0002CH-EH for bug-gnu-emacs@gnu.org; Mon, 15 Jul 2019 08:51:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38024) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hn0Rb-0002Bv-AU for bug-gnu-emacs@gnu.org; Mon, 15 Jul 2019 08:51:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hn0Ra-00044k-B2 for bug-gnu-emacs@gnu.org; Mon, 15 Jul 2019 08:51:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Jul 2019 12:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19537 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 19537-submit@debbugs.gnu.org id=B19537.156319505415650 (code B ref 19537); Mon, 15 Jul 2019 12:51:02 +0000 Original-Received: (at 19537) by debbugs.gnu.org; 15 Jul 2019 12:50:54 +0000 Original-Received: from localhost ([127.0.0.1]:46845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hn0RR-00044L-B7 for submit@debbugs.gnu.org; Mon, 15 Jul 2019 08:50:53 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hn0RP-000448-L1 for 19537@debbugs.gnu.org; Mon, 15 Jul 2019 08:50:52 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 15FF0444CE3; Mon, 15 Jul 2019 08:50:46 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3D511444CE6; Mon, 15 Jul 2019 08:50:44 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1563195044; bh=wWwJgUfpLEp4L2iTeeKZIbZmVuc2tSE6KW6kZLB6tDA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=egZFAJBuyVwm9x2pEPKQjopiv6sieHFSONJxJnLqQ3xLR7zbZnETQ/r2v+aY+pr3X yIW2wQOz9skZz7Vg8ok4sUJ7i54+efoc32b6t1tMQ8MaL4t27NOcVMkRe7YO56VnEJ 80GoDPCISL9nsV4bG/cFdYN+0Boft8UrRHGJKizvdUtGDHqwWsUuYz4G+xNwF9xImh 5O/ABoLznfgQb+1AaieTC5MiOiFt6l8uMUK7O7cxiT3IoTYt/BoMbpJe7Sgdv3/jfj y9p+w/H+U/uAcP/LBkNNhneztNLybhT+VL3HfQsbwdMey9Grx6rH0uIUp5NvX34n4N XZiox4x6us/MA== Original-Received: from pastel (104-222-123-229.cpe.teksavvy.com [104.222.123.229]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DF449120376; Mon, 15 Jul 2019 08:50:43 -0400 (EDT) In-Reply-To: (Stefan Kangas's message of "Sun, 14 Jul 2019 06:21:21 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:163107 Archived-At: LGTM, thanks, Stefan Stefan Kangas [2019-07-14 06:21:21] wrote: > tags 19537 + patch > thanks > > Kelly Dean writes: > >> Manual page =C2=AB(elisp) Package Archives=C2=BB says: >> =E2=8C=9C -- Command: package-upload-buffer >> This command is similar to `package-upload-file', but instead of >> prompting for a package file, it uploads the contents of the >> current buffer. The current buffer must be visiting a simple >> package (a `.el' file) or a multi-file package (a `.tar' file); >> otherwise, an error is raised.=E2=8C=9D >> >> But in fact, it must be visiting a simple package; it can't be a multi-f= ile >> package. For the latter, only package-upload-file works (and even that w= orks >> only after the patch for bug #19536 is applied). > > Stefan Monnier writes: > >> The package shouldn't document the "upload" functionality of package-x, >> since that's a functionality that pretty much noone uses (most/all ELPA >> archives use a different way to "upload" a package to it). > > OK, I took a stab at removing it from the manual and added the > information it contained to the doc strings of the relevant functions > instead. Please see attached patch -- WDYT? > > Thanks, > Stefan Kangas > > From 06eff2ec14ef068f3d0bb9bc0cc2e7267ef5995d Mon Sep 17 00:00:00 2001 > From: Stefan Kangas > Date: Sun, 14 Jul 2019 05:59:46 +0200 > Subject: [PATCH] Remove upload functionality of package-x from the elisp > manual > > Suggested by Stefan Monnier. > Ref: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19537#8 > > * doc/lispref/package.texi (Package Archives): Don't document > package-x upload functions in the elisp manual, since they are not > very commonly used. (Bug#19537) > * lisp/emacs-lisp/package-x.el (package-archive-upload-base) > (package-upload-buffer, package-upload-file): Add to the doc strings > any details removed from the elisp manual that would otherwise be > missing. > --- > doc/lispref/package.texi | 35 ----------------------------------- > lisp/emacs-lisp/package-x.el | 13 +++++++++++-- > 2 files changed, 11 insertions(+), 37 deletions(-) > > diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi > index 7244efbd8f..a2f4f55be7 100644 > --- a/doc/lispref/package.texi > +++ b/doc/lispref/package.texi > @@ -321,41 +321,6 @@ Package Archives > by default; type @kbd{M-x load-library @key{RET} package-x @key{RET}} to > load it, or add @code{(require 'package-x)} to your init file. > @xref{Lisp Libraries,, Lisp Libraries, emacs, The GNU Emacs Manual}. > -Once loaded, you can make use of the following: > - > -@defopt package-archive-upload-base > -The value of this variable is the base location of a package archive, > -as a directory name. The commands in the @code{package-x} library > -will use this base location. > - > -The directory name should be absolute. You may specify a remote name, > -such as @file{/ssh:foo@@example.com:/var/www/packages/}, if the > -package archive is on a different machine. @xref{Remote Files,, > -Remote Files, emacs, The GNU Emacs Manual}. > -@end defopt > - > -@deffn Command package-upload-file filename > -This command prompts for @var{filename}, a file name, and uploads that > -file to @code{package-archive-upload-base}. The file must be either a > -simple package (a @file{.el} file) or a multi-file package (a > -@file{.tar} file); otherwise, an error is raised. The package > -attributes are automatically extracted, and the archive's contents > -list is updated with this information. > - > -If @code{package-archive-upload-base} does not specify a valid > -directory, the function prompts interactively for one. If the > -directory does not exist, it is created. The directory need not have > -any initial contents (i.e., you can use this command to populate an > -initially empty archive). > -@end deffn > - > -@deffn Command package-upload-buffer > -This command is similar to @code{package-upload-file}, but instead of > -prompting for a package file, it uploads the contents of the current > -buffer. The current buffer must be visiting a simple package (a > -@file{.el} file) or a multi-file package (a @file{.tar} file); > -otherwise, an error is raised. > -@end deffn >=20=20 > @noindent > After you create an archive, remember that it is not accessible in the > diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el > index 1486aeb373..1ddcb3eeaf 100644 > --- a/lisp/emacs-lisp/package-x.el > +++ b/lisp/emacs-lisp/package-x.el > @@ -47,6 +47,8 @@ gnus-article-buffer >=20=20 > (defcustom package-archive-upload-base "/path/to/archive" > "The base location of the archive to which packages are uploaded. > +The commands in the package-x library will use this as base > +location. > This should be an absolute directory name. If the archive is on > another machine, you may specify a remote name in the usual way, > e.g. \"/ssh:foo@example.com:/var/www/packages/\". > @@ -273,7 +275,9 @@ package-upload-buffer-internal > (defun package-upload-buffer () > "Upload the current buffer as a single-file Emacs Lisp package. > If `package-archive-upload-base' does not specify a valid upload > -destination, prompt for one." > +destination, prompt for one. > +Signal an error if the current buffer is not visiting a simple > +package (a \".el\" file)." > (interactive) > (save-excursion > (save-restriction > @@ -286,8 +290,13 @@ package-upload-file > Interactively, prompt for FILE. The package is considered a > single-file package if FILE ends in \".el\", and a multi-file > package if FILE ends in \".tar\". > +Automatically extract package attributes and update the archive's > +contents list with this information. > If `package-archive-upload-base' does not specify a valid upload > -destination, prompt for one." > +destination, prompt for one. If the directory does not exist, it > +is created. The directory need not have any initial contents > +\(i.e., you can use this command to populate an initially empty > +archive)." > (interactive "fPackage file name: ") > (with-temp-buffer > (insert-file-contents file)