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

Sean Whitton spwhitton at spwhitton.name
Tue Dec 13 18:23:43 UTC 2016


Hello Dmitry,

You CCed your message to <submit at bugs.debian.org> instead of
<847690 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-emacsen-addons/attachments/20161213/9678d200/attachment-0001.sig>


More information about the Pkg-emacsen-addons mailing list