all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Sub-libaries in a package and use-package ?
@ 2023-06-26 22:36 David Masterson
  2023-06-27  6:03 ` Philip Kaludercic
  0 siblings, 1 reply; 5+ messages in thread
From: David Masterson @ 2023-06-26 22:36 UTC (permalink / raw)
  To: help-gnu-emacs

The 'async' package has 2 extra libraries (dired-async &
smtpmail-async). I'm trying to figure out how to set these up with
use-package, The documentation for use-package in chapter 3.1 says:

----
But the ‘foo’ package might also contain a library named ‘foo-extra.el’.
If that library is not loaded automatically, you will need a separate
‘use-package’ declaration to make sure that it is.
----

It doesn't say anything else about this (CMIIAW), but this suggests to
me that the following should work:

(use-package async
  :config (async-bytecomp-package-mode 1)
  )
(use-package dired-async
  :config (dired-async-mode 1)
  )
(use-package smtpmail-async
  :config (setq message-send-mail-function 'aync-smtpmail-send-it)
  )

But the following error when I start Emacs:

Error (use-package): Failed to install dired-async: Package
  ‘dired-async-’ is unavailable 
Error (use-package): Failed to install smtpmail-async: Package
  ‘smtpmail-async-’ is unavailable 

This suggests that use-package can't find the *package* when all it
should be doing is picking up the library in async which already
established the load-path.

What am I missing?

-- 
David Masterson



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

* Re: Sub-libaries in a package and use-package ?
  2023-06-26 22:36 Sub-libaries in a package and use-package ? David Masterson
@ 2023-06-27  6:03 ` Philip Kaludercic
  2023-06-27 18:04   ` David Masterson
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Kaludercic @ 2023-06-27  6:03 UTC (permalink / raw)
  To: David Masterson; +Cc: help-gnu-emacs

David Masterson <dsmasterson@gmail.com> writes:

> The 'async' package has 2 extra libraries (dired-async &
> smtpmail-async). I'm trying to figure out how to set these up with
> use-package, The documentation for use-package in chapter 3.1 says:
>
> ----
> But the ‘foo’ package might also contain a library named ‘foo-extra.el’.
> If that library is not loaded automatically, you will need a separate
> ‘use-package’ declaration to make sure that it is.
> ----
>
> It doesn't say anything else about this (CMIIAW), but this suggests to
> me that the following should work:
>
> (use-package async
>   :config (async-bytecomp-package-mode 1)
>   )
> (use-package dired-async
>   :config (dired-async-mode 1)
>   )
> (use-package smtpmail-async
>   :config (setq message-send-mail-function 'aync-smtpmail-send-it)
>   )
>
> But the following error when I start Emacs:
>
> Error (use-package): Failed to install dired-async: Package
>   ‘dired-async-’ is unavailable 
> Error (use-package): Failed to install smtpmail-async: Package
>   ‘smtpmail-async-’ is unavailable 

Did you set `use-package-always-ensure' to a non-nil value?  It might be
that use-package is trying to install the package
{dired,stmpmail}-async, even though these are just libraries, part of
the async package.

Also, I don't think it is necessary to configure all of these
separately, at least in your case.

> This suggests that use-package can't find the *package* when all it
> should be doing is picking up the library in async which already
> established the load-path.
>
> What am I missing?



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

