Bug#847690: [Pkg-emacsen-addons] Bug#847690: dh-elpa: better handling of `deftheme' themes

2019-12-02 Thread Sean Whitton
Hello,

On Sat 10 Dec 2016 at 09:40AM -07, Sean Whitton wrote:

> Function autoloads are handled elegantly by dh-elpa.  After installing a
> package, you can just put (turn-on-some-global-minor-mode) in your
> ~/.emacs, and everything works fine.
>
> Themes defined with `deftheme' don't work so well.  After installing a
> theme, a simple call to `load-theme' in your ~/.emacs will fail.
>
> Two possible workarounds are:
>
> (package-initialize)
> (load-theme 'zenburn t)
>
> or
>
> (add-hook 'after-init-hook (lambda () (load-theme 'zenburn)))
>
> but this really shouldn't be necessary.

Hmm, I'm not sure, but perhaps this problem is not actually about
`deftheme' themes.  I think perhaps no dh_elpa package autoloads happen
until `package-initialize' is called.  That would make this a 'wontfix'.

-- 
Sean Whitton


signature.asc
Description: PGP signature


Bug#847690: dh-elpa: better handling of `deftheme' themes

2016-12-14 Thread Dmitry Bogatov

[2016-12-13 11:23] Sean Whitton 
>
> part 1 text/plain1709
> Hello Dmitry,
>
> You CCed your message to  instead of
> <847...@bugs.debian.org>.  I've resent it for you.  Please check To,Cc
> carefully!

Sorry. Will make some automatic check one day.

> On Tue, Dec 13, 2016 at 01:53:00PM +0300, Dmitry Bogatov wrote:
> > I see two actions we can perform to improve our situation.
> >
> >  1. Install README.Debian file by dh-elpa if we detect that package is
> > theme and no README.Debian is already provided. If README.Debian is
> > provided, we can grep it for 'package-initialize', to ensure that
> > it mentions this issue.
>
> As I said in another thread, I don't think we should implement code to
> merge a note into README.Debian when this is at best a temporary
> solution.  Too many edge cases.

Fine. I agree, that fixing limitation is better then documenting it.

> >  2. We can advice #'load-theme. Something like this:
> >  [...]
> Thank you very much for this code snippet.  dh_elpa could add it to the
> emacsen-startup script for a theme package.  I'll look into implementing
> this towards the end of this month.

Ok.

-- 
X-Web-Site: https://sinsekvu.github.io | Note that I process my email in batch,
Accept-Languages: eo,ru,en | at most once every 24 hours. If matter
Accept: text/plain, text/x-diff| is urgent, you have my phone number.


pgpYx2wbn1uUc.pgp
Description: PGP signature


Bug#847690: dh-elpa: better handling of `deftheme' themes

2016-12-13 Thread Sean Whitton
Hello Dmitry,

You CCed your message to  instead of
<847...@bugs.debian.org>.  I've resent it for you.  Please check To,Cc
carefully!

On Tue, Dec 13, 2016 at 01:53:00PM +0300, Dmitry Bogatov wrote:
> I see two actions we can perform to improve our situation.
> 
>  1. Install README.Debian file by dh-elpa if we detect that package is
> theme and no README.Debian is already provided. If README.Debian is
> provided, we can grep it for 'package-initialize', to ensure that
> it mentions this issue.

As I said in another thread, I don't think we should implement code to
merge a note into README.Debian when this is at best a temporary
solution.  Too many edge cases.

