On Wed, May 16, 2012 at 08:54:11AM +1000, Kevin Ryde wrote: > Alessandro Ghedini <[email protected]> writes: > > > >> ... > >> (add-to-list 'auto-mode-alist '("\\.ewf\\'" . ecasound-ewf-mode)) > > > > Is this correct? > > Pretty close. > > It's good to wrap it all in a package-dir existence check like that > haml-elisp bit, because with "dpkg --remove" the /etc startup file is > left behind but the rest of the package is gone. This is important for > an auto-mode-alist entry since if the ecasound.el is gone then visiting > a .ewf would get an error, where you'd prefer left as fundamental-mode > or whatever. > > ;; If package-dir does not exist, the haml-mode package must have > ;; removed but not purged, and we should skip the setup. > (when (file-directory-p package-dir) > (autoload ...) > (auto-mode-alist ...)) > > I don't know how often anyone uses dpkg --remove on lisp packages. > Perhaps by mistake when --purge was intended :-).
Sounds reasonable, what about the following?
> (let ((package-dir (concat "/usr/share/"
> (symbol-name debian-emacs-flavor)
> "/site-lisp/ecasound-el")))
>
> (debian-pkg-add-load-path-item package-dir)
>
> (autoload 'ecasound "ecasound"
> "Run an inferior ecasound, with I/O through BUFFER." t)
> (autoload 'ecasound-ewf-mode "ecasound"
> "A major mode for editing ecasound .ewf files." t)
>
> (add-to-list 'auto-mode-alist '("\\.ewf\\'" . ecasound-ewf-mode)))
Cheers
--
perl -E '$_=q;$/= @{[@_]};and s;\S+;<inidehG ordnasselA>;eg;say~~reverse'
signature.asc
Description: Digital signature