* Re: Sub-libaries in a package and use-package ?
  2023-06-27  6:03 ` Philip Kaludercic
@ 2023-06-27 18:04   ` David Masterson
  2023-06-27 19:01     ` Philip Kaludercic
  0 siblings, 1 reply; 5+ messages in thread
From: David Masterson @ 2023-06-27 18:04 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: help-gnu-emacs

Philip Kaludercic <philipk@posteo.net> writes:

> David Masterson <dsmasterson@gmail.com> writes:
>
>> The 'async' package has 2 extra libraries (dired-async &
>> smtpmail-async). I'm trying to figure out how to set these up with
>> use-package, The documentation for use-package in chapter 3.1 says:
>>
>> ----
>> But the ‘foo’ package might also contain a library named ‘foo-extra.el’.
>> If that library is not loaded automatically, you will need a separate
>> ‘use-package’ declaration to make sure that it is.
>> ----
>>
>> It doesn't say anything else about this (CMIIAW), but this suggests to
>> me that the following should work:
>>
>> (use-package async
>>   :config (async-bytecomp-package-mode 1)
>>   )
>> (use-package dired-async
>>   :config (dired-async-mode 1)
>>   )
>> (use-package smtpmail-async
>>   :config (setq message-send-mail-function 'aync-smtpmail-send-it)
>>   )
>>
>> But the following error when I start Emacs:
>>
>> Error (use-package): Failed to install dired-async: Package
>>   ‘dired-async-’ is unavailable 
>> Error (use-package): Failed to install smtpmail-async: Package
>>   ‘smtpmail-async-’ is unavailable 
>
> Did you set `use-package-always-ensure' to a non-nil value?  It might be
> that use-package is trying to install the package
> {dired,stmpmail}-async, even though these are just libraries, part of
> the async package.

Hmm. I do have 'use-package-always-ensure' set to t, but it doesn't look
like it's trying to install -- it just can't find the package.  There
should be a mechanism to tell use-package that this is a library in some
other package, 

> Also, I don't think it is necessary to configure all of these
> separately, at least in your case.

Possibly true.  I can get around this by requiring the sub-libraries in
the :config section of async.  But that doesn't quite feel right,,, :(

-- 
David Masterson



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

* Re: Sub-libaries in a package and use-package ?
  2023-06-27 18:04   ` David Masterson
@ 2023-06-27 19:01     ` Philip Kaludercic
  2023-07-03  4:48       ` David Masterson
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Kaludercic @ 2023-06-27 19:01 UTC (permalink / raw)
  To: David Masterson; +Cc: help-gnu-emacs

David Masterson <dsmasterson@gmail.com> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> David Masterson <dsmasterson@gmail.com> writes:
>>
>>> The 'async' package has 2 extra libraries (dired-async &
>>> smtpmail-async). I'm trying to figure out how to set these up with
>>> use-package, The documentation for use-package in chapter 3.1 says:
>>>
>>> ----
>>> But the ‘foo’ package might also contain a library named ‘foo-extra.el’.
>>> If that library is not loaded automatically, you will need a separate
>>> ‘use-package’ declaration to make sure that it is.
>>> ----
>>>
>>> It doesn't say anything else about this (CMIIAW), but this suggests to
>>> me that the following should work:
>>>
>>> (use-package async
>>>   :config (async-bytecomp-package-mode 1)
>>>   )
>>> (use-package dired-async
>>>   :config (dired-async-mode 1)
>>>   )
>>> (use-package smtpmail-async
>>>   :config (setq message-send-mail-function 'aync-smtpmail-send-it)
>>>   )
>>>
>>> But the following error when I start Emacs:
>>>
>>> Error (use-package): Failed to install dired-async: Package
>>>   ‘dired-async-’ is unavailable 
>>> Error (use-package): Failed to install smtpmail-async: Package
>>>   ‘smtpmail-async-’ is unavailable 
>>
>> Did you set `use-package-always-ensure' to a non-nil value?  It might be
>> that use-package is trying to install the package
>> {dired,stmpmail}-async, even though these are just libraries, part of
>> the async package.
>
> Hmm. I do have 'use-package-always-ensure' set to t, but it doesn't look
> like it's trying to install -- it just can't find the package.  There
> should be a mechanism to tell use-package that this is a library in some
> other package, 

It cannot install the packages, because they don't exist.  Perhaps
adding a :ensure nil could help?

