diff options
| author | Stefan Monnier | 2001-03-06 21:47:33 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-03-06 21:47:33 +0000 |
| commit | 029cb4d5b5f5be3187a4e3eaa338e30d1c9051fe (patch) | |
| tree | 2ec3e6cbc2737be78c2f57c7899315942696166b | |
| parent | 101922c35f634a376eacb2a0eaa091d3e6801bd7 (diff) | |
| download | emacs-029cb4d5b5f5be3187a4e3eaa338e30d1c9051fe.tar.gz emacs-029cb4d5b5f5be3187a4e3eaa338e30d1c9051fe.zip | |
(cperl-mode): Set major-mode to cperl-mode
so that C-h m shows the correct information.
Use make-local-variable rather than make-variable-buffer-local.
(cperl-info-buffer, cperl-setup-tmp-buf):
Use make-local-variable rather than make-variable-buffer-local.
Updated to author version 4.23.
(cperl-electric-pod): SYNOPSIS was misspelled.
(cperl-find-pods-heres): @if ? a : b was considered a REx.
(cperl-after-expr-p): Make true after __END__.
| -rw-r--r-- | lisp/progmodes/cperl-mode.el | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index d8c6c8f32d1..89ffe55e15c 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el | |||
| @@ -189,7 +189,7 @@ for constructs with multiline if/unless/while/until/for/foreach condition." | |||
| 189 | 189 | ||
| 190 | (defcustom cperl-lineup-step nil | 190 | (defcustom cperl-lineup-step nil |
| 191 | "*`cperl-lineup' will always lineup at multiple of this number. | 191 | "*`cperl-lineup' will always lineup at multiple of this number. |
| 192 | If `nil', the value of `cperl-indent-level' will be used." | 192 | If nil, the value of `cperl-indent-level' will be used." |
| 193 | :type '(choice (const nil) integer) | 193 | :type '(choice (const nil) integer) |
| 194 | :group 'cperl-indentation-details) | 194 | :group 'cperl-indentation-details) |
| 195 | 195 | ||
| @@ -248,13 +248,13 @@ regardless of where in the line point is when the TAB command is used." | |||
| 248 | :group 'cperl-indentation-details) | 248 | :group 'cperl-indentation-details) |
| 249 | 249 | ||
| 250 | (defcustom cperl-font-lock nil | 250 | (defcustom cperl-font-lock nil |
| 251 | "*Non-nil (and non-null) means CPerl buffers will use font-lock-mode. | 251 | "*Non-nil (and non-null) means CPerl buffers will use `font-lock-mode'. |
| 252 | Can be overwritten by `cperl-hairy' if nil." | 252 | Can be overwritten by `cperl-hairy' if nil." |
| 253 | :type '(choice (const null) boolean) | 253 | :type '(choice (const null) boolean) |
| 254 | :group 'cperl-affected-by-hairy) | 254 | :group 'cperl-affected-by-hairy) |
| 255 | 255 | ||
| 256 | (defcustom cperl-electric-lbrace-space nil | 256 | (defcustom cperl-electric-lbrace-space nil |
| 257 | "*Non-nil (and non-null) means { after $ in CPerl buffers should be preceded by ` '. | 257 | "*Non-nil (and non-null) means { after $ should be preceded by ` '. |
| 258 | Can be overwritten by `cperl-hairy' if nil." | 258 | Can be overwritten by `cperl-hairy' if nil." |
| 259 | :type '(choice (const null) boolean) | 259 | :type '(choice (const null) boolean) |
| 260 | :group 'cperl-affected-by-hairy) | 260 | :group 'cperl-affected-by-hairy) |
| @@ -431,7 +431,7 @@ Older version of this page was called `perl5', newer `perl'." | |||
| 431 | 431 | ||
| 432 | (defcustom cperl-regexp-indent-step nil | 432 | (defcustom cperl-regexp-indent-step nil |
| 433 | "*Indentation used when beautifying regexps. | 433 | "*Indentation used when beautifying regexps. |
| 434 | If `nil', the value of `cperl-indent-level' will be used." | 434 | If nil, the value of `cperl-indent-level' will be used." |
| 435 | :type '(choice integer (const nil)) | 435 | :type '(choice integer (const nil)) |
| 436 | :group 'cperl-indentation-details) | 436 | :group 'cperl-indentation-details) |
| 437 | 437 | ||
| @@ -600,7 +600,7 @@ from Perl menu). If many files are related, generate TAGS files from | |||
| 600 | Tools/Tags submenu in Perl menu. | 600 | Tools/Tags submenu in Perl menu. |
| 601 | 601 | ||
| 602 | If some class structure is too complicated, use Tools/Hierarchy-view | 602 | If some class structure is too complicated, use Tools/Hierarchy-view |
| 603 | from Perl menu, or hierarchic view of imenu. The second one uses the | 603 | from Perl menu, or hierarchic view of imenu. The second one uses the |
| 604 | current buffer only, the first one requires generation of TAGS from | 604 | current buffer only, the first one requires generation of TAGS from |
| 605 | Perl/Tools/Tags menu beforehand. | 605 | Perl/Tools/Tags menu beforehand. |
| 606 | 606 | ||
| @@ -611,12 +611,12 @@ Switch auto-help on/off with Perl/Tools/Auto-help. | |||
| 611 | Though with contemporary Emaxen CPerl mode should maintain the correct | 611 | Though with contemporary Emaxen CPerl mode should maintain the correct |
| 612 | parsing of Perl even when editing, sometimes it may be lost. Fix this by | 612 | parsing of Perl even when editing, sometimes it may be lost. Fix this by |
| 613 | 613 | ||
| 614 | M-x norm RET | 614 | \\[normal-mode] |
| 615 | 615 | ||
| 616 | In cases of more severe confusion sometimes it is helpful to do | 616 | In cases of more severe confusion sometimes it is helpful to do |
| 617 | 617 | ||
| 618 | M-x load-l RET cperl-mode RET | 618 | \\[load-library] cperl-mode RET |
| 619 | M-x norm RET | 619 | \\[normal-mode] |
| 620 | 620 | ||
| 621 | Before reporting (non-)problems look in the problem section of online | 621 | Before reporting (non-)problems look in the problem section of online |
| 622 | micro-docs on what I know about CPerl problems.") | 622 | micro-docs on what I know about CPerl problems.") |
| @@ -719,7 +719,7 @@ Imenu in 19.31 is broken. Set `imenu-use-keymap-menu' to t, and remove | |||
| 719 | `imenu-add-to-menubar' in 20.2 is broken. | 719 | `imenu-add-to-menubar' in 20.2 is broken. |
| 720 | 720 | ||
| 721 | A lot of things on XEmacs may be broken too, judging by bug reports I | 721 | A lot of things on XEmacs may be broken too, judging by bug reports I |
| 722 | recieve. Note that some releases of XEmacs are better than the others | 722 | receive. Note that some releases of XEmacs are better than the others |
| 723 | as far as bugs reports I see are concerned.") | 723 | as far as bugs reports I see are concerned.") |
| 724 | 724 | ||
| 725 | (defvar cperl-praise 'please-ignore-this-line | 725 | (defvar cperl-praise 'please-ignore-this-line |
| @@ -800,6 +800,9 @@ the settings present before the switch. | |||
| 800 | 800 | ||
| 801 | 9) When doing indentation of control constructs, may correct | 801 | 9) When doing indentation of control constructs, may correct |
| 802 | line-breaks/spacing between elements of the construct. | 802 | line-breaks/spacing between elements of the construct. |
| 803 | |||
| 804 | 10) Uses a linear-time algorith for indentation of regions (on Emaxen with | ||
| 805 | capable syntax engines). | ||
| 803 | ") | 806 | ") |
| 804 | 807 | ||
| 805 | (defvar cperl-speed 'please-ignore-this-line | 808 | (defvar cperl-speed 'please-ignore-this-line |
| @@ -898,7 +901,7 @@ the faces: please specify bold, italic, underline, shadow and box.) | |||
| 898 | (defvar cperl-del-back-ch | 901 | (defvar cperl-del-back-ch |
| 899 | (car (append (where-is-internal 'delete-backward-char) | 902 | (car (append (where-is-internal 'delete-backward-char) |
| 900 | (where-is-internal 'backward-delete-char-untabify))) | 903 | (where-is-internal 'backward-delete-char-untabify))) |
| 901 | "Character generated by key bound to delete-backward-char.") | 904 | "Character generated by key bound to `delete-backward-char'.") |
| 902 | 905 | ||
| 903 | (and (vectorp cperl-del-back-ch) (= (length cperl-del-back-ch) 1) | 906 | (and (vectorp cperl-del-back-ch) (= (length cperl-del-back-ch) 1) |
| 904 | (setq cperl-del-back-ch (aref cperl-del-back-ch 0))) | 907 | (setq cperl-del-back-ch (aref cperl-del-back-ch 0))) |
| @@ -1414,7 +1417,7 @@ or as help on variables `cperl-tips', `cperl-problems', | |||
| 1414 | (cperl-define-key "\C-hf" 'cperl-info-on-current-command [(control h) f]) | 1417 | (cperl-define-key "\C-hf" 'cperl-info-on-current-command [(control h) f]) |
| 1415 | (cperl-define-key "\C-c\C-hf" 'cperl-info-on-command | 1418 | (cperl-define-key "\C-c\C-hf" 'cperl-info-on-command |
| 1416 | [(control c) (control h) f]))) | 1419 | [(control c) (control h) f]))) |
| 1417 | (setq major-mode 'perl-mode) | 1420 | (setq major-mode 'cperl-mode) |
| 1418 | (setq mode-name "CPerl") | 1421 | (setq mode-name "CPerl") |
| 1419 | (if (not cperl-mode-abbrev-table) | 1422 | (if (not cperl-mode-abbrev-table) |
| 1420 | (let ((prev-a-c abbrevs-changed)) | 1423 | (let ((prev-a-c abbrevs-changed)) |
| @@ -1489,22 +1492,22 @@ or as help on variables `cperl-tips', `cperl-problems', | |||
| 1489 | (make-local-variable 'cperl-syntax-state) | 1492 | (make-local-variable 'cperl-syntax-state) |
| 1490 | (if cperl-use-syntax-table-text-property | 1493 | (if cperl-use-syntax-table-text-property |
| 1491 | (progn | 1494 | (progn |
| 1492 | (make-variable-buffer-local 'parse-sexp-lookup-properties) | 1495 | (make-local-variable 'parse-sexp-lookup-properties) |
| 1493 | ;; Do not introduce variable if not needed, we check it! | 1496 | ;; Do not introduce variable if not needed, we check it! |
| 1494 | (set 'parse-sexp-lookup-properties t) | 1497 | (set 'parse-sexp-lookup-properties t) |
| 1495 | ;; Fix broken font-lock: | 1498 | ;; Fix broken font-lock: |
| 1496 | (or (boundp 'font-lock-unfontify-region-function) | 1499 | (or (boundp 'font-lock-unfontify-region-function) |
| 1497 | (set 'font-lock-unfontify-region-function | 1500 | (set 'font-lock-unfontify-region-function |
| 1498 | 'font-lock-default-unfontify-region)) | 1501 | 'font-lock-default-unfontify-region)) |
| 1499 | (make-variable-buffer-local 'font-lock-unfontify-region-function) | 1502 | (make-local-variable 'font-lock-unfontify-region-function) |
| 1500 | (set 'font-lock-unfontify-region-function | 1503 | (set 'font-lock-unfontify-region-function |
| 1501 | 'cperl-font-lock-unfontify-region-function) | 1504 | 'cperl-font-lock-unfontify-region-function) |
| 1502 | (make-variable-buffer-local 'cperl-syntax-done-to) | 1505 | (make-local-variable 'cperl-syntax-done-to) |
| 1503 | ;; Another bug: unless font-lock-syntactic-keywords, font-lock | 1506 | ;; Another bug: unless font-lock-syntactic-keywords, font-lock |
| 1504 | ;; ignores syntax-table text-property. (t) is a hack | 1507 | ;; ignores syntax-table text-property. (t) is a hack |
| 1505 | ;; to make font-lock think that font-lock-syntactic-keywords | 1508 | ;; to make font-lock think that font-lock-syntactic-keywords |
| 1506 | ;; are defined | 1509 | ;; are defined |
| 1507 | (make-variable-buffer-local 'font-lock-syntactic-keywords) | 1510 | (make-local-variable 'font-lock-syntactic-keywords) |
| 1508 | (setq font-lock-syntactic-keywords | 1511 | (setq font-lock-syntactic-keywords |
| 1509 | (if cperl-syntaxify-by-font-lock | 1512 | (if cperl-syntaxify-by-font-lock |
| 1510 | '(t (cperl-fontify-syntaxically)) | 1513 | '(t (cperl-fontify-syntaxically)) |
| @@ -1942,7 +1945,7 @@ to nil." | |||
| 1942 | (file-name-nondirectory (buffer-file-name))) | 1945 | (file-name-nondirectory (buffer-file-name))) |
| 1943 | p (point)) | 1946 | p (point)) |
| 1944 | (insert " NAME\n\n" name | 1947 | (insert " NAME\n\n" name |
| 1945 | " - \n\n=head1 SYNOPSYS\n\n\n\n" | 1948 | " - \n\n=head1 SYNOPSIS\n\n\n\n" |
| 1946 | "=head1 DESCRIPTION") | 1949 | "=head1 DESCRIPTION") |
| 1947 | (cperl-ensure-newlines 4) | 1950 | (cperl-ensure-newlines 4) |
| 1948 | (goto-char p) | 1951 | (goto-char p) |
| @@ -2818,7 +2821,7 @@ the current line is to be regarded as part of a block comment." | |||
| 2818 | 2821 | ||
| 2819 | 2822 | ||
| 2820 | (defun cperl-to-comment-or-eol () | 2823 | (defun cperl-to-comment-or-eol () |
| 2821 | "Goes to position before comment on the current line, or to end of line. | 2824 | "Go to position before comment on the current line, or to end of line. |
| 2822 | Returns true if comment is found." | 2825 | Returns true if comment is found." |
| 2823 | (let (state stop-in cpoint (lim (progn (end-of-line) (point)))) | 2826 | (let (state stop-in cpoint (lim (progn (end-of-line) (point)))) |
| 2824 | (beginning-of-line) | 2827 | (beginning-of-line) |
| @@ -3390,8 +3393,11 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', | |||
| 3390 | (if (eq (preceding-char) ?-) | 3393 | (if (eq (preceding-char) ?-) |
| 3391 | ;; -d ?foo? is a RE | 3394 | ;; -d ?foo? is a RE |
| 3392 | (looking-at "[a-zA-Z]\\>") | 3395 | (looking-at "[a-zA-Z]\\>") |
| 3393 | (looking-at | 3396 | (and |
| 3394 | "\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\)\\>")))) | 3397 | (not (memq (preceding-char) |
| 3398 | '(?$ ?@ ?& ?%))) | ||
| 3399 | (looking-at | ||
| 3400 | "\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\)\\>"))))) | ||
| 3395 | (and (eq (preceding-char) ?.) | 3401 | (and (eq (preceding-char) ?.) |
| 3396 | (eq (char-after (- (point) 2)) ?.)) | 3402 | (eq (char-after (- (point) 2)) ?.)) |
| 3397 | (bobp)) | 3403 | (bobp)) |
| @@ -3630,7 +3636,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', | |||
| 3630 | (error nil)))) | 3636 | (error nil)))) |
| 3631 | 3637 | ||
| 3632 | (defun cperl-after-expr-p (&optional lim chars test) | 3638 | (defun cperl-after-expr-p (&optional lim chars test) |
| 3633 | "Returns true if the position is good for start of expression. | 3639 | "Return true if the position is good for start of expression. |
| 3634 | TEST is the expression to evaluate at the found position. If absent, | 3640 | TEST is the expression to evaluate at the found position. If absent, |
| 3635 | CHARS is a string that contains good characters to have before us (however, | 3641 | CHARS is a string that contains good characters to have before us (however, |
| 3636 | `}' is treated \"smartly\" if it is not in the list)." | 3642 | `}' is treated \"smartly\" if it is not in the list)." |
| @@ -3657,6 +3663,7 @@ CHARS is a string that contains good characters to have before us (however, | |||
| 3657 | (setq stop t)))) | 3663 | (setq stop t)))) |
| 3658 | (or (bobp) ; ???? Needed | 3664 | (or (bobp) ; ???? Needed |
| 3659 | (eq (point) lim) | 3665 | (eq (point) lim) |
| 3666 | (looking-at "[ \t]*__\\(END\\|DATA\\)__") ; After this anything goes | ||
| 3660 | (progn | 3667 | (progn |
| 3661 | (if test (eval test) | 3668 | (if test (eval test) |
| 3662 | (or (memq (preceding-char) (append (or chars "{;") nil)) | 3669 | (or (memq (preceding-char) (append (or chars "{;") nil)) |
| @@ -4981,7 +4988,7 @@ side-effect of memorizing only." | |||
| 4981 | (set-buffer "*info-perl-tmp*") | 4988 | (set-buffer "*info-perl-tmp*") |
| 4982 | (rename-buffer "*info*") | 4989 | (rename-buffer "*info*") |
| 4983 | (set-buffer bname))) | 4990 | (set-buffer bname))) |
| 4984 | (make-variable-buffer-local 'window-min-height) | 4991 | (make-local-variable 'window-min-height) |
| 4985 | (setq window-min-height 2) | 4992 | (setq window-min-height 2) |
| 4986 | (current-buffer))))) | 4993 | (current-buffer))))) |
| 4987 | 4994 | ||
| @@ -5000,7 +5007,7 @@ side-effect of memorizing only." | |||
| 5000 | 'find-tag-default)))))) | 5007 | 'find-tag-default)))))) |
| 5001 | 5008 | ||
| 5002 | (defun cperl-info-on-command (command) | 5009 | (defun cperl-info-on-command (command) |
| 5003 | "Shows documentation for Perl command in other window. | 5010 | "Show documentation for Perl command in other window. |
| 5004 | If perl-info buffer is shown in some frame, uses this frame. | 5011 | If perl-info buffer is shown in some frame, uses this frame. |
| 5005 | Customized by setting variables `cperl-shrink-wrap-info-frame', | 5012 | Customized by setting variables `cperl-shrink-wrap-info-frame', |
| 5006 | `cperl-max-help-size'." | 5013 | `cperl-max-help-size'." |
| @@ -5083,7 +5090,7 @@ Customized by setting variables `cperl-shrink-wrap-info-frame', | |||
| 5083 | (select-window iniwin))) | 5090 | (select-window iniwin))) |
| 5084 | 5091 | ||
| 5085 | (defun cperl-info-on-current-command () | 5092 | (defun cperl-info-on-current-command () |
| 5086 | "Shows documentation for Perl command at point in other window." | 5093 | "Show documentation for Perl command at point in other window." |
| 5087 | (interactive) | 5094 | (interactive) |
| 5088 | (cperl-info-on-command (cperl-word-at-point))) | 5095 | (cperl-info-on-command (cperl-word-at-point))) |
| 5089 | 5096 | ||
| @@ -5133,7 +5140,7 @@ partially contained in the region are lined up at the same column. | |||
| 5133 | 5140 | ||
| 5134 | MINSHIFT is the minimal amount of space to insert before the construction. | 5141 | MINSHIFT is the minimal amount of space to insert before the construction. |
| 5135 | STEP is the tabwidth to position constructions. | 5142 | STEP is the tabwidth to position constructions. |
| 5136 | If STEP is `nil', `cperl-lineup-step' will be used | 5143 | If STEP is nil, `cperl-lineup-step' will be used |
| 5137 | \(or `cperl-indent-level', if `cperl-lineup-step' is `nil'). | 5144 | \(or `cperl-indent-level', if `cperl-lineup-step' is `nil'). |
| 5138 | Will not move the position at the start to the left." | 5145 | Will not move the position at the start to the left." |
| 5139 | (interactive "r") | 5146 | (interactive "r") |
| @@ -5273,7 +5280,7 @@ See `cperl-lazy-help-time' too." | |||
| 5273 | (auto-fill-mode 0) | 5280 | (auto-fill-mode 0) |
| 5274 | (if cperl-use-syntax-table-text-property-for-tags | 5281 | (if cperl-use-syntax-table-text-property-for-tags |
| 5275 | (progn | 5282 | (progn |
| 5276 | (make-variable-buffer-local 'parse-sexp-lookup-properties) | 5283 | (make-local-variable 'parse-sexp-lookup-properties) |
| 5277 | ;; Do not introduce variable if not needed, we check it! | 5284 | ;; Do not introduce variable if not needed, we check it! |
| 5278 | (set 'parse-sexp-lookup-properties t)))) | 5285 | (set 'parse-sexp-lookup-properties t)))) |
| 5279 | 5286 | ||
| @@ -6919,7 +6926,7 @@ We suppose that the regexp is scanned already." | |||
| 6919 | (cperl-fontify-syntaxically to))))) | 6926 | (cperl-fontify-syntaxically to))))) |
| 6920 | 6927 | ||
| 6921 | (defvar cperl-version | 6928 | (defvar cperl-version |
| 6922 | (let ((v "Revision: 4.21")) | 6929 | (let ((v "Revision: 4.23")) |
| 6923 | (string-match ":\\s *\\([0-9.]+\\)" v) | 6930 | (string-match ":\\s *\\([0-9.]+\\)" v) |
| 6924 | (substring v (match-beginning 1) (match-end 1))) | 6931 | (substring v (match-beginning 1) (match-end 1))) |
| 6925 | "Version of IZ-supported CPerl package this file is based on.") | 6932 | "Version of IZ-supported CPerl package this file is based on.") |