From 83d0d94a1a8e0d83519c6235ff61640a47ca3a14 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Fri, 22 Jul 2011 20:31:17 +0200 Subject: [PATCH] scel: bytecompile fix, correct use of defvar and defconst and add requirements Signed-off-by: Tim Blechmann --- el/sclang-dev.el | 22 ++++++++++++++++++++++ el/sclang-keys.el | 5 +++-- el/sclang-minor-mode.el | 5 +++++ el/sclang-mode.el | 13 +++++++------ el/sclang-server.el | 8 ++++++-- el/sclang-widgets.el | 2 ++ 6 files changed, 45 insertions(+), 10 deletions(-) diff --git a/el/sclang-dev.el b/el/sclang-dev.el index 6deabea..b7e852a 100644 --- a/el/sclang-dev.el +++ b/el/sclang-dev.el @@ -1,3 +1,25 @@ +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2 of the +;; License, or (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program; if not, write to the Free Software +;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +;; USA + + +(eval-when-compile + (require 'sclang-interp) + ) + + + (sclang-set-command-handler 'openDevSource (lambda (file) diff --git a/el/sclang-keys.el b/el/sclang-keys.el index e159373..1acee63 100644 --- a/el/sclang-keys.el +++ b/el/sclang-keys.el @@ -25,7 +25,8 @@ ;; (defun sclang-execute-key (char) ;; (sclang-eval-string (sclang-format "Emacs.executeKey(%o)" char))) -(require 'sclang-interp) +(eval-and-compile (require 'sclang-util) + (require 'sclang-interp)) (defun sclang-read-keys () (interactive) @@ -34,7 +35,7 @@ (while t (setq char (read-event)) (clear-this-command-keys) - (when (char-valid-p char) + (when (characterp char) (message "%s (%d)" (char-to-string char) char) (sclang-eval-string (format "Emacs.keys.at(%d).value(%d)" char char)))))) diff --git a/el/sclang-minor-mode.el b/el/sclang-minor-mode.el index 047ec38..23fd70b 100644 --- a/el/sclang-minor-mode.el +++ b/el/sclang-minor-mode.el @@ -16,6 +16,11 @@ ;;; along with this program; if not, write to the Free Software ;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +(eval-when-compile + (require 'sclang-mode) + ) + + (easy-mmode-define-minor-mode sclang-minor-mode "Toggle sclang-minor-mode. With no argument, this command toggles the mode. diff --git a/el/sclang-mode.el b/el/sclang-mode.el index 0537e71..688a0f8 100644 --- a/el/sclang-mode.el +++ b/el/sclang-mode.el @@ -18,7 +18,8 @@ (eval-when-compile (require 'cl) (load "cl-seq" nil t) - (require 'font-lock)) + (require 'font-lock) + (require 'sclang-util)) (require 'sclang-interp) (require 'sclang-language) @@ -154,7 +155,7 @@ ;; font-lock support ;; ===================================================================== -(defvar sclang-font-lock-keyword-list +(defconst sclang-font-lock-keyword-list '( "arg" "classvar" @@ -170,7 +171,7 @@ ) "*List of keywords to highlight in SCLang mode.") -(defvar sclang-font-lock-builtin-list +(defconst sclang-font-lock-builtin-list '( "false" "inf" @@ -179,7 +180,7 @@ ) "*List of builtins to highlight in SCLang mode.") -(defvar sclang-font-lock-method-list +(defconst sclang-font-lock-method-list '( "ar" "for" @@ -193,7 +194,7 @@ ) "*List of methods to highlight in SCLang mode.") -(defvar sclang-font-lock-error-list +(defconst sclang-font-lock-error-list '( "die" "error" @@ -215,7 +216,7 @@ (defvar sclang-font-lock-keywords-3 nil "Gaudy level highlighting for SCLang mode.") -(defconst sclang-font-lock-keywords nil +(defvar sclang-font-lock-keywords nil "Default expressions to highlight in SCLang mode.") (defconst sclang-font-lock-defaults '((sclang-font-lock-keywords diff --git a/el/sclang-server.el b/el/sclang-server.el index 533460b..9502875 100644 --- a/el/sclang-server.el +++ b/el/sclang-server.el @@ -15,8 +15,12 @@ ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ;; USA -(eval-and-compile - (require 'cl)) +(eval-when-compile + (require 'cl) + (require 'sclang-util) + (require 'sclang-interp) + (require 'sclang-language) + (require 'sclang-mode)) (defcustom sclang-server-panel "Server.default.makeWindow" "*Expression to execute when `sclang-show-server-panel' is invoked." diff --git a/el/sclang-widgets.el b/el/sclang-widgets.el index c127f0a..1e78605 100644 --- a/el/sclang-widgets.el +++ b/el/sclang-widgets.el @@ -26,6 +26,8 @@ ;;; Code: +(eval-when-compile (require 'sclang-util) + (require 'sclang-language)) (eval-and-compile (require 'sclang-interp)) (defvar sclang-widgets nil)