>> Also, I don't think it is necessary to configure all of these
>> separately, at least in your case.
>
> Possibly true.  I can get around this by requiring the sub-libraries in
> the :config section of async.  But that doesn't quite feel right,,, :(

I'd question why you need to require the libraries in the first place.



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

* Re: Sub-libaries in a package and use-package ?
  2023-06-27 19:01     ` Philip Kaludercic
@ 2023-07-03  4:48       ` David Masterson
  0 siblings, 0 replies; 5+ messages in thread
From: David Masterson @ 2023-07-03  4:48 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: help-gnu-emacs

Philip Kaludercic <philipk@posteo.net> writes:

> David Masterson <dsmasterson@gmail.com> writes:
>
>> Philip Kaludercic <philipk@posteo.net> writes:
>>
>>> David Masterson <dsmasterson@gmail.com> writes:
>>>
>>>> The 'async' package has 2 extra libraries (dired-async &
>>>> smtpmail-async). I'm trying to figure out how to set these up with
>>>> use-package, The documentation for use-package in chapter 3.1 says:
>>>>
>>>> ----
>>>> But the ‘foo’ package might also contain a library named ‘foo-extra.el’.
>>>> If that library is not loaded automatically, you will need a separate
>>>> ‘use-package’ declaration to make sure that it is.
>>>> ----
>>>>
>>>> It doesn't say anything else about this (CMIIAW), but this suggests to
>>>> me that the following should work:
>>>>
>>>> (use-package async
>>>>   :config (async-bytecomp-package-mode 1)
>>>>   )
>>>> (use-package dired-async
>>>>   :config (dired-async-mode 1)
>>>>   )
>>>> (use-package smtpmail-async
>>>>   :config (setq message-send-mail-function 'aync-smtpmail-send-it)
>>>>   )
>>>>
>>>> But the following error when I start Emacs:
>>>>
>>>> Error (use-package): Failed to install dired-async: Package
>>>>   ‘dired-async-’ is unavailable 
>>>> Error (use-package): Failed to install smtpmail-async: Package
>>>>   ‘smtpmail-async-’ is unavailable 
>>>
>>> Did you set `use-package-always-ensure' to a non-nil value?  It might be
>>> that use-package is trying to install the package
>>> {dired,stmpmail}-async, even though these are just libraries, part of
>>> the async package.
>>
>> Hmm. I do have 'use-package-always-ensure' set to t, but it doesn't look
>> like it's trying to install -- it just can't find the package.  There
>> should be a mechanism to tell use-package that this is a library in some
>> other package, 
>
> It cannot install the packages, because they don't exist.  Perhaps
> adding a :ensure nil could help?

Ah!  This seems to work good:

----
(use-package async
  :delight
  :config (async-bytecomp-package-mode 1)
  )
(use-package dired-async
  :ensure nil
  :config (dired-async-mode 1)
  )
(use-package smtpmail-async
  :ensure nil
  :autoload async-smtpmail-send-it
  :init (setq message-send-mail-function 'async-smtpmail-send-it)
  )
----

>>> Also, I don't think it is necessary to configure all of these
>>> separately, at least in your case.
>>
>> Possibly true.  I can get around this by requiring the sub-libraries in
>> the :config section of async.  But that doesn't quite feel right,,, :(
>
> I'd question why you need to require the libraries in the first place.

The async package seems to have made the decision that, if you want to
do dired/smtpmail asynchronously, then require the sub-libraries.  I
thought I'd try it to see if I have a problem, but, since there are
cases where it might have a problem, I might turn it off again which I
could do with :disabled in the sub-library packages if it worked.

-- 
David Masterson



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

end of thread, other threads:[~2023-07-03  4:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-26 22:36 Sub-libaries in a package and use-package ? David Masterson
2023-06-27  6:03 ` Philip Kaludercic
2023-06-27 18:04   ` David Masterson
2023-06-27 19:01     ` Philip Kaludercic
2023-07-03  4:48       ` David Masterson

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.