all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tony Zorman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Philip Kaludercic <philipk@posteo.net>
Cc: Eli Zaretskii <eliz@gnu.org>,
	felician.nemeth@gmail.com, 60418@debbugs.gnu.org,
	stefankangas@gmail.com
Subject: bug#60418: [PATCH] Add :vc keyword to use-package
Date: Sun, 23 Apr 2023 08:07:37 +0200	[thread overview]
Message-ID: <87jzy3ku6u.fsf@hyperspace> (raw)
In-Reply-To: <87cz3w2lvb.fsf@posteo.net>

On Sat, Apr 22 2023 11:32, Philip Kaludercic wrote:
> (Sorry for all the back and forth, I hope you understand that this is
> just to get stuff right and not for my own sake of being pedantic.  If
> you don't have the time, I can also make the changes I'd just like to
> hear your opinions.)

No, I totally get it. Getting this stuff right the first time is much
easier than going back and trying to fix it afterwards.

I agree with most of your suggestions, so I'm just going to answer those
where I have questions/comments.

>> +(ert-deftest use-package-test/:vc-1 ()
>> +  (match-expansion
>> +   (use-package foo :vc (:url "bar"))
>> +   '(use-package-vc-install '(foo (:url "bar") :last-release) nil)))
>> +
>> +(ert-deftest use-package-test/:vc-2 ()
>> +  (match-expansion
>> +   (use-package foo
>> +     :vc (baz . (:url "baz" :vc-backend "Git"
>> +                 :main-file qux.el :rev "rev-string")))
>> +   `(use-package-vc-install '(baz
>> +                              (:url "baz" :vc-backend Git :main-file "qux.el")
>> +                              "rev-string")
>> +                            nil)))
>> +
>> +(ert-deftest use-package-test/:vc-3 ()
>> +  (match-expansion
>> +   (use-package foo :vc (bar . "baz"))
>> +   `(use-package-vc-install '(bar "baz") nil)))
>> +
>> +(ert-deftest use-package-test/:vc-4 ()
>> +  (match-expansion
>> +   (use-package foo :vc (bar . (:url "baz" :rev :head)))
>> +   '(use-package-vc-install '(bar (:url "baz") nil) nil)))
>> +
>> +(ert-deftest use-package-test/:vc-5 ()
>> +  (let ((load-path? '(pred (apply-partially
>> +                            #'string=
>> +                            (expand-file-name "bar" user-emacs-directory)))))
>> +    (match-expansion
>> +     (use-package foo :vc other-name :load-path "bar")
>> +     `(progn (eval-and-compile
>> +               (add-to-list 'load-path ,load-path?))
>> +             (use-package-vc-install '(other-name) ,load-path?)))))
>> +
>> +(ert-deftest use-package-test-normalize/:vc ()
>> +  (should (equal '(foo "version-string")
>> +                 (use-package-normalize/:vc 'foo :vc '("version-string"))))
>> +  (should (equal '(bar "version-string")
>> +                 (use-package-normalize/:vc 'foo :vc '((bar . "version-string")))))
>> +  (should (equal '(foo (:url "bar") "baz")
>> +                 (use-package-normalize/:vc 'foo :vc '((:url "bar" :rev "baz")))))
>> +  (should (equal '(foo)
>> +                 (use-package-normalize/:vc 'foo :vc '(t))))
>> +  (should (equal '(foo)
>> +                 (use-package-normalize/:vc 'foo :vc nil)))
>> +  (should (equal '(bar)
>> +                 (use-package-normalize/:vc 'foo :vc '(bar)))))
>
> On my machine, these tests appear to fail?  Also, it would probably be
> useful to document them (at leat the ...-1 to ...-5 ones) so that a
> failure can be more easily understood.

They don't fail for me—maybe I'm running the tests wrong? So far, I've
done so interactively by evaluating the whole buffer and then running
`M-x ert'. The -1…-5 tests just test the macro expansion, so e.g.

    (ert-deftest use-package-test/:vc-1 ()
      (match-expansion
       (use-package foo :vc (:url "bar"))
       '(use-package-vc-install '(foo (:url "bar") :last-release) nil)))

would test if the first argument to `match-expansion' actually expands
into the second one or not (which I guess explains why the error
messages are a bit hard to understand).   

>>                                It accepts the same arguments as
>> +@code{package-vc-selected-packages} (@pxref{Specifying Package
>> +Sources,,, emacs, GNU Emacs Manual}), except that a name need not
>
> This link does not appear to work.  I believe you can only link to a
> node, and this is just a section.  Also, referring to the variable has
> become an unnecessary redirection, since the variable documentation now
> refers to the manual.

Oh, I see. I have to admit that info links are still a bit of a mystery
to me; sorry. So should I just link to the closest node, which would be
"Fetching Package Sources" again, here?

>> +For example,
>> +
>> +@lisp
>> +@group
>> +(use-package foo
>> +  :vc (:url "https://bar.com/foo" :rev :head))
>> +@end group
>> +@end lisp
>
> I think it would make sense to use the same examples as the Emacs manual
> has been updated to use (BBDB) so that users can directly try out the
> code.

Sorry, I'm not sure I follow: the same examples as what exactly? Or do
you just mean an actual package that users could try out when executing
this code, instead of a dummy one?

>> +would try -- by invoking @code{package-vc-install} -- to install the
>> +latest commit of the package @code{foo} from the specified remote.
>> +
>> +This can also be used for local packages, by combining it with the
>> +@code{:load-path} (@pxref{Load path}) keyword:
>> +
>> +@lisp
>> +@group
>> +(use-package foo
>> +  :vc t
>> +  :load-path "/path/to/foo/)
>> +@end group
>> +@end lisp
>> +
>> +The above dispatches to @code{package-vc-install-from-checkout}
>> +(@pxref{Fetching Package Sources,,, emacs, GNU Emacs Manual}).
>
> Does this reference here really help?

Perhaps not. I don't have any strong opinions about this, so if you
prefer I can remove this.

-- 
Tony Zorman | https://tony-zorman.com/





  reply	other threads:[~2023-04-23  6:07 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-29 18:43 bug#60418: [PATCH] Add :vc keyword to use-package Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] ` <handler.60418.B.167238381823776.ack@debbugs.gnu.org>
2023-01-14 12:48   ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-31 14:13     ` Felician Nemeth
2023-03-31 15:38       ` Philip Kaludercic
2023-04-07 14:11         ` Philip Kaludercic
2023-04-08  8:48           ` Felician Nemeth
2023-04-08  9:06             ` Philip Kaludercic
2023-04-08  9:25               ` Felician Nemeth
2023-04-08 10:41                 ` Philip Kaludercic
2023-04-11 14:10                   ` Felician Nemeth
2023-04-12  7:12                 ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-12  7:34                   ` Philip Kaludercic
2023-04-12  9:00                     ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-16 15:43                       ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-16 16:10                         ` Eli Zaretskii
2023-04-17 19:39                           ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-18 12:13                             ` Eli Zaretskii
2023-04-19 17:38                               ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-22  9:26                                 ` Eli Zaretskii
2023-04-22 11:34                                   ` Philip Kaludercic
2023-04-23  5:51                                     ` John Wiegley
2023-04-22 11:32                                 ` Philip Kaludercic
2023-04-23  6:07                                   ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-04-23 12:35                                     ` Philip Kaludercic
2023-04-24 12:36                                       ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-01 19:43                                         ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-01 20:01                                           ` Philip Kaludercic
2023-05-02 13:18                                             ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-02 13:59                                               ` Robert Pluim
2023-05-02 15:09                                               ` Eli Zaretskii
2023-05-02 14:36                                             ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-02 12:40                                           ` Eli Zaretskii
2023-05-02 14:22                                             ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-02 15:16                                               ` Eli Zaretskii
2023-05-04  8:13                                                 ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-04 10:39                                                   ` Eli Zaretskii
2023-05-05  5:04                                                   ` Philip Kaludercic
2023-05-05  5:36                                                     ` Eli Zaretskii
2023-05-05  5:49                                                       ` Philip Kaludercic
2023-05-05  6:53                                                         ` Eli Zaretskii
2023-05-05 17:15                                                           ` Philip Kaludercic
2023-05-05 18:45                                                             ` Eli Zaretskii
2023-05-06 18:50                                                               ` Philip Kaludercic
2023-05-06 19:13                                                                 ` Eli Zaretskii
2023-05-07  7:34                                                                   ` Philip Kaludercic
2023-05-06 19:39                                                                 ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-07  8:52                                                                   ` Philip Kaludercic
2023-05-16 19:30                                                                     ` Philip Kaludercic
2023-05-17  5:42                                                                       ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-16 16:18                         ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzy3ku6u.fsf@hyperspace \
    --to=bug-gnu-emacs@gnu.org \
    --cc=60418@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=felician.nemeth@gmail.com \
    --cc=philipk@posteo.net \
    --cc=soliditsallgood@mailbox.org \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.