Author: fendrin
Date: Thu Oct  9 23:50:19 2008
New Revision: 29994

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29994&view=rev
Log:
new version of the emacs wesnoth mode

Modified:
    trunk/data/tools/wesnoth-mode.el

Modified: trunk/data/tools/wesnoth-mode.el
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wesnoth-mode.el?rev=29994&r1=29993&r2=29994&view=diff
==============================================================================
--- trunk/data/tools/wesnoth-mode.el (original)
+++ trunk/data/tools/wesnoth-mode.el Thu Oct  9 23:50:19 2008
@@ -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"
@@ -115,14 +117,12 @@
   :type 'boolean
   :group 'wesnoth-mode)
 
-(defcustom wesnoth-indent-default-style t
+(defcustom wesnoth-indent-savefile t
   "Non-nil means to use the current indentation conventions.
 If nil, use the old convention for indentation.
 The current convention is all attributes are indented a level deeper
 than their parent; in the past attributes were indented to the same
 level as their parent.")
-
-(defvaralias 'wesnoth-indent-savefile 'wesnoth-indent-default-style)
 
 (defcustom wesnoth-base-indent 4
   "The number of columns to indent WML."
@@ -199,9 +199,10 @@
 
 (defun wesnoth-preprocessor-best-face ()
   "Use `font-lock-preprocessor-face' when available."
-  (if (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
@@ -476,14 +477,14 @@
          (wesnoth-determine-context (point))
        (cond
         ((eq context 'opening)
-         (if (or (and wesnoth-indent-default-style
+         (if (or (and wesnoth-indent-savefile
                       (not (looking-at wesnoth-element-closing)))
                  (looking-at wesnoth-element-opening))
              (setq cur-indent (+ ref-indent wesnoth-base-indent))
            (setq cur-indent ref-indent)))
         ((eq context 'closing)
          (if (or (looking-at "^[\t ]*\\[/")
-                 (and (not wesnoth-indent-default-style)
+                 (and (not wesnoth-indent-savefile)
                       (not (looking-at wesnoth-element-opening))))
              (setq cur-indent (- ref-indent wesnoth-base-indent))
            (setq cur-indent ref-indent))))))


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to