aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2000-11-03 23:05:16 +0000
committerStefan Monnier2000-11-03 23:05:16 +0000
commit7b371301b49d332dc41f1c94ea4381945352bb0d (patch)
treec8b02f7d0f00007c8d3350df38e4597c49e74e0c
parent000281e34380b9a90b88df8b86bbbc4005de74df (diff)
downloademacs-7b371301b49d332dc41f1c94ea4381945352bb0d.tar.gz
emacs-7b371301b49d332dc41f1c94ea4381945352bb0d.zip
(icon-mode-map): Don't rebind \t.
(icon-mode): Define indent-line-function. (icon-comment-indent): Simplify. (icon-font-lock-keywords-2): Use the `words' arg to regexp-opt.
-rw-r--r--lisp/progmodes/icon.el31
1 files changed, 10 insertions, 21 deletions
diff --git a/lisp/progmodes/icon.el b/lisp/progmodes/icon.el
index cbc1b318730..f90d8d4f573 100644
--- a/lisp/progmodes/icon.el
+++ b/lisp/progmodes/icon.el
@@ -46,7 +46,6 @@
46 (define-key icon-mode-map "\e\C-e" 'end-of-icon-defun) 46 (define-key icon-mode-map "\e\C-e" 'end-of-icon-defun)
47 (define-key icon-mode-map "\e\C-q" 'indent-icon-exp) 47 (define-key icon-mode-map "\e\C-q" 'indent-icon-exp)
48 (define-key icon-mode-map "\177" 'backward-delete-char-untabify) 48 (define-key icon-mode-map "\177" 'backward-delete-char-untabify)
49 (define-key icon-mode-map "\t" 'icon-indent-command)
50 49
51 (define-key icon-mode-map [menu-bar] (make-sparse-keymap "Icon")) 50 (define-key icon-mode-map [menu-bar] (make-sparse-keymap "Icon"))
52 (define-key icon-mode-map [menu-bar icon] 51 (define-key icon-mode-map [menu-bar icon]
@@ -187,8 +186,8 @@ with no args, if that value is non-nil."
187 (setq comment-start-skip "# *") 186 (setq comment-start-skip "# *")
188 (make-local-variable 'comment-indent-function) 187 (make-local-variable 'comment-indent-function)
189 (setq comment-indent-function 'icon-comment-indent) 188 (setq comment-indent-function 'icon-comment-indent)
189 (set (make-local-variable 'indent-line-function) 'icon-indent-line)
190 ;; font-lock support 190 ;; font-lock support
191 (make-local-variable 'font-lock-defaults)
192 (setq font-lock-defaults 191 (setq font-lock-defaults
193 '((icon-font-lock-keywords 192 '((icon-font-lock-keywords
194 icon-font-lock-keywords-1 icon-font-lock-keywords-2) 193 icon-font-lock-keywords-1 icon-font-lock-keywords-2)
@@ -211,12 +210,7 @@ with no args, if that value is non-nil."
211;; This is used by indent-for-comment to decide how much to 210;; This is used by indent-for-comment to decide how much to
212;; indent a comment in Icon code based on its context. 211;; indent a comment in Icon code based on its context.
213(defun icon-comment-indent () 212(defun icon-comment-indent ()
214 (if (looking-at "^#") 213 (if (looking-at "^#") 0 comment-column))
215 0
216 (save-excursion
217 (skip-chars-backward " \t")
218 (max (if (bolp) 0 (1+ (current-column)))
219 comment-column))))
220 214
221(defun electric-icon-brace (arg) 215(defun electric-icon-brace (arg)
222 "Insert character and correct line's indentation." 216 "Insert character and correct line's indentation."
@@ -624,25 +618,20 @@ Returns nil if line starts inside a string, t if in a comment."
624 (eval-when-compile 618 (eval-when-compile
625 (list 619 (list
626 ;; Fontify all type specifiers. 620 ;; Fontify all type specifiers.
627 (cons 621 (cons
628 (concat 622 (regexp-opt '("null" "string" "co-expression" "table" "integer"
629 "\\<" (regexp-opt '("null" "string" "co-expression" "table" "integer" 623 "cset" "set" "real" "file" "list") 'words)
630 "cset" "set" "real" "file" "list") t)
631 "\\>")
632 'font-lock-type-face) 624 'font-lock-type-face)
633 ;; Fontify all keywords. 625 ;; Fontify all keywords.
634 ;; 626 ;;
635 (cons 627 (cons
636 (concat 628 (regexp-opt
637 "\\<" 629 '("break" "do" "next" "repeat" "to" "by" "else" "if" "not" "return"
638 (regexp-opt 630 "until" "case" "of" "while" "create" "every" "suspend" "default"
639 '("break" "do" "next" "repeat" "to" "by" "else" "if" "not" "return" 631 "fail" "record" "then") 'words)
640 "until" "case" "of" "while" "create" "every" "suspend" "default"
641 "fail" "record" "then") t)
642 "\\>")
643 'font-lock-keyword-face) 632 'font-lock-keyword-face)
644 ;; "end" "initial" 633 ;; "end" "initial"
645 (cons (concat "\\<" (regexp-opt '("end" "initial") t) "\\>") 634 (cons (regexp-opt '("end" "initial") 'words)
646 'font-lock-builtin-face) 635 'font-lock-builtin-face)
647 ;; Fontify all system variables. 636 ;; Fontify all system variables.
648 (cons 637 (cons