unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* package.el: soft dependencies?
@ 2015-07-14 20:53 Yuri D'Elia
  2015-07-14 21:28 ` Rasmus
  2015-07-14 23:32 ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Yuri D'Elia @ 2015-07-14 20:53 UTC (permalink / raw)
  To: emacs-devel

Several packages support additional features when certain other packages
are also installed, but right now the list of additional packages which
are not strict dependencies are "buried" in the commentary.

I know I do the same: I only put strict dependencies in Package-Requires.

I'd love to be able to add and read about "soft" dependencies when
browsing for packages (just like Debian's Suggests).

This could be accomplished with a Package-Suggests header, with exactly
the same format as Package-Requires. package.el would just need to
present this information in the package description page, for the user
to inspect.

What do other people think?




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: package.el: soft dependencies?
  2015-07-14 20:53 package.el: soft dependencies? Yuri D'Elia
@ 2015-07-14 21:28 ` Rasmus
  2015-07-14 21:52   ` Yuri D'Elia
  2015-07-14 23:32 ` Stefan Monnier
  1 sibling, 1 reply; 9+ messages in thread
From: Rasmus @ 2015-07-14 21:28 UTC (permalink / raw)
  To: emacs-devel

Yuri D'Elia <wavexx@thregr.org> writes:

> This could be accomplished with a Package-Suggests header, with exactly
> the same format as Package-Requires. package.el would just need to
> present this information in the package description page, for the user
> to inspect.

