diff options
Diffstat (limited to 'lisp/progmodes/simula.el')
-rw-r--r-- | lisp/progmodes/simula.el | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el index 3f842903b0d..bfa921841e2 100644 --- a/lisp/progmodes/simula.el +++ b/lisp/progmodes/simula.el @@ -163,17 +163,18 @@ for SIMULA mode to function correctly." (defvar simula-mode-syntax-table nil "Syntax table in SIMULA mode buffers.") -(defconst simula-font-lock-syntactic-keywords - `(;; `comment' directive. - ("\\<\\(c\\)omment\\>" 1 "<") - ;; end comments - (,(concat "\\<end\\>\\([^;\n]\\).*?\\(\n\\|\\(.\\)\\(;\\|" - (regexp-opt '("end" "else" "when" "otherwise")) - "\\)\\)") - (1 "< b") - (3 "> b" nil t)) - ;; non-quoted single-quote char. - ("'\\('\\)'" 1 "."))) +(defconst simula-syntax-propertize-function + (syntax-propertize-rules + ;; `comment' directive. + ("\\<\\(c\\)omment\\>" (1 "<")) + ;; end comments + ((concat "\\<end\\>\\([^;\n]\\).*?\\(\n\\|\\(.\\)\\(;\\|" + (regexp-opt '("end" "else" "when" "otherwise")) + "\\)\\)") + (1 "< b") + (3 "> b")) + ;; non-quoted single-quote char. + ("'\\('\\)'" (1 ".")))) ;; Regexps written with help from Alf-Ivar Holm <alfh@ifi.uio.no>. (defconst simula-font-lock-keywords-1 @@ -330,7 +331,7 @@ for SIMULA mode to function correctly." (popup-menu (cons (concat mode-name " Mode Commands") simula-mode-menu))) ;;;###autoload -(define-derived-mode simula-mode nil "Simula" +(define-derived-mode simula-mode prog-mode "Simula" "Major mode for editing SIMULA code. \\{simula-mode-map} Variables controlling indentation style: @@ -396,8 +397,9 @@ with no arguments, if that value is non-nil." (setq font-lock-defaults '((simula-font-lock-keywords simula-font-lock-keywords-1 simula-font-lock-keywords-2 simula-font-lock-keywords-3) - nil t ((?_ . "w")) nil - (font-lock-syntactic-keywords . simula-font-lock-syntactic-keywords))) + nil t ((?_ . "w")))) + (set (make-local-variable 'syntax-propertize-function) + simula-syntax-propertize-function) (abbrev-mode 1)) (defun simula-indent-exp () @@ -962,7 +964,7 @@ If COUNT is negative, move backward instead." (simula-previous-statement 1) (simula-skip-comment-backward))) (setq start-line - (save-excursion (beginning-of-line) (point)) + (line-beginning-position) ;; - perhaps this is a continued statement continued (save-excursion @@ -1021,7 +1023,7 @@ If COUNT is negative, move backward instead." (car simula-continued-statement-offset) simula-continued-statement-offset)))) (setq start-line - (save-excursion (beginning-of-line) (point)) + (line-beginning-position) continued nil)) ;; search failed .. point is at beginning of line ;; determine if we should continue searching @@ -1062,7 +1064,7 @@ If COUNT is negative, move backward instead." simula-continued-statement-offset)))) ;; while ends if point is at beginning of line at loop test (if (not temp) - (setq start-line (save-excursion (beginning-of-line) (point))) + (setq start-line (line-beginning-position)) (beginning-of-line)))) ;; ;; return indentation @@ -1657,5 +1659,4 @@ If not nil and not t, move to limit of search and return nil." (provide 'simula) -;; arch-tag: 488c1bb0-eebf-4f06-93df-1df603f06255 ;;; simula.el ends here |