tags 550688 patch
thanks

This bug can be solved by a simple modification of emacs package startup
file. I got the idea how to do this from the easypg package I recently
was working on. The startup file remains if the package was removed (but
not purged), but the elisp sources and byte-compiled files are deleted.

Attached is a patch against the source package, which modifies
emacsen-startup to only load this packages it's elisp sources are still
available (which means the package is fully installed). This handles the
case of the package being removed but not purged.

Regards,
Ralf

diff -ubr -x changelog inform-mode-1.5.8.org/debian/emacsen-startup inform-mode-1.5.8/debian/emacsen-startup
--- inform-mode-1.5.8.org/debian/emacsen-startup	2009-10-12 17:50:09.000000000 +0000
+++ inform-mode-1.5.8/debian/emacsen-startup	2009-10-12 17:56:16.000000000 +0000
@@ -5,21 +5,27 @@
 ;; Originally contributed by Nils Naumann <naum...@unileoben.ac.at>
 ;; Modified by Dirk Eddelbuettel <e...@debian.org>
 ;; Adapted for dh-make by Jim Van Zandt <j...@vanzandt.mv.com>
+;; 
+;; Ralf Doering <rdoer...@netsys-it.de>:
+;; Handle removed but not purged package, idea taken from easypg package.
 
 ;; The inform-mode package follows the Debian/GNU Linux 'emacsen' policy and
 ;; byte-compiles its elisp files for each 'emacs flavor' (emacs19,
 ;; xemacs19, emacs20, xemacs20...).  The compiled code is then
 ;; installed in a subdirectory of the respective site-lisp directory.
 ;; We have to add this to the load-path:
-(setq load-path (nconc load-path (list (concat "/usr/share/"
+
+(if (not (file-exists-p "/usr/share/emacs/site-lisp/inform-mode"))
+    (message "Package inform-mode removed but not purged.  Skipping setup.")
+  (setq load-path (nconc load-path (list (concat "/usr/share/"
                                                (symbol-name flavor)
                                                "/site-lisp/inform-mode"))))
 
-(autoload 'inform-mode "inform-mode" "Inform editing mode." t)
-(autoload 'inform-maybe-mode "inform-mode" "Inform/C header editing mode.")
-(setq auto-mode-alist
+  (autoload 'inform-mode "inform-mode" "Inform editing mode." t)
+  (autoload 'inform-maybe-mode "inform-mode" "Inform/C header editing mode.")
+  (setq auto-mode-alist
       (append '(("\\.h\\'"   . inform-maybe-mode)
                 ("\\.inf\\'" . inform-mode))
                auto-mode-alist))
 
-(add-hook 'inform-mode-hook 'turn-on-font-lock)
+  (add-hook 'inform-mode-hook 'turn-on-font-lock))

Reply via email to