But for optional dependencies you'd want to know what you get when
installing more stuff, also within the package manager.  So there should
also be a one line summary of what the dependency adds (this is how pacman
works; I don't remember how verbose apt is).

Rasmus

-- 
Spil noget med Slayer!




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: package.el: soft dependencies?
  2015-07-14 21:28 ` Rasmus
@ 2015-07-14 21:52   ` Yuri D'Elia
  2015-07-14 22:03     ` Yuri D'Elia
  0 siblings, 1 reply; 9+ messages in thread
From: Yuri D'Elia @ 2015-07-14 21:52 UTC (permalink / raw)
  To: emacs-devel

On 14/07/15 23:28, Rasmus wrote:
> Yuri D'Elia <wavexx@thregr.org> writes:
> 
>> This could be accomplished with a Package-Suggests header, with exactly
>> the same format as Package-Requires. package.el would just need to
>> present this information in the package description page, for the user
>> to inspect.
> 
> But for optional dependencies you'd want to know what you get when
> installing more stuff, also within the package manager.  So there should
> also be a one line summary of what the dependency adds (this is how pacman
> works; I don't remember how verbose apt is).

apt has no detail as of why a package is suggested, and it works well
enough for me. Presenting the list briefly, as done for the requirements
would do.

Normally, when a package is suggested, I explicitly look for it in the
docs/description. Just knowing it's suggested does the job.

Most of the time the package name makes it immediately obvious though,
so it's rather straighforward.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: package.el: soft dependencies?
  2015-07-14 21:52   ` Yuri D'Elia
@ 2015-07-14 22:03     ` Yuri D'Elia
  2015-07-15 10:06       ` Artur Malabarba
  0 siblings, 1 reply; 9+ messages in thread
From: Yuri D'Elia @ 2015-07-14 22:03 UTC (permalink / raw)
  To: emacs-devel

On 14/07/15 23:52, Yuri D'Elia wrote:
>> But for optional dependencies you'd want to know what you get when
>> installing more stuff, also within the package manager.  So there should
>> also be a one line summary of what the dependency adds (this is how pacman
>> works; I don't remember how verbose apt is).
> 
> apt has no detail as of why a package is suggested, and it works well
> enough for me. Presenting the list briefly, as done for the requirements
> would do.

To be clear: not that I won't like a summary line, but I don't think
it's required at all to still be a great addition in usability.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: package.el: soft dependencies?
  2015-07-14 20:53 package.el: soft dependencies? Yuri D'Elia
  2015-07-14 21:28 ` Rasmus
@ 2015-07-14 23:32 ` Stefan Monnier
  2015-07-16 11:35   ` Artur Malabarba
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2015-07-14 23:32 UTC (permalink / raw)
  To: Yuri D'Elia; +Cc: emacs-devel

> This could be accomplished with a Package-Suggests header, with exactly
> the same format as Package-Requires. package.el would just need to
> present this information in the package description page, for the user
> to inspect.

Sounds good to me.


        Stefan



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: package.el: soft dependencies?
  2015-07-14 22:03     ` Yuri D'Elia
@ 2015-07-15 10:06       ` Artur Malabarba
  2015-07-15 15:09         ` Bozhidar Batsov
  0 siblings, 1 reply; 9+ messages in thread
From: Artur Malabarba @ 2015-07-15 10:06 UTC (permalink / raw)
  To: Yuri D'Elia; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

This feature would be a good addition, and would be pretty easy and (more
importantly) backwards compatible. I've seen this asked by a few people
already.
I also think it needs the summary. I use both pacman and apt, and the
summary makes a big difference.

[-- Attachment #2: Type: text/html, Size: 284 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: package.el: soft dependencies?
  2015-07-15 10:06       ` Artur Malabarba
@ 2015-07-15 15:09         ` Bozhidar Batsov
  0 siblings, 0 replies; 9+ messages in thread
From: Bozhidar Batsov @ 2015-07-15 15:09 UTC (permalink / raw)
  To: Artur Malabarba; +Cc: Yuri D'Elia, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]

+1 - this would be a great addition.

On 15 July 2015 at 13:06, Artur Malabarba <bruce.connor.am@gmail.com> wrote:

> This feature would be a good addition, and would be pretty easy and (more
> importantly) backwards compatible. I've seen this asked by a few people
> already.
> I also think it needs the summary. I use both pacman and apt, and the
> summary makes a big difference.
>

[-- Attachment #2: Type: text/html, Size: 704 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: package.el: soft dependencies?
  2015-07-14 23:32 ` Stefan Monnier
@ 2015-07-16 11:35   ` Artur Malabarba
  2015-07-16 12:23     ` Tassilo Horn
  0 siblings, 1 reply; 9+ messages in thread
From: Artur Malabarba @ 2015-07-16 11:35 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Yuri D'Elia, Bozhidar Batsov, emacs-devel

If package.el is going to do this, it might be good to add support for
optional dependencies in other places too, like in the byte-compiler.

For instance, we could have a form like the following

(require-optionally 'projectile
  (projectile-ag projectile-dired ...))

When the byte-compiler reads this, it will try to require projectile.
If projectile is available, great, if it isn't then the compiler
treats all those listed functions and macros as `ignore'.

This would sometimes make it more convenient for the developer to
support optional features, because you would only need to account for
the possibility of them return nil, instead of always being forced to
check if they're `fbound'. Though sometimes you'd still need to check
to manually.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: package.el: soft dependencies?
  2015-07-16 11:35   ` Artur Malabarba
@ 2015-07-16 12:23     ` Tassilo Horn
  0 siblings, 0 replies; 9+ messages in thread
From: Tassilo Horn @ 2015-07-16 12:23 UTC (permalink / raw)
  To: Artur Malabarba
  Cc: Yuri D'Elia, Stefan Monnier, Bozhidar Batsov, emacs-devel

Artur Malabarba <bruce.connor.am@gmail.com> writes:

> If package.el is going to do this, it might be good to add support for
> optional dependencies in other places too, like in the byte-compiler.
>
> For instance, we could have a form like the following
>
> (require-optionally 'projectile
>   (projectile-ag projectile-dired ...))
>
> When the byte-compiler reads this, it will try to require projectile.
> If projectile is available, great, if it isn't then the compiler
> treats all those listed functions and macros as `ignore'.
>
> This would sometimes make it more convenient for the developer to
> support optional features, because you would only need to account for
> the possibility of them return nil, instead of always being forced to
> check if they're `fbound'. Though sometimes you'd still need to check
> to manually.

IMHO, something like

  (if (fboundp 'projectile-something)
      (projectile-something arg)
    (some-fallback arg))

is much more obvious to be identified as a call to something optional
rather than

  (or (projectile-something arg) (some-fallback arg))

Well, and in the case where nil is a valid return value you couldn't
differentiate at all, e.g., with

  (projectile-project-buffer-p (current-buffer) root)

you the current buffer could either be no project buffer under root or
projectile could simply not be available.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-07-16 12:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-14 20:53 package.el: soft dependencies? Yuri D'Elia
2015-07-14 21:28 ` Rasmus
2015-07-14 21:52   ` Yuri D'Elia
2015-07-14 22:03     ` Yuri D'Elia
2015-07-15 10:06       ` Artur Malabarba
2015-07-15 15:09         ` Bozhidar Batsov
2015-07-14 23:32 ` Stefan Monnier
2015-07-16 11:35   ` Artur Malabarba
2015-07-16 12:23     ` Tassilo Horn

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).