diff options
| author | Richard M. Stallman | 2004-12-31 14:50:27 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-12-31 14:50:27 +0000 |
| commit | c1741bb3a10401c083afaad1a4cf1d8cb879f74e (patch) | |
| tree | a44eead6f26b7231400985fbd4e2ace441d6bfbe /lisp | |
| parent | 64a0475c0251c780895ac1d4d7c1523bf8fc03b6 (diff) | |
| download | emacs-c1741bb3a10401c083afaad1a4cf1d8cb879f74e.tar.gz emacs-c1741bb3a10401c083afaad1a4cf1d8cb879f74e.zip | |
(antlr-mode): Use mode-require-final-newline.
Delete old-Emacs compatibility code.
(antlr-c-common-init): Function deleted.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/antlr-mode.el | 54 |
1 files changed, 2 insertions, 52 deletions
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index b7bf99efa2e..1a35fe41860 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el | |||
| @@ -2529,53 +2529,6 @@ ANTLR's syntax and influences the auto indentation, see | |||
| 2529 | (set (car settings) (eval (cadr settings))))) | 2529 | (set (car settings) (eval (cadr settings))))) |
| 2530 | (setq settings (cddr settings))))) | 2530 | (setq settings (cddr settings))))) |
| 2531 | 2531 | ||
| 2532 | (defun antlr-c-common-init () | ||
| 2533 | "Like `c-basic-common-init' when using cc-mode before v5.30." | ||
| 2534 | ;; X/Emacs 20 only | ||
| 2535 | (make-local-variable 'paragraph-start) | ||
| 2536 | (make-local-variable 'paragraph-separate) | ||
| 2537 | (make-local-variable 'paragraph-ignore-fill-prefix) | ||
| 2538 | (make-local-variable 'require-final-newline) | ||
| 2539 | (make-local-variable 'parse-sexp-ignore-comments) | ||
| 2540 | (make-local-variable 'comment-start) | ||
| 2541 | (make-local-variable 'comment-multi-line) | ||
| 2542 | (make-local-variable 'outline-regexp) | ||
| 2543 | (make-local-variable 'outline-level) | ||
| 2544 | (make-local-variable 'adaptive-fill-regexp) | ||
| 2545 | (make-local-variable 'adaptive-fill-mode) | ||
| 2546 | (make-local-variable 'imenu-generic-expression) ;set in the mode functions | ||
| 2547 | (and (boundp 'comment-line-break-function) | ||
| 2548 | (make-local-variable 'comment-line-break-function)) | ||
| 2549 | ;; Emacs 19.30 and beyond only, AFAIK | ||
| 2550 | (if (boundp 'fill-paragraph-function) | ||
| 2551 | (progn | ||
| 2552 | (make-local-variable 'fill-paragraph-function) | ||
| 2553 | (setq fill-paragraph-function 'c-fill-paragraph))) | ||
| 2554 | ;; now set their values | ||
| 2555 | (setq paragraph-start (concat page-delimiter "\\|$") | ||
| 2556 | paragraph-separate paragraph-start | ||
| 2557 | paragraph-ignore-fill-prefix t | ||
| 2558 | parse-sexp-ignore-comments t | ||
| 2559 | comment-column 32 | ||
| 2560 | comment-multi-line nil | ||
| 2561 | comment-line-break-function 'c-comment-line-break-function | ||
| 2562 | adaptive-fill-regexp nil | ||
| 2563 | adaptive-fill-mode nil) | ||
| 2564 | (c-set-style (or antlr-indent-style "gnu")) | ||
| 2565 | (and (boundp 'c-current-comment-prefix) (boundp 'c-comment-prefix-regexp) | ||
| 2566 | (setq c-current-comment-prefix | ||
| 2567 | (if (listp c-comment-prefix-regexp) | ||
| 2568 | (cdr-safe (or (assoc major-mode c-comment-prefix-regexp) | ||
| 2569 | (assoc 'other c-comment-prefix-regexp))) | ||
| 2570 | c-comment-prefix-regexp))) | ||
| 2571 | ;; we have to do something special for c-offsets-alist so that the | ||
| 2572 | ;; buffer local value has its own alist structure. | ||
| 2573 | (setq c-offsets-alist (copy-alist c-offsets-alist)) | ||
| 2574 | ;; setup the comment indent variable in a Emacs version portable way | ||
| 2575 | ;; ignore any byte compiler warnings you might get here | ||
| 2576 | (make-local-variable 'comment-indent-function) | ||
| 2577 | (setq comment-indent-function 'c-comment-indent)) | ||
| 2578 | |||
| 2579 | (defun antlr-language-option (search) | 2532 | (defun antlr-language-option (search) |
| 2580 | "Find language in `antlr-language-alist' for language option. | 2533 | "Find language in `antlr-language-alist' for language option. |
| 2581 | If SEARCH is non-nil, find element for language option. Otherwise, find | 2534 | If SEARCH is non-nil, find element for language option. Otherwise, find |
| @@ -2643,10 +2596,7 @@ the default language." | |||
| 2643 | (funcall init-fn))) ; is a function in v5.29 | 2596 | (funcall init-fn))) ; is a function in v5.29 |
| 2644 | (t ; cc-mode upto 5.28 | 2597 | (t ; cc-mode upto 5.28 |
| 2645 | (antlr-c-init-language-vars))) ; do it myself | 2598 | (antlr-c-init-language-vars))) ; do it myself |
| 2646 | (cond ((fboundp 'c-basic-common-init) ; cc-mode 5.30+ | 2599 | (c-basic-common-init antlr-language (or antlr-indent-style "gnu")) |
| 2647 | (c-basic-common-init antlr-language (or antlr-indent-style "gnu"))) | ||
| 2648 | (t | ||
| 2649 | (antlr-c-common-init))) | ||
| 2650 | (make-local-variable 'outline-regexp) | 2600 | (make-local-variable 'outline-regexp) |
| 2651 | (make-local-variable 'outline-level) | 2601 | (make-local-variable 'outline-level) |
| 2652 | (make-local-variable 'require-final-newline) | 2602 | (make-local-variable 'require-final-newline) |
| @@ -2654,7 +2604,7 @@ the default language." | |||
| 2654 | (make-local-variable 'indent-region-function) | 2604 | (make-local-variable 'indent-region-function) |
| 2655 | (setq outline-regexp "[^#\n\^M]" | 2605 | (setq outline-regexp "[^#\n\^M]" |
| 2656 | outline-level 'c-outline-level) ; TODO: define own | 2606 | outline-level 'c-outline-level) ; TODO: define own |
| 2657 | (setq require-final-newline t) | 2607 | (setq require-final-newline mode-require-final-newline) |
| 2658 | (setq indent-line-function 'antlr-indent-line | 2608 | (setq indent-line-function 'antlr-indent-line |
| 2659 | indent-region-function nil) ; too lazy | 2609 | indent-region-function nil) ; too lazy |
| 2660 | (setq comment-start "// " | 2610 | (setq comment-start "// " |