aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ.D. Smith2002-09-13 22:19:48 +0000
committerJ.D. Smith2002-09-13 22:19:48 +0000
commitfacebc7bbb941af0ba03f4ba807027a7c9d79b1a (patch)
tree53fef1e8757822dd32160d9e826d57ad6be1964a
parent4e4e95198a1513ea23b45f2b747fcecaaf4fa06a (diff)
downloademacs-facebc7bbb941af0ba03f4ba807027a7c9d79b1a.tar.gz
emacs-facebc7bbb941af0ba03f4ba807027a7c9d79b1a.zip
From Stefan Monnier
Add a \ in front of open-paren-in-column-0 in docstrings. Otherwise indentation and font-lock get confused. (idlwave-function-menu): Use defalias so the funs are called interactively. Don't rely on knowledge about which Emacs provides imenu or func-menu. (idlwave-calculate-cont-indent): Fix typo. (idlwave-font-lock-keywords-*): Don't use setq on a defconst. Remove unused variables.
-rw-r--r--lisp/progmodes/idlwave.el111
1 files changed, 37 insertions, 74 deletions
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index b9fcd83cb4f..84068e3c403 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -5,7 +5,7 @@
5;; Chris Chase <chase@att.com> 5;; Chris Chase <chase@att.com>
6;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu> 6;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
7;; Version: 4.15 7;; Version: 4.15
8;; Date: $Date: 2002/09/12 16:31:50 $ 8;; Date: $Date: 2002/09/12 16:59:24 $
9;; Keywords: languages 9;; Keywords: languages
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -360,7 +360,7 @@ scan, this is not necessary."
360Possible values: 360Possible values:
361nil Never 361nil Never
362t All available 362t All available
363(...) A list of circumstances. Allowed members are: 363\(...) A list of circumstances. Allowed members are:
364 find-file Add info for new IDLWAVE buffers. 364 find-file Add info for new IDLWAVE buffers.
365 save-buffer Update buffer info when buffer is saved 365 save-buffer Update buffer info when buffer is saved
366 kill-buffer Remove buffer info when buffer gets killed 366 kill-buffer Remove buffer info when buffer gets killed
@@ -686,7 +686,7 @@ doing this (well, three ways if you count the shell... see
686This variable allows you to configure IDLWAVE's method and 686This variable allows you to configure IDLWAVE's method and
687method-keyword completion behavior. Its value is an alist, which 687method-keyword completion behavior. Its value is an alist, which
688should contain at least two elements: (method-default . VALUE) and 688should contain at least two elements: (method-default . VALUE) and
689(keyword-default . VALUE), where VALUE is either t or nil. These 689\(keyword-default . VALUE), where VALUE is either t or nil. These
690specify if the class should be found during method and keyword 690specify if the class should be found during method and keyword
691completion, respectively. 691completion, respectively.
692 692
@@ -734,7 +734,7 @@ at point."
734(defcustom idlwave-class-arrow-face 'bold 734(defcustom idlwave-class-arrow-face 'bold
735 "*Face to highlight object operator arrows `->' which carry a class property. 735 "*Face to highlight object operator arrows `->' which carry a class property.
736When IDLWAVE stores a class name as text property on an object arrow 736When IDLWAVE stores a class name as text property on an object arrow
737(see variable `idlwave-store-inquired-class', it highlights the arrow 737\(see variable `idlwave-store-inquired-class', it highlights the arrow
738with this font in order to remind the user that this arrow is special." 738with this font in order to remind the user that this arrow is special."
739 :group 'idlwave-completion 739 :group 'idlwave-completion
740 :type 'symbol) 740 :type 'symbol)
@@ -1095,7 +1095,7 @@ IDL process is made."
1095 :type 'boolean) 1095 :type 'boolean)
1096 1096
1097(defcustom idlwave-default-font-lock-items 1097(defcustom idlwave-default-font-lock-items
1098 '(pros-and-functions batch-files idl-keywords label goto 1098 '(pros-and-functions batch-files idlwave-idl-keywords label goto
1099 common-blocks class-arrows) 1099 common-blocks class-arrows)
1100 "Items which should be fontified on the default fontification level 2. 1100 "Items which should be fontified on the default fontification level 2.
1101IDLWAVE defines 3 levels of fontification. Level 1 is very little, level 3 1101IDLWAVE defines 3 levels of fontification. Level 1 is very little, level 3
@@ -1105,7 +1105,7 @@ a list of symbols, the following symbols are allowed.
1105 1105
1106pros-and-functions Procedure and Function definitions 1106pros-and-functions Procedure and Function definitions
1107batch-files Batch Files 1107batch-files Batch Files
1108idl-keywords IDL Keywords 1108idlwave-idl-keywords IDL Keywords
1109label Statement Labels 1109label Statement Labels
1110goto Goto Statements 1110goto Goto Statements
1111common-blocks Common Blocks 1111common-blocks Common Blocks
@@ -1117,16 +1117,16 @@ class-arrows Object Arrows with class property"
1117 :type '(set 1117 :type '(set
1118 :inline t :greedy t 1118 :inline t :greedy t
1119 (const :tag "Procedure and Function definitions" pros-and-functions) 1119 (const :tag "Procedure and Function definitions" pros-and-functions)
1120 (const :tag "Batch Files" batch-files) 1120 (const :tag "Batch Files" batch-files)
1121 (const :tag "IDL Keywords (reserved words)" idl-keywords) 1121 (const :tag "IDL Keywords (reserved words)" idlwave-idl-keywords)
1122 (const :tag "Statement Labels" label) 1122 (const :tag "Statement Labels" label)
1123 (const :tag "Goto Statements" goto) 1123 (const :tag "Goto Statements" goto)
1124 (const :tag "Tags in Structure Definition" structtag) 1124 (const :tag "Tags in Structure Definition" structtag)
1125 (const :tag "Structure Name" structname) 1125 (const :tag "Structure Name" structname)
1126 (const :tag "Common Blocks" common-blocks) 1126 (const :tag "Common Blocks" common-blocks)
1127 (const :tag "Keyword Parameters" keyword-parameters) 1127 (const :tag "Keyword Parameters" keyword-parameters)
1128 (const :tag "System Variables" system-variables) 1128 (const :tag "System Variables" system-variables)
1129 (const :tag "FIXME: Warning" fixme) 1129 (const :tag "FIXME: Warning" fixme)
1130 (const :tag "Object Arrows with class property " class-arrows))) 1130 (const :tag "Object Arrows with class property " class-arrows)))
1131 1131
1132(defcustom idlwave-mode-hook nil 1132(defcustom idlwave-mode-hook nil
@@ -1155,15 +1155,6 @@ As a user, you should not set this to t.")
1155;;; Simon Marshall <simon@gnu.ai.mit.edu> 1155;;; Simon Marshall <simon@gnu.ai.mit.edu>
1156;;; and Carsten Dominik... 1156;;; and Carsten Dominik...
1157 1157
1158(defconst idlwave-font-lock-keywords-1 nil
1159 "Subdued level highlighting for IDLWAVE mode.")
1160
1161(defconst idlwave-font-lock-keywords-2 nil
1162 "Medium level highlighting for IDLWAVE mode.")
1163
1164(defconst idlwave-font-lock-keywords-3 nil
1165 "Gaudy level highlighting for IDLWAVE mode.")
1166
1167;; The following are the reserved words in IDL. Maybe we should 1158;; The following are the reserved words in IDL. Maybe we should
1168;; highlight some more stuff as well? 1159;; highlight some more stuff as well?
1169;; Procedure declarations. Fontify keyword plus procedure name. 1160;; Procedure declarations. Fontify keyword plus procedure name.
@@ -1191,13 +1182,7 @@ As a user, you should not set this to t.")
1191 ;; "\\)\\>"))) 1182 ;; "\\)\\>")))
1192 "\\<\\(and\\|b\\(egin\\|reak\\)\\|c\\(ase\\|o\\(mpile_opt\\|ntinue\\)\\)\\|do\\|e\\(lse\\|nd\\(case\\|else\\|for\\|if\\|rep\\|switch\\|while\\)?\\|q\\)\\|for\\(ward_function\\)?\\|g\\(oto\\|[et]\\)\\|i\\(f\\|nherits\\)\\|l[et]\\|mod\\|n\\(e\\|ot\\)\\|o\\(n_\\(error\\|ioerror\\)\\|[fr]\\)\\|re\\(peat\\|turn\\)\\|switch\\|then\\|until\\|while\\|xor\\)\\>") 1183 "\\<\\(and\\|b\\(egin\\|reak\\)\\|c\\(ase\\|o\\(mpile_opt\\|ntinue\\)\\)\\|do\\|e\\(lse\\|nd\\(case\\|else\\|for\\|if\\|rep\\|switch\\|while\\)?\\|q\\)\\|for\\(ward_function\\)?\\|g\\(oto\\|[et]\\)\\|i\\(f\\|nherits\\)\\|l[et]\\|mod\\|n\\(e\\|ot\\)\\|o\\(n_\\(error\\|ioerror\\)\\|[fr]\\)\\|re\\(peat\\|turn\\)\\|switch\\|then\\|until\\|while\\|xor\\)\\>")
1193 1184
1194(let* ((oldp (or (string-match "Lucid" emacs-version) 1185(let* (;; Procedure declarations. Fontify keyword plus procedure name.
1195 (not (boundp 'emacs-minor-version))
1196 (and (<= emacs-major-version 19)
1197 (<= emacs-minor-version 29))))
1198
1199 (idl-keywords idlwave-idl-keywords)
1200 ;; Procedure declarations. Fontify keyword plus procedure name.
1201 ;; Function declarations. Fontify keyword plus function name. 1186 ;; Function declarations. Fontify keyword plus function name.
1202 (pros-and-functions 1187 (pros-and-functions
1203 '("\\<\\(function\\|pro\\)\\>[ \t]+\\(\\sw+\\(::\\sw+\\)?\\)" 1188 '("\\<\\(function\\|pro\\)\\>[ \t]+\\(\\sw+\\(::\\sw+\\)?\\)"
@@ -1267,39 +1252,17 @@ As a user, you should not set this to t.")
1267 1252
1268 ;; Arrows with text property `idlwave-class' 1253 ;; Arrows with text property `idlwave-class'
1269 (class-arrows 1254 (class-arrows
1270 (list 'idlwave-match-class-arrows 1255 '(idlwave-match-class-arrows (0 idlwave-class-arrow-face))))
1271 (list 0 (if (featurep 'xemacs) 1256
1272 idlwave-class-arrow-face 1257 (defconst idlwave-font-lock-keywords-1
1273 'idlwave-class-arrow-face)))) 1258 (list pros-and-functions batch-files)
1274 1259 "Subdued level highlighting for IDLWAVE mode.")
1275 )
1276
1277 ;; The following lines are just a dummy to make the compiler shut up
1278 ;; about variables bound but not used.
1279 (setq oldp oldp
1280 pros-and-functions pros-and-functions
1281 common-blocks common-blocks
1282 batch-files batch-files
1283 fixme fixme
1284 label label
1285 goto goto
1286 structtag structtag
1287 structname structname
1288 keyword-parameters keyword-parameters
1289 system-variables system-variables
1290 special-operators special-operators
1291 all-operators all-operators
1292 class-arrows class-arrows)
1293
1294 (setq idlwave-font-lock-keywords-1
1295 (list pros-and-functions
1296 batch-files
1297 ))
1298 1260
1299 (setq idlwave-font-lock-keywords-2 1261 (defconst idlwave-font-lock-keywords-2
1300 (mapcar 'symbol-value idlwave-default-font-lock-items)) 1262 (mapcar 'symbol-value idlwave-default-font-lock-items)
1263 "Medium level highlighting for IDLWAVE mode.")
1301 1264
1302 (setq idlwave-font-lock-keywords-3 1265 (defconst idlwave-font-lock-keywords-3
1303 (list pros-and-functions 1266 (list pros-and-functions
1304 batch-files 1267 batch-files
1305 idlwave-idl-keywords 1268 idlwave-idl-keywords
@@ -1309,9 +1272,8 @@ As a user, you should not set this to t.")
1309 common-blocks 1272 common-blocks
1310 keyword-parameters 1273 keyword-parameters
1311 system-variables 1274 system-variables
1312 class-arrows 1275 class-arrows)
1313 )) 1276 "Gaudy level highlighting for IDLWAVE mode."))
1314 )
1315 1277
1316(defun idlwave-match-class-arrows (limit) 1278(defun idlwave-match-class-arrows (limit)
1317 ;; Match an object arrow with class property 1279 ;; Match an object arrow with class property
@@ -2975,7 +2937,7 @@ statement if this statement is a continuation of the previous line."
2975 (or idlwave-indent-to-open-paren ;; override 2937 (or idlwave-indent-to-open-paren ;; override
2976 (< (- fancy-paren-indent basic-indent) 2938 (< (- fancy-paren-indent basic-indent)
2977 idlwave-max-extra-continuation-indent)))) 2939 idlwave-max-extra-continuation-indent))))
2978 fancy-enclosing-parent-indent) 2940 fancy-enclosing-paren-indent)
2979 (cond 2941 (cond
2980 ;; else continuations are always standard 2942 ;; else continuations are always standard
2981 (else-cont 2943 (else-cont
@@ -8005,15 +7967,16 @@ Assumes that point is at the beginning of the unit as found by
8005 (buffer-substring-no-properties begin (point)) 7967 (buffer-substring-no-properties begin (point))
8006 (buffer-substring begin (point))))) 7968 (buffer-substring begin (point)))))
8007 7969
8008(defun idlwave-function-menu () 7970(defalias 'idlwave-function-menu
8009 "Use `imenu' or `function-menu' to jump to a procedure or function." 7971 (condition-case nil
8010 (interactive)
8011 (if (string-match "XEmacs" emacs-version)
8012 (progn 7972 (progn
8013 (require 'func-menu) 7973 (require 'func-menu)
8014 (function-menu)) 7974 'function-menu)
8015 (require 'imenu) 7975 (error (condition-case nil
8016 (imenu (imenu-choose-buffer-index)))) 7976 (progn
7977 (require 'imenu)
7978 'imenu)
7979 (error nil)))))
8017 7980
8018;; Here we kack func-menu.el in order to support this new mode. 7981;; Here we kack func-menu.el in order to support this new mode.
8019;; The latest versions of func-menu.el already have this stuff in, so 7982;; The latest versions of func-menu.el already have this stuff in, so