>  2. We can advice #'load-theme. Something like this:
> 
>   ~~~elisp
>   (defadvice load-theme
>   (before load-theme-before-enabling (theme no-confirm no-enable))
> "Function autoloads are handled elegantly by dh-elpa.  After 
> installing a
>   package, you can just put (turn-on-some-global-minor-mode) in your
>   ~/.emacs, and everything works fine.
> 
>   Themes defined with `deftheme' don't work so well.  After installing a
>   theme, a simple call to `load-theme' in your ~/.emacs will fail. This 
> advice
>   'require's a feature, that correspond to theme to be loaded."
> (ignore-errors
>   (require (intern (format "%s-theme" theme)
>   ~~~
> 
> I know that advices are dangerous, but I believe that this one can
> not have any implications, beside negligible perfomance ones.

Thank you very much for this code snippet.  dh_elpa could add it to the
emacsen-startup script for a theme package.  I'll look into implementing
this towards the end of this month.

-- 
Sean Whitton


signature.asc
Description: PGP signature


Bug#847690: dh-elpa: better handling of `deftheme' themes

2016-12-13 Thread Dmitry Bogatov

[2016-12-10 09:40] Sean Whitton 
> Function autoloads are handled elegantly by dh-elpa.  After installing a
> package, you can just put (turn-on-some-global-minor-mode) in your
> ~/.emacs, and everything works fine.
>
> Themes defined with `deftheme' don't work so well.  After installing a
> theme, a simple call to `load-theme' in your ~/.emacs will fail.
>
> Two possible workarounds are:
>
> (package-initialize)
> (load-theme 'zenburn t)
>
> or
>
> (add-hook 'after-init-hook (lambda () (load-theme 'zenburn)))
>
> but this really shouldn't be necessary.  In short, ELPA packages
> supplying themes are currently second-class citizens in the elpa-*
> namespace.
>
> I'm filing this bug against dh-elpa for the time being, but there might
> not be any sane patch to dh-elpa that will resolve the issue.  The only
> solution might be to implement autoloads for defthemes upstream.
>
> If you are hitting this bug with your package, a sample README.Debian

Thank you for filing bug.

I see two actions we can perform to improve our situation.

 1. Install README.Debian file by dh-elpa if we detect that package is
theme and no README.Debian is already provided. If README.Debian is
provided, we can grep it for 'package-initialize', to ensure that
it mentions this issue.

 2. We can advice #'load-theme. Something like this:

~~~elisp
(defadvice load-theme
(before load-theme-before-enabling (theme no-confirm no-enable))
  "Function autoloads are handled elegantly by dh-elpa.  After 
installing a
package, you can just put (turn-on-some-global-minor-mode) in your
~/.emacs, and everything works fine.

Themes defined with `deftheme' don't work so well.  After installing a
theme, a simple call to `load-theme' in your ~/.emacs will fail. This 
advice
'require's a feature, that correspond to theme to be loaded."
  (ignore-errors
(require (intern (format "%s-theme" theme)
~~~

I know that advices are dangerous, but I believe that this one can
not have any implications, beside negligible perfomance ones.

--
X-Web-Site: https://sinsekvu.github.io | Note that I process my email in batch,
Accept-Languages: eo,ru,en | at most once every 24 hours. If matter
Accept: text/plain, text/x-diff| is urgent, you have my phone number.


pgpffv_nWD6FX.pgp
Description: PGP signature


Bug#847690: dh-elpa: better handling of `deftheme' themes

2016-12-10 Thread Sean Whitton
Package: dh-elpa
Version: 1.3
Severity: normal

Function autoloads are handled elegantly by dh-elpa.  After installing a
package, you can just put (turn-on-some-global-minor-mode) in your
~/.emacs, and everything works fine.

Themes defined with `deftheme' don't work so well.  After installing a
theme, a simple call to `load-theme' in your ~/.emacs will fail.

Two possible workarounds are:

(package-initialize)
(load-theme 'zenburn t)

or

(add-hook 'after-init-hook (lambda () (load-theme 'zenburn)))

but this really shouldn't be necessary.  In short, ELPA packages
supplying themes are currently second-class citizens in the elpa-*
namespace.

I'm filing this bug against dh-elpa for the time being, but there might
not be any sane patch to dh-elpa that will resolve the issue.  The only
solution might be to implement autoloads for defthemes upstream.

If you are hitting this bug with your package, a sample README.Debian
giving a workaround for users is available in src:zenburn-emacs.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (900, 'testing')
Architecture: i386 (i686)

Kernel: Linux 4.8.0-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dh-elpa depends on:
ii  debhelper   10.2.2
ii  dh-make-perl0.92
ii  emacs24 24.5+1-7
ii  libarray-utils-perl 0.5-1
ii  libconfig-tiny-perl 2.23-1
ii  libdebian-source-perl   0.92
ii  libdpkg-perl1.18.10
ii  libfile-find-rule-perl  0.34-1
ii  libtext-glob-perl   0.10-1
ii  perl5.24.1~rc4-1

dh-elpa recommends no packages.

dh-elpa suggests no packages.

-- no debconf information

-- 
Sean Whitton


signature.asc
Description: PGP signature