From 887002c78bcc92965c4e1378c47a51c9c5c06fe9 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Sun, 5 Oct 2008 09:52:42 +1030 Subject: [PATCH] * wesnoth-mode.el: Require cl for decf, incf, multiple-value-bind and values (and probably some other useful things). (wesnoth-preprocessor-best-face): Really fix font-lock-keyword-face bug in GNU Emacs 21. (wesnoth-indent, wesnoth-determine-context): Use CL functions again. --- wesnoth-mode.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/wesnoth-mode.el b/wesnoth-mode.el index b29232f..1aa43c6 100644 --- a/wesnoth-mode.el +++ b/wesnoth-mode.el @@ -103,7 +103,9 @@ ;; * Added support for #ifndef. ;;; Code: -(defconst wesnoth-mode-version "1.2.5" +(require 'cl) + +(defconst wesnoth-mode-version "1.2.5a" "The current version of `wesnoth-mode'.") (defgroup wesnoth-mode nil "Wesnoth-mode access" @@ -197,9 +199,10 @@ level as their parent.") (defun wesnoth-preprocessor-best-face () "Use `font-lock-preprocessor-face' when available." - (if (and global-font-lock-mode (boundp 'font-lock-preprocessor-face)) - (copy-face 'font-lock-preprocessor-face 'wesnoth-preprocessor-face) - (copy-face 'font-lock-keyword-face 'wesnoth-preprocessor-face))) + (when global-font-lock-mode + (if (boundp 'font-lock-preprocessor-face) + (copy-face 'font-lock-preprocessor-face 'wesnoth-preprocessor-face) + (copy-face 'font-lock-keyword-face 'wesnoth-preprocessor-face)))) (defvar wesnoth-font-lock-keywords (list @@ -470,9 +473,8 @@ CONTEXT represents the type of element which precedes the current element." (beginning-of-line) (let ((cur-indent 0)) (unless (first-column-indent-p (point)) - (let* ((ref-con (wesnoth-determine-context (point))) - (context (car ref-con)) - (ref-indent (cadr ref-con))) + (multiple-value-bind (context ref-indent) + (wesnoth-determine-context (point)) (cond ((eq context 'opening) (if (or (and wesnoth-indent-savefile @@ -558,9 +560,9 @@ determine the context." (setq match "")) (cond ((string-match "\\[/\\|#enddef" match) - (list 'closing (current-indentation))) + (values 'closing (current-indentation))) ((string-match "\\[[^/]?\\|#define" match) - (list 'opening (current-indentation))))))) + (values 'opening (current-indentation))))))) (defun wesnoth-newline-and-indent (&optional indent) "Indent both the current line and the newline created. -- 2.11.4.GIT