Mercurial > emacs
comparison lisp/progmodes/perl-mode.el @ 41346:42d60301f16a
(perl-mode): Don't use define-derived-mode.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 21 Nov 2001 11:01:55 +0000 |
parents | 901d871219d0 |
children | b97054e2d931 |
comparison
equal
deleted
inserted
replaced
41345:7e936c1a2c48 | 41346:42d60301f16a |
---|---|
277 "*Lines starting with this regular expression are not auto-indented." | 277 "*Lines starting with this regular expression are not auto-indented." |
278 :type 'regexp | 278 :type 'regexp |
279 :group 'perl) | 279 :group 'perl) |
280 | 280 |
281 ;;;###autoload | 281 ;;;###autoload |
282 (define-derived-mode perl-mode nil "Perl" | 282 (defun perl-mode () |
283 "Major mode for editing Perl code. | 283 "Major mode for editing Perl code. |
284 Expression and list commands understand all Perl brackets. | 284 Expression and list commands understand all Perl brackets. |
285 Tab indents for Perl code. | 285 Tab indents for Perl code. |
286 Comments are delimited with # ... \\n. | 286 Comments are delimited with # ... \\n. |
287 Paragraphs are separated by blank lines only. | 287 Paragraphs are separated by blank lines only. |
324 perl-brace-offset -5 -8 0 0 0 | 324 perl-brace-offset -5 -8 0 0 0 |
325 perl-brace-imaginary-offset 0 0 4 0 0 | 325 perl-brace-imaginary-offset 0 0 4 0 0 |
326 perl-label-offset -5 -8 -2 -2 -2 | 326 perl-label-offset -5 -8 -2 -2 -2 |
327 | 327 |
328 Turning on Perl mode runs the normal hook `perl-mode-hook'." | 328 Turning on Perl mode runs the normal hook `perl-mode-hook'." |
329 (interactive) | |
330 (kill-all-local-variables) | |
331 (use-local-map perl-mode-map) | |
332 (setq major-mode 'perl-mode) | |
333 (setq mode-name "Perl") | |
334 (setq local-abbrev-table perl-mode-abbrev-table) | |
335 (set-syntax-table perl-mode-syntax-table) | |
329 (make-local-variable 'paragraph-start) | 336 (make-local-variable 'paragraph-start) |
330 (setq paragraph-start (concat "$\\|" page-delimiter)) | 337 (setq paragraph-start (concat "$\\|" page-delimiter)) |
331 (make-local-variable 'paragraph-separate) | 338 (make-local-variable 'paragraph-separate) |
332 (setq paragraph-separate paragraph-start) | 339 (setq paragraph-separate paragraph-start) |
333 (make-local-variable 'paragraph-ignore-fill-prefix) | 340 (make-local-variable 'paragraph-ignore-fill-prefix) |
357 . perl-font-lock-syntactic-face-function) | 364 . perl-font-lock-syntactic-face-function) |
358 (parse-sexp-lookup-properties . t))) | 365 (parse-sexp-lookup-properties . t))) |
359 ;; Tell imenu how to handle Perl. | 366 ;; Tell imenu how to handle Perl. |
360 (make-local-variable 'imenu-generic-expression) | 367 (make-local-variable 'imenu-generic-expression) |
361 (setq imenu-generic-expression perl-imenu-generic-expression) | 368 (setq imenu-generic-expression perl-imenu-generic-expression) |
362 (setq imenu-case-fold-search nil)) | 369 (setq imenu-case-fold-search nil) |
370 (run-hooks 'perl-mode-hook)) | |
363 | 371 |
364 ;; This is used by indent-for-comment | 372 ;; This is used by indent-for-comment |
365 ;; to decide how much to indent a comment in Perl code | 373 ;; to decide how much to indent a comment in Perl code |
366 ;; based on its context. | 374 ;; based on its context. |
367 (defun perl-comment-indent () | 375 (defun perl-comment-indent () |