comparison lisp/progmodes/cc-defs.el @ 21112:b113342cb7ad

(c-emacs-features): Var moved to cc-vars.el.
author Richard M. Stallman <rms@gnu.org>
date Sun, 08 Mar 1998 06:55:27 +0000
parents c7ee864ae985
children 5b0864259a4b
comparison
equal deleted inserted replaced
21111:dad4e4facdc0 21112:b113342cb7ad
1 ;;; cc-defs.el --- definitions for CC Mode 1 ;;; cc-defs.el --- compile time definitions for CC Mode
2 2
3 ;; Copyright (C) 1985,87,92,93,94,95,96,97,98 Free Software Foundation, Inc. 3 ;; Copyright (C) 1985,87,92,93,94,95,96,97,98 Free Software Foundation, Inc.
4 4
5 ;; Authors: 1992-1997 Barry A. Warsaw 5 ;; Authors: 1992-1997 Barry A. Warsaw
6 ;; 1987 Dave Detlefs and Stewart Clamen 6 ;; 1987 Dave Detlefs and Stewart Clamen
24 24
25 ;; You should have received a copy of the GNU General Public License 25 ;; You should have received a copy of the GNU General Public License
26 ;; along with GNU Emacs; see the file COPYING. If not, write to the 26 ;; along with GNU Emacs; see the file COPYING. If not, write to the
27 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 27 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28 ;; Boston, MA 02111-1307, USA. 28 ;; Boston, MA 02111-1307, USA.
29
30
31 ;; Figure out what features this Emacs has
32 ;;;###autoload
33 (defconst c-emacs-features
34 (let ((infodock-p (boundp 'infodock-version))
35 (comments
36 ;; XEmacs 19 and beyond use 8-bit modify-syntax-entry flags.
37 ;; Emacs 19 uses a 1-bit flag. We will have to set up our
38 ;; syntax tables differently to handle this.
39 (let ((table (copy-syntax-table))
40 entry)
41 (modify-syntax-entry ?a ". 12345678" table)
42 (cond
43 ;; XEmacs 19, and beyond Emacs 19.34
44 ((arrayp table)
45 (setq entry (aref table ?a))
46 ;; In Emacs, table entries are cons cells
47 (if (consp entry) (setq entry (car entry))))
48 ;; XEmacs 20
49 ((fboundp 'get-char-table) (setq entry (get-char-table ?a table)))
50 ;; before and including Emacs 19.34
51 ((and (fboundp 'char-table-p)
52 (char-table-p table))
53 (setq entry (car (char-table-range table [?a]))))
54 ;; incompatible
55 (t (error "CC Mode is incompatible with this version of Emacs")))
56 (if (= (logand (lsh entry -16) 255) 255)
57 '8-bit
58 '1-bit))))
59 (if infodock-p
60 (list comments 'infodock)
61 (list comments)))
62 "A list of features extant in the Emacs you are using.
63 There are many flavors of Emacs out there, each with different
64 features supporting those needed by CC Mode. Here's the current
65 supported list, along with the values for this variable:
66
67 XEmacs 19: (8-bit)
68 XEmacs 20: (8-bit)
69 Emacs 19: (1-bit)
70
71 Infodock (based on XEmacs) has an additional symbol on this list:
72 'infodock.")
73
74 29
75 30
76 (defsubst c-point (position) 31 (defsubst c-point (position)
77 ;; Returns the value of point at certain commonly referenced POSITIONs. 32 ;; Returns the value of point at certain commonly referenced POSITIONs.
78 ;; POSITION can be one of the following symbols: 33 ;; POSITION can be one of the following symbols: