scel: bytecompile fix, correct use of defvar and defconst and add requirements

Signed-off-by: Tim Blechmann <tim@klingt.org>
This commit is contained in:
Tim Blechmann 2011-07-22 20:31:17 +02:00
parent 5aa9b34534
commit 83d0d94a1a
6 changed files with 45 additions and 10 deletions

View file

@ -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 (sclang-set-command-handler
'openDevSource 'openDevSource
(lambda (file) (lambda (file)

View file

@ -25,7 +25,8 @@
;; (defun sclang-execute-key (char) ;; (defun sclang-execute-key (char)
;; (sclang-eval-string (sclang-format "Emacs.executeKey(%o)" 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 () (defun sclang-read-keys ()
(interactive) (interactive)
@ -34,7 +35,7 @@
(while t (while t
(setq char (read-event)) (setq char (read-event))
(clear-this-command-keys) (clear-this-command-keys)
(when (char-valid-p char) (when (characterp char)
(message "%s (%d)" (char-to-string char) char) (message "%s (%d)" (char-to-string char) char)
(sclang-eval-string (format "Emacs.keys.at(%d).value(%d)" char char)))))) (sclang-eval-string (format "Emacs.keys.at(%d).value(%d)" char char))))))

View file

@ -16,6 +16,11 @@
;;; along with this program; if not, write to the Free Software ;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;;; 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 (easy-mmode-define-minor-mode sclang-minor-mode
"Toggle sclang-minor-mode. "Toggle sclang-minor-mode.
With no argument, this command toggles the mode. With no argument, this command toggles the mode.

View file

@ -18,7 +18,8 @@
(eval-when-compile (eval-when-compile
(require 'cl) (require 'cl)
(load "cl-seq" nil t) (load "cl-seq" nil t)
(require 'font-lock)) (require 'font-lock)
(require 'sclang-util))
(require 'sclang-interp) (require 'sclang-interp)
(require 'sclang-language) (require 'sclang-language)
@ -154,7 +155,7 @@
;; font-lock support ;; font-lock support
;; ===================================================================== ;; =====================================================================
(defvar sclang-font-lock-keyword-list (defconst sclang-font-lock-keyword-list
'( '(
"arg" "arg"
"classvar" "classvar"
@ -170,7 +171,7 @@
) )
"*List of keywords to highlight in SCLang mode.") "*List of keywords to highlight in SCLang mode.")
(defvar sclang-font-lock-builtin-list (defconst sclang-font-lock-builtin-list
'( '(
"false" "false"
"inf" "inf"
@ -179,7 +180,7 @@
) )
"*List of builtins to highlight in SCLang mode.") "*List of builtins to highlight in SCLang mode.")
(defvar sclang-font-lock-method-list (defconst sclang-font-lock-method-list
'( '(
"ar" "ar"
"for" "for"
@ -193,7 +194,7 @@
) )
"*List of methods to highlight in SCLang mode.") "*List of methods to highlight in SCLang mode.")
(defvar sclang-font-lock-error-list (defconst sclang-font-lock-error-list
'( '(
"die" "die"
"error" "error"
@ -215,7 +216,7 @@
(defvar sclang-font-lock-keywords-3 nil (defvar sclang-font-lock-keywords-3 nil
"Gaudy level highlighting for SCLang mode.") "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.") "Default expressions to highlight in SCLang mode.")
(defconst sclang-font-lock-defaults '((sclang-font-lock-keywords (defconst sclang-font-lock-defaults '((sclang-font-lock-keywords

View file

@ -15,8 +15,12 @@
;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
;; USA ;; USA
(eval-and-compile (eval-when-compile
(require 'cl)) (require 'cl)
(require 'sclang-util)
(require 'sclang-interp)
(require 'sclang-language)
(require 'sclang-mode))
(defcustom sclang-server-panel "Server.default.makeWindow" (defcustom sclang-server-panel "Server.default.makeWindow"
"*Expression to execute when `sclang-show-server-panel' is invoked." "*Expression to execute when `sclang-show-server-panel' is invoked."

View file

@ -26,6 +26,8 @@
;;; Code: ;;; Code:
(eval-when-compile (require 'sclang-util)
(require 'sclang-language))
(eval-and-compile (require 'sclang-interp)) (eval-and-compile (require 'sclang-interp))
(defvar sclang-widgets nil) (defvar sclang-widgets nil)