;; GNU Emacs 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, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
(and (eq (car args) :@) (null msg) ; (:@ ...spliced...)
(setq args (cdr args)
msg "(:@ ....) must return exactly one element"))
- (let ((ignore (if (string-match "XEmacs" emacs-version) :EMACS :XEMACS))
+ (let ((ignore (if (featurep 'xemacs) :EMACS :XEMACS))
(mode :BOTH) code)
(while (consp args)
(if (memq (car args) '(:EMACS :XEMACS :BOTH)) (setq mode (pop args)))
;; existing functions when they are `fboundp', provide shortcuts if they are
;; known to be defined in a specific Emacs branch (for short .elc)
(defmacro defunx (name arglist &rest definition)
- (let ((xemacsp (string-match "XEmacs" emacs-version)) reuses)
+ (let ((xemacsp (featurep 'xemacs)) reuses)
(while (memq (car definition)
'(:try :emacs-and-try :xemacs-and-try))
(if (eq (pop definition) (if xemacsp :xemacs-and-try :emacs-and-try))
(defmacro ignore-errors-x (&rest body)
(let ((specials '((scan-sexps . 4) (scan-lists . 5)))
spec nils)
- (if (and (string-match "XEmacs" emacs-version)
+ (if (and (featurep 'xemacs)
(null (cdr body)) (consp (car body))
(setq spec (assq (caar body) specials))
(>= (setq nils (- (cdr spec) (length (car body)))) 0))
`(let ((,modified (buffer-modified-p)))
(unwind-protect
(let ((buffer-undo-list t) (inhibit-read-only t)
- ,@(unless (string-match "XEmacs" emacs-version)
+ ,@(unless (featurep 'xemacs)
'((inhibit-point-motion-hooks t) deactivate-mark))
before-change-functions after-change-functions
buffer-file-name buffer-file-truename)
general value, or `antlr-read-boolean' with ARGs = \(PROMPT TABLE) which
reads a boolean value or a member of TABLE. PROMPT is the prompt when
asking for a new value. If non-nil, TABLE is a table for completion or
-a function evaluating to such a table. The return value is quoted iff
+a function evaluating to such a table. The return value is quoted if
AS-STRING is non-nil and is either t or a symbol which is a member of
`antlr-options-style'.")
(defface antlr-keyword
(cond-emacs-xemacs
'((((class color) (background light))
- (:foreground "black" :EMACS :weight bold :XEMACS :bold t))))
+ (:foreground "black" :EMACS :weight bold :XEMACS :bold t))
+ (t :inherit font-lock-keyword-face)))
"ANTLR keywords."
:group 'antlr)
;; backward-compatibility alias
(defface antlr-syntax
(cond-emacs-xemacs
'((((class color) (background light))
- (:foreground "black" :EMACS :weight bold :XEMACS :bold t))))
+ (:foreground "black" :EMACS :weight bold :XEMACS :bold t))
+ (t :inherit font-lock-constant-face)))
"ANTLR syntax symbols like :, |, (, ), ...."
:group 'antlr)
;; backward-compatibility alias
(defface antlr-ruledef
(cond-emacs-xemacs
'((((class color) (background light))
- (:foreground "blue" :EMACS :weight bold :XEMACS :bold t))))
+ (:foreground "blue" :EMACS :weight bold :XEMACS :bold t))
+ (t :inherit font-lock-function-name-face)))
"ANTLR rule references (definition)."
:group 'antlr)
;; backward-compatibility alias
(defface antlr-tokendef
(cond-emacs-xemacs
'((((class color) (background light))
- (:foreground "blue" :EMACS :weight bold :XEMACS :bold t))))
+ (:foreground "blue" :EMACS :weight bold :XEMACS :bold t))
+ (t :inherit font-lock-function-name-face)))
"ANTLR token references (definition)."
:group 'antlr)
;; backward-compatibility alias
(defvar antlr-ruleref-face 'antlr-ruleref)
(defface antlr-ruleref
- '((((class color) (background light)) (:foreground "blue4")))
+ '((((class color) (background light)) (:foreground "blue4"))
+ (t :inherit font-lock-type-face))
"ANTLR rule references (usage)."
:group 'antlr)
;; backward-compatibility alias
(defvar antlr-tokenref-face 'antlr-tokenref)
(defface antlr-tokenref
- '((((class color) (background light)) (:foreground "orange4")))
+ '((((class color) (background light)) (:foreground "orange4"))
+ (t :inherit font-lock-type-face))
"ANTLR token references (usage)."
:group 'antlr)
;; backward-compatibility alias
(defface antlr-literal
(cond-emacs-xemacs
'((((class color) (background light))
- (:foreground "brown4" :EMACS :weight bold :XEMACS :bold t))))
+ (:foreground "brown4" :EMACS :weight bold :XEMACS :bold t))
+ (t :inherit font-lock-string-face)))
"ANTLR special literal tokens.
It is used to highlight strings matched by the first regexp group of
`antlr-font-lock-literal-regexp'."
(read initial)
initial))
(cdr value))))
- (message (cadr value))
+ (message "%s" (or (cadr value) ""))
(setq value nil)))
;; insert value ----------------------------------------------------------
(if (consp old)
part \(CLASS-SPEC ...) in the result of `antlr-directory-dependencies'.
The result looks like \(OPTION WITH-UNKNOWN GLIB ...). OPTION is the
-complete \"-glib\" option. WITH-UNKNOWN has value t iff there is none
-or more than one grammar file for at least one super grammar.
+complete \"-glib\" option. WITH-UNKNOWN is t if there is none or more
+than one grammar file for at least one super grammar.
Each GLIB looks like \(GRAMMAR-FILE \. EVOCAB). GRAMMAR-FILE is a file
in which a super-grammar is defined. EVOCAB is the value of the export