diff options
| author | Stephen Eglen | 1998-02-22 20:03:39 +0000 |
|---|---|---|
| committer | Stephen Eglen | 1998-02-22 20:03:39 +0000 |
| commit | ccc3ce39b45078690269ce3aa674f433bcf1ba9c (patch) | |
| tree | 08a717a0176c72acd3e2184c847a840fbc6a88fb | |
| parent | 5636765c529be5dfbdc3aed7ecd4c0a9f58b8eb7 (diff) | |
| download | emacs-ccc3ce39b45078690269ce3aa674f433bcf1ba9c.tar.gz emacs-ccc3ce39b45078690269ce3aa674f433bcf1ba9c.zip | |
Commented out line 471 (miniperl entry in interpreter-mode-alist)
Removed stray =06 entry on line 4445.
Customized.
| -rw-r--r-- | lisp/progmodes/cperl-mode.el | 287 |
1 files changed, 188 insertions, 99 deletions
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 8dee6a6dfe5..784a0166a7f 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el | |||
| @@ -63,9 +63,14 @@ | |||
| 63 | 63 | ||
| 64 | ;;; Code: | 64 | ;;; Code: |
| 65 | 65 | ||
| 66 | (defgroup cperl nil | ||
| 67 | "Major mode for editing Perl code." | ||
| 68 | :prefix "cperl-" | ||
| 69 | :group 'languages) | ||
| 70 | |||
| 66 | (defconst cperl-xemacs-p (string-match "XEmacs\\|Lucid" emacs-version)) | 71 | (defconst cperl-xemacs-p (string-match "XEmacs\\|Lucid" emacs-version)) |
| 67 | 72 | ||
| 68 | (defvar cperl-extra-newline-before-brace nil | 73 | (defcustom cperl-extra-newline-before-brace nil |
| 69 | "*Non-nil means that if, elsif, while, until, else, for, foreach | 74 | "*Non-nil means that if, elsif, while, until, else, for, foreach |
| 70 | and do constructs look like: | 75 | and do constructs look like: |
| 71 | 76 | ||
| @@ -77,152 +82,235 @@ instead of: | |||
| 77 | 82 | ||
| 78 | if () { | 83 | if () { |
| 79 | } | 84 | } |
| 80 | ") | 85 | " |
| 86 | :type 'boolean | ||
| 87 | :group 'cperl) | ||
| 88 | |||
| 89 | (defcustom cperl-indent-level 2 | ||
| 90 | "*Indentation of CPerl statements with respect to containing block." | ||
| 91 | :type 'integer | ||
| 92 | :group 'cperl) | ||
| 81 | 93 | ||
| 82 | (defvar cperl-indent-level 2 | 94 | (defcustom cperl-lineup-step nil |
| 83 | "*Indentation of CPerl statements with respect to containing block.") | ||
| 84 | (defvar cperl-lineup-step nil | ||
| 85 | "*`cperl-lineup' will always lineup at multiple of this number. | 95 | "*`cperl-lineup' will always lineup at multiple of this number. |
| 86 | If `nil', the value of `cperl-indent-level' will be used.") | 96 | If `nil', the value of `cperl-indent-level' will be used." |
| 87 | (defvar cperl-brace-imaginary-offset 0 | 97 | :type '(choice (const nil) integer) |
| 98 | :group 'cperl) | ||
| 99 | (defcustom cperl-brace-imaginary-offset 0 | ||
| 88 | "*Imagined indentation of a Perl open brace that actually follows a statement. | 100 | "*Imagined indentation of a Perl open brace that actually follows a statement. |
| 89 | An open brace following other text is treated as if it were this far | 101 | An open brace following other text is treated as if it were this far |
| 90 | to the right of the start of its line.") | 102 | to the right of the start of its line." |
| 91 | (defvar cperl-brace-offset 0 | 103 | :type 'integer |
| 92 | "*Extra indentation for braces, compared with other text in same context.") | 104 | :group 'cperl) |
| 93 | (defvar cperl-label-offset -2 | 105 | |
| 94 | "*Offset of CPerl label lines relative to usual indentation.") | 106 | (defcustom cperl-brace-offset 0 |
| 95 | (defvar cperl-min-label-indent 1 | 107 | "*Extra indentation for braces, compared with other text in same context." |
| 96 | "*Minimal offset of CPerl label lines.") | 108 | :type 'integer |
| 97 | (defvar cperl-continued-statement-offset 2 | 109 | :group 'cperl) |
| 98 | "*Extra indent for lines not starting new statements.") | 110 | (defcustom cperl-label-offset -2 |
| 99 | (defvar cperl-continued-brace-offset 0 | 111 | "*Offset of CPerl label lines relative to usual indentation." |
| 112 | :type 'integer | ||
| 113 | :group 'cperl) | ||
| 114 | (defcustom cperl-min-label-indent 1 | ||
| 115 | "*Minimal offset of CPerl label lines." | ||
| 116 | :type 'integer | ||
| 117 | :group 'cperl) | ||
| 118 | (defcustom cperl-continued-statement-offset 2 | ||
| 119 | "*Extra indent for lines not starting new statements." | ||
| 120 | :type 'integer | ||
| 121 | :group 'cperl) | ||
| 122 | (defcustom cperl-continued-brace-offset 0 | ||
| 100 | "*Extra indent for substatements that start with open-braces. | 123 | "*Extra indent for substatements that start with open-braces. |
| 101 | This is in addition to cperl-continued-statement-offset.") | 124 | This is in addition to cperl-continued-statement-offset." |
| 102 | (defvar cperl-close-paren-offset -1 | 125 | :type 'integer |
| 103 | "*Extra indent for substatements that start with close-parenthesis.") | 126 | :group 'cperl) |
| 104 | 127 | (defcustom cperl-close-paren-offset -1 | |
| 105 | (defvar cperl-auto-newline nil | 128 | "*Extra indent for substatements that start with close-parenthesis." |
| 129 | :type 'integer | ||
| 130 | :group 'cperl) | ||
| 131 | |||
| 132 | (defcustom cperl-auto-newline nil | ||
| 106 | "*Non-nil means automatically newline before and after braces, | 133 | "*Non-nil means automatically newline before and after braces, |
| 107 | and after colons and semicolons, inserted in CPerl code. The following | 134 | and after colons and semicolons, inserted in CPerl code. The following |
| 108 | \\[cperl-electric-backspace] will remove the inserted whitespace. | 135 | \\[cperl-electric-backspace] will remove the inserted whitespace. |
| 109 | Insertion after colons requires both this variable and | 136 | Insertion after colons requires both this variable and |
| 110 | `cperl-auto-newline-after-colon' set.") | 137 | `cperl-auto-newline-after-colon' set." |
| 138 | :type 'boolean | ||
| 139 | :group 'cperl) | ||
| 111 | 140 | ||
| 112 | (defvar cperl-auto-newline-after-colon nil | 141 | (defcustom cperl-auto-newline-after-colon nil |
| 113 | "*Non-nil means automatically newline even after colons. | 142 | "*Non-nil means automatically newline even after colons. |
| 114 | Subject to `cperl-auto-newline' setting.") | 143 | Subject to `cperl-auto-newline' setting." |
| 144 | :type 'boolean | ||
| 145 | :group 'cperl) | ||
| 115 | 146 | ||
| 116 | (defvar cperl-tab-always-indent t | 147 | (defcustom cperl-tab-always-indent t |
| 117 | "*Non-nil means TAB in CPerl mode should always reindent the current line, | 148 | "*Non-nil means TAB in CPerl mode should always reindent the current line, |
| 118 | regardless of where in the line point is when the TAB command is used.") | 149 | regardless of where in the line point is when the TAB command is used." |
| 150 | :type 'boolean | ||
| 151 | :group 'cperl) | ||
| 119 | 152 | ||
| 120 | (defvar cperl-font-lock nil | 153 | (defcustom cperl-font-lock nil |
| 121 | "*Non-nil (and non-null) means CPerl buffers will use font-lock-mode. | 154 | "*Non-nil (and non-null) means CPerl buffers will use font-lock-mode. |
| 122 | Can be overwritten by `cperl-hairy' if nil.") | 155 | Can be overwritten by `cperl-hairy' if nil." |
| 156 | :type 'boolean | ||
| 157 | :group 'cperl) | ||
| 123 | 158 | ||
| 124 | (defvar cperl-electric-lbrace-space nil | 159 | (defcustom cperl-electric-lbrace-space nil |
| 125 | "*Non-nil (and non-null) means { after $ in CPerl buffers should be preceded by ` '. | 160 | "*Non-nil (and non-null) means { after $ in CPerl buffers should be preceded by ` '. |
| 126 | Can be overwritten by `cperl-hairy' if nil.") | 161 | Can be overwritten by `cperl-hairy' if nil." |
| 162 | :type 'boolean | ||
| 163 | :group 'cperl) | ||
| 127 | 164 | ||
| 128 | (defvar cperl-electric-parens-string "({[]})<" | 165 | (defcustom cperl-electric-parens-string "({[]})<" |
| 129 | "*String of parentheses that should be electric in CPerl. | 166 | "*String of parentheses that should be electric in CPerl. |
| 130 | Closing ones are electric only if the region is highlighted.") | 167 | Closing ones are electric only if the region is highlighted." |
| 168 | :type 'string | ||
| 169 | :group 'cperl) | ||
| 131 | 170 | ||
| 132 | (defvar cperl-electric-parens nil | 171 | (defcustom cperl-electric-parens nil |
| 133 | "*Non-nil (and non-null) means parentheses should be electric in CPerl. | 172 | "*Non-nil (and non-null) means parentheses should be electric in CPerl. |
| 134 | Can be overwritten by `cperl-hairy' if nil.") | 173 | Can be overwritten by `cperl-hairy' if nil." |
| 135 | (defvar cperl-electric-parens-mark | 174 | :type 'boolean |
| 175 | :group 'cperl) | ||
| 176 | (defcustom cperl-electric-parens-mark | ||
| 136 | (and window-system | 177 | (and window-system |
| 137 | (or (and (boundp 'transient-mark-mode) ; For Emacs | 178 | (or (and (boundp 'transient-mark-mode) ; For Emacs |
| 138 | transient-mark-mode) | 179 | transient-mark-mode) |
| 139 | (and (boundp 'zmacs-regions) ; For XEmacs | 180 | (and (boundp 'zmacs-regions) ; For XEmacs |
| 140 | zmacs-regions))) | 181 | zmacs-regions))) |
| 141 | "*Not-nil means that electric parens look for active mark. | 182 | "*Not-nil means that electric parens look for active mark. |
| 142 | Default is yes if there is visual feedback on mark.") | 183 | Default is yes if there is visual feedback on mark." |
| 184 | :type 'boolean | ||
| 185 | :group 'cperl) | ||
| 143 | 186 | ||
| 144 | (defvar cperl-electric-linefeed nil | 187 | (defcustom cperl-electric-linefeed nil |
| 145 | "*If true, LFD should be hairy in CPerl, otherwise C-c LFD is hairy. | 188 | "*If true, LFD should be hairy in CPerl, otherwise C-c LFD is hairy. |
| 146 | In any case these two mean plain and hairy linefeeds together. | 189 | In any case these two mean plain and hairy linefeeds together. |
| 147 | Can be overwritten by `cperl-hairy' if nil.") | 190 | Can be overwritten by `cperl-hairy' if nil." |
| 191 | :type 'boolean | ||
| 192 | :group 'cperl) | ||
| 148 | 193 | ||
| 149 | (defvar cperl-electric-keywords nil | 194 | (defcustom cperl-electric-keywords nil |
| 150 | "*Not-nil (and non-null) means keywords are electric in CPerl. | 195 | "*Not-nil (and non-null) means keywords are electric in CPerl. |
| 151 | Can be overwritten by `cperl-hairy' if nil.") | 196 | Can be overwritten by `cperl-hairy' if nil." |
| 152 | 197 | :type 'boolean | |
| 153 | (defvar cperl-hairy nil | 198 | :group 'cperl) |
| 154 | "*Not-nil means all the bells and whistles are enabled in CPerl.") | 199 | |
| 155 | 200 | (defcustom cperl-hairy nil | |
| 156 | (defvar cperl-comment-column 32 | 201 | "*Not-nil means all the bells and whistles are enabled in CPerl." |
| 157 | "*Column to put comments in CPerl (use \\[cperl-indent]' to lineup with code).") | 202 | :type 'boolean |
| 158 | 203 | :group 'cperl) | |
| 159 | (defvar cperl-vc-header-alist '((SCCS "$sccs = '%W\%' ;") | 204 | |
| 160 | (RCS "$rcs = ' $Id\$ ' ;")) | 205 | (defcustom cperl-comment-column 32 |
| 161 | "*What to use as `vc-header-alist' in CPerl.") | 206 | "*Column to put comments in CPerl (use \\[cperl-indent] to lineup with code)." |
| 162 | 207 | :type 'integer | |
| 163 | (defvar cperl-info-on-command-no-prompt nil | 208 | :group 'cperl) |
| 209 | |||
| 210 | (defcustom cperl-vc-header-alist '((SCCS "$sccs = '%W\%' ;") | ||
| 211 | (RCS "$rcs = ' $Id\$ ' ;")) | ||
| 212 | "*What to use as `vc-header-alist' in CPerl." | ||
| 213 | :type '(repeat (list symbol string)) | ||
| 214 | :group 'cperl) | ||
| 215 | |||
| 216 | (defcustom cperl-info-on-command-no-prompt nil | ||
| 164 | "*Not-nil (and non-null) means not to prompt on C-h f. | 217 | "*Not-nil (and non-null) means not to prompt on C-h f. |
| 165 | The opposite behaviour is always available if prefixed with C-c. | 218 | The opposite behaviour is always available if prefixed with C-c. |
| 166 | Can be overwritten by `cperl-hairy' if nil.") | 219 | Can be overwritten by `cperl-hairy' if nil." |
| 220 | :type 'boolean | ||
| 221 | :group 'cperl) | ||
| 167 | 222 | ||
| 168 | (defvar cperl-lazy-help-time nil | 223 | (defcustom cperl-lazy-help-time nil |
| 169 | "*Not-nil (and non-null) means to show lazy help after given idle time.") | 224 | "*Not-nil (and non-null) means to show lazy help after given idle time." |
| 225 | :type 'boolean | ||
| 226 | :group 'cperl) | ||
| 170 | 227 | ||
| 171 | (defvar cperl-pod-face 'font-lock-comment-face | 228 | (defcustom cperl-pod-face 'font-lock-comment-face |
| 172 | "*The result of evaluation of this expression is used for pod highlighting.") | 229 | "*The result of evaluation of this expression is used for pod highlighting." |
| 230 | :type 'face | ||
| 231 | :group 'cperl) | ||
| 173 | 232 | ||
| 174 | (defvar cperl-pod-head-face 'font-lock-variable-name-face | 233 | (defcustom cperl-pod-head-face 'font-lock-variable-name-face |
| 175 | "*The result of evaluation of this expression is used for pod highlighting. | 234 | "*The result of evaluation of this expression is used for pod highlighting. |
| 176 | Font for POD headers.") | 235 | Font for POD headers." |
| 236 | :type 'face | ||
| 237 | :group 'cperl) | ||
| 177 | 238 | ||
| 178 | (defvar cperl-here-face 'font-lock-string-face | 239 | (defcustom cperl-here-face 'font-lock-string-face |
| 179 | "*The result of evaluation of this expression is used for here-docs highlighting.") | 240 | "*The result of evaluation of this expression is used for here-docs highlighting." |
| 241 | :type 'face | ||
| 242 | :group 'cperl) | ||
| 180 | 243 | ||
| 181 | (defvar cperl-pod-here-fontify '(featurep 'font-lock) | 244 | (defcustom cperl-pod-here-fontify '(featurep 'font-lock) |
| 182 | "*Not-nil after evaluation means to highlight pod and here-docs sections.") | 245 | "*Not-nil after evaluation means to highlight pod and here-docs sections." |
| 246 | :type 'boolean | ||
| 247 | :group 'cperl) | ||
| 183 | 248 | ||
| 184 | (defvar cperl-pod-here-scan t | 249 | (defcustom cperl-pod-here-scan t |
| 185 | "*Not-nil means look for pod and here-docs sections during startup. | 250 | "*Not-nil means look for pod and here-docs sections during startup. |
| 186 | You can always make lookup from menu or using \\[cperl-find-pods-heres].") | 251 | You can always make lookup from menu or using \\[cperl-find-pods-heres]." |
| 252 | :type 'boolean | ||
| 253 | :group 'cperl) | ||
| 187 | 254 | ||
| 188 | (defvar cperl-imenu-addback nil | 255 | (defcustom cperl-imenu-addback nil |
| 189 | "*Not-nil means add backreferences to generated `imenu's. | 256 | "*Not-nil means add backreferences to generated `imenu's. |
| 190 | May require patched `imenu' and `imenu-go'.") | 257 | May require patched `imenu' and `imenu-go'." |
| 258 | :type 'boolean | ||
| 259 | :group 'cperl) | ||
| 191 | 260 | ||
| 192 | (defvar cperl-max-help-size 66 | 261 | (defcustom cperl-max-help-size 66 |
| 193 | "*Non-nil means shrink-wrapping of info-buffer allowed up to these percents.") | 262 | "*Non-nil means shrink-wrapping of info-buffer allowed up to these percents." |
| 263 | :type '(choice integer (const nil)) | ||
| 264 | :group 'cperl) | ||
| 194 | 265 | ||
| 195 | (defvar cperl-shrink-wrap-info-frame t | 266 | (defcustom cperl-shrink-wrap-info-frame t |
| 196 | "*Non-nil means shrink-wrapping of info-buffer-frame allowed.") | 267 | "*Non-nil means shrink-wrapping of info-buffer-frame allowed." |
| 268 | :type 'boolean | ||
| 269 | :group 'cperl) | ||
| 197 | 270 | ||
| 198 | (defvar cperl-info-page "perl" | 271 | (defcustom cperl-info-page "perl" |
| 199 | "*Name of the info page containing perl docs. | 272 | "*Name of the info page containing perl docs. |
| 200 | Older version of this page was called `perl5', newer `perl'.") | 273 | Older version of this page was called `perl5', newer `perl'." |
| 274 | :type 'string | ||
| 275 | :group 'cperl) | ||
| 201 | 276 | ||
| 202 | (defvar cperl-use-syntax-table-text-property | 277 | (defcustom cperl-use-syntax-table-text-property |
| 203 | (boundp 'parse-sexp-lookup-properties) | 278 | (boundp 'parse-sexp-lookup-properties) |
| 204 | "*Non-nil means CPerl sets up and uses `syntax-table' text property.") | 279 | "*Non-nil means CPerl sets up and uses `syntax-table' text property." |
| 280 | :type 'boolean | ||
| 281 | :group 'cperl) | ||
| 205 | 282 | ||
| 206 | (defvar cperl-use-syntax-table-text-property-for-tags | 283 | (defcustom cperl-use-syntax-table-text-property-for-tags |
| 207 | cperl-use-syntax-table-text-property | 284 | cperl-use-syntax-table-text-property |
| 208 | "*Non-nil means: set up and use `syntax-table' text property generating TAGS.") | 285 | "*Non-nil means: set up and use `syntax-table' text property generating TAGS." |
| 209 | 286 | :type 'boolean | |
| 210 | (defvar cperl-scan-files-regexp "\\.\\([pP][Llm]\\|xs\\)$" | 287 | :group 'cperl) |
| 211 | "*Regexp to match files to scan when generating TAGS.") | 288 | |
| 212 | 289 | (defcustom cperl-scan-files-regexp "\\.\\([pP][Llm]\\|xs\\)$" | |
| 213 | (defvar cperl-noscan-files-regexp "/\\(\\.\\.?\\|SCCS\\|RCS\\|blib\\)$" | 290 | "*Regexp to match files to scan when generating TAGS." |
| 214 | "*Regexp to match files/dirs to skip when generating TAGS.") | 291 | :type 'regexp |
| 215 | 292 | :group 'cperl) | |
| 216 | (defvar cperl-regexp-indent-step nil | 293 | |
| 217 | "*indentation used when beautifying regexps. | 294 | (defcustom cperl-noscan-files-regexp "/\\(\\.\\.?\\|SCCS\\|RCS\\|blib\\)$" |
| 218 | If `nil', the value of `cperl-indent-level' will be used.") | 295 | "*Regexp to match files/dirs to skip when generating TAGS." |
| 219 | 296 | :type 'regexp | |
| 220 | (defvar cperl-indent-left-aligned-comments t | 297 | :group 'cperl) |
| 221 | "*Non-nil means that the comment starting in leftmost column should indent.") | 298 | |
| 222 | 299 | (defcustom cperl-regexp-indent-step nil | |
| 223 | (defvar cperl-under-as-char t | 300 | "*Indentation used when beautifying regexps. |
| 224 | "*Non-nil means that the _ (underline) should be treated as word char.") | 301 | If `nil', the value of `cperl-indent-level' will be used." |
| 225 | 302 | :type '(choice integer (const nil)) | |
| 303 | :group 'cperl) | ||
| 304 | |||
| 305 | (defcustom cperl-indent-left-aligned-comments t | ||
| 306 | "*Non-nil means that the comment starting in leftmost column should indent." | ||
| 307 | :type 'boolean | ||
| 308 | :group 'cperl) | ||
| 309 | |||
| 310 | (defcustom cperl-under-as-char t | ||
| 311 | "*Non-nil means that the _ (underline) should be treated as word char." | ||
| 312 | :type 'boolean | ||
| 313 | :group 'cperl) | ||
| 226 | 314 | ||
| 227 | 315 | ||
| 228 | 316 | ||
| @@ -458,8 +546,10 @@ progress indicator for indentation (with `imenu' loaded). | |||
| 458 | (put-text-property (max (point-min) (1- from)) | 546 | (put-text-property (max (point-min) (1- from)) |
| 459 | to cperl-do-not-fontify t)) | 547 | to cperl-do-not-fontify t)) |
| 460 | 548 | ||
| 461 | (defvar cperl-mode-hook nil | 549 | (defcustom cperl-mode-hook nil |
| 462 | "Hook run by `cperl-mode'.") | 550 | "Hook run by `cperl-mode'." |
| 551 | :type 'hook | ||
| 552 | :group 'cperl) | ||
| 463 | 553 | ||
| 464 | 554 | ||
| 465 | ;;; Probably it is too late to set these guys already, but it can help later: | 555 | ;;; Probably it is too late to set these guys already, but it can help later: |
| @@ -468,7 +558,7 @@ progress indicator for indentation (with `imenu' loaded). | |||
| 468 | ;;; (append '(("\\.\\([pP][Llm]\\|al\\)$" . perl-mode)) auto-mode-alist )) | 558 | ;;; (append '(("\\.\\([pP][Llm]\\|al\\)$" . perl-mode)) auto-mode-alist )) |
| 469 | ;;;(and (boundp 'interpreter-mode-alist) | 559 | ;;;(and (boundp 'interpreter-mode-alist) |
| 470 | ;;; (setq interpreter-mode-alist (append interpreter-mode-alist | 560 | ;;; (setq interpreter-mode-alist (append interpreter-mode-alist |
| 471 | '(("miniperl" . perl-mode))))) | 561 | ;;; '(("miniperl" . perl-mode))))) |
| 472 | (if (fboundp 'eval-when-compile) | 562 | (if (fboundp 'eval-when-compile) |
| 473 | (eval-when-compile | 563 | (eval-when-compile |
| 474 | (condition-case nil | 564 | (condition-case nil |
| @@ -4442,7 +4532,6 @@ Currently it is tuned to C and Perl syntax." | |||
| 4442 | found-bad found))) | 4532 | found-bad found))) |
| 4443 | (not not-found))) | 4533 | (not not-found))) |
| 4444 | 4534 | ||
| 4445 | =06 | ||
| 4446 | ;;; Getting help | 4535 | ;;; Getting help |
| 4447 | (defvar cperl-have-help-regexp | 4536 | (defvar cperl-have-help-regexp |
| 4448 | ;;(concat "\\(" | 4537 | ;;(concat "\\(" |