From d2afae7e18e7c4815adf14ac18eb41b9a85ad2a9 Mon Sep 17 00:00:00 2001 From: Modestas Vainius Date: Sun, 3 Nov 2013 16:21:39 +0200 Subject: [PATCH] Add compiled cmake-mode.elc to load-path and do not barf when cmake-data was removed. Thanks to Kevin Ryde. Closes: #710573 --- debian/changelog | 3 +++ debian/cmake-data.emacsen-startup | 17 +++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2c93610b7..3b7b17478 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ cmake (2.8.12-0r1) UNRELEASED; urgency=low (Closes: #716798) * Follow emacsen policy 5C and link cmake-mode.el source file next to compiled one. Thanks to Kevin Ryde. (Closes: #710570) + * Add compiled cmake-mode.elc to load-path and do not barf in emacs if + cmake-data was removed but not purged. Thanks to Kevin Ryde. + (Closes: #710573) -- Modestas Vainius Sun, 03 Nov 2013 12:28:06 +0200 diff --git a/debian/cmake-data.emacsen-startup b/debian/cmake-data.emacsen-startup index fe223233a..96fa7bab1 100644 --- a/debian/cmake-data.emacsen-startup +++ b/debian/cmake-data.emacsen-startup @@ -2,9 +2,14 @@ ;; ;; Emacs startup file for the Debian GNU/Linux cmake package -(autoload 'cmake-mode "cmake-mode") - -(setq auto-mode-alist - (append '(("CMakeLists\\.txt\\'" . cmake-mode) - ("\\.cmake\\'" . cmake-mode)) - auto-mode-alist)) +(if (file-exists-p "/usr/share/emacs/site-lisp/cmake-mode.el") + (progn + (debian-pkg-add-load-path-item (concat "/usr/share/" + (symbol-name debian-emacs-flavor) + "/site-lisp/cmake-data")) + (autoload 'cmake-mode "cmake-mode") + (setq auto-mode-alist + (append '(("CMakeLists\\.txt\\'" . cmake-mode) + ("\\.cmake\\'" . cmake-mode)) + auto-mode-alist))) + (message "cmake-data removed but not purged, skipping setup"))