Package: nice
Version: 0.9.13-1
Severity: important
Tags: patch
In modernizing nice-mode to work with newer versions of CC Mode (as
included in Emacs 22 and XEmacs), its authors dropped support for
Emacs 21, breaking nice's installation on systems with that version
installed:
> Setting up nice (0.9.13-1) ...
> install/nice: Handling install for emacsen flavor emacs21
[...]
> While compiling toplevel forms in file
> /usr/share/emacs21/site-lisp/nice/nice-mode.el:
> !! File error (("Cannot open load file" "cc-fonts"))
> Wrote /usr/share/emacs21/site-lisp/nice/nice-startup.elc
> Done
> emacs-package-install: /usr/lib/emacsen-common/packages/install/nice emacs21
> emacs21 emacs22 xemacs21 failed at
> /usr/lib/emacsen-common/emacs-package-install line 30, <TSORT> line 1.
> dpkg: error processing nice (--configure):
> subprocess post-installation script returned error exit status 1
Please apply the attached patch, which allows nice-mode to work with
either version AFAICT.
BTW, I would also advise enabling the commented-out FLAVORTEST /
SITEFLAG logic, as there is no need to load other packages' Emacs
startup files (the [...] above) prior to compiling nice's elisp code.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.22.10 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash
Versions of packages nice depends on:
ii blackdown-j2sdk1.4 [java2-run 1.4.2+02 Java(TM) 2 SDK, Standard Edition,
ii gij [java-virtual-machine] 4:4.2.1-6 The GNU Java bytecode interpreter
ii gij-4.0 [java1-runtime] 4.0.3-2 The GNU Java bytecode interpreter
ii gij-4.1 [java1-runtime] 4.1.2-16 The GNU Java bytecode interpreter
ii gij-4.2 [java1-runtime] 4.2.2-3 The GNU Java bytecode interpreter
ii jamvm [java1-runtime] 1.4.5-3+b1 virtual machine which conforms to
ii kaffe 2:1.1.8-3 A JVM to run Java bytecode
ii kaffe-pthreads [kaffe] 2:1.1.8-3 A POSIX threads enabled version of
ii sablevm [java1-runtime] 1.13-1.1 Free implementation of Java Virtua
ii sun-java5-jre [java1-runtime] 1.5.0-13-1 Sun Java(TM) Runtime Environment (
ii sun-java6-jre [java1-runtime] 6-03-2 Sun Java(TM) Runtime Environment (
nice recommends no packages.
-- no debconf information
--- tmp/nice-mode-0.9.12.el 2007-12-03 16:04:35.000000000 -0500
+++ tmp/nice-mode.el 2007-12-03 16:10:27.000000000 -0500
@@ -4,20 +4,22 @@
;;;
;;; Based on Jazz mode ([EMAIL PROTECTED])
;;; Adaptation to Nice by Daniel Bonniot ([EMAIL PROTECTED])
+;;;
+;;; Update for recent versions of Emacs based on:
+;;; http://cc-mode.sourceforge.net/derived-mode-ex.el
;;;
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(require 'cc-vars)
-(require 'cc-engine)
(require 'cc-mode)
-(require 'cc-cmds)
-(require 'cc-align)
-(require 'cc-styles)
-(require 'cc-defs)
-(require 'cc-menus)
-(require 'cc-defs)
-(require 'cc-langs)
+
+(eval-when-compile
+ (require 'cc-langs)
+ (require 'cc-fonts nil t))
+
+(eval-and-compile
+ (if (fboundp 'c-add-language)
+ (c-add-language 'nice-mode 'java-mode)))
(require 'compile)
@@ -385,14 +387,21 @@
nice-link-declaration-face Face used to highlight declaration links"
(interactive)
- (c-initialize-cc-mode)
+ (if (not (fboundp 'c-init-language-vars))
+ (c-initialize-cc-mode))
(kill-all-local-variables)
+ (if (fboundp 'c-init-language-vars)
+ (c-initialize-cc-mode t))
(set-syntax-table nice-mode-syntax-table)
(setq major-mode 'nice-mode
mode-name "Nice"
local-abbrev-table java-mode-abbrev-table)
(use-local-map nice-mode-map)
- (c-common-init)
+ (if (fboundp 'c-init-language-vars)
+ (progn
+ (c-init-language-vars nice-mode)
+ (c-common-init 'nice-mode))
+ (c-common-init))
(setq comment-start "// "
comment-end ""
c-conditional-key c-Nice-conditional-key
@@ -466,6 +475,7 @@
((nice-file-p name)
(nice-rename-buffer (file-name-nondirectory
(substring name 0 (- (length name) (length
nice-extension))))))))))
+ (run-hooks 'c-mode-common-hook)
(run-hooks 'nice-mode-hook)
(c-update-modeline))