aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-06-07 23:58:48 +0000
committerRichard M. Stallman1998-06-07 23:58:48 +0000
commitbab27c0c4dd739fbc4d4db11a8a137e5b7f629d0 (patch)
tree5f6c24de0a60b30381a7b9316a78063ad6c9fad0
parent026d8713947dc81385c11d234dd3593dbab40816 (diff)
downloademacs-bab27c0c4dd739fbc4d4db11a8a137e5b7f629d0.tar.gz
emacs-bab27c0c4dd739fbc4d4db11a8a137e5b7f629d0.zip
Second half of changes in version 1.4.
-rw-r--r--lisp/progmodes/cperl-mode.el49
1 files changed, 39 insertions, 10 deletions
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index e754e952371..0cfed6739de 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -451,8 +451,19 @@ Before reporting (non-)problems look in the problem section on what I
451know about them.") 451know about them.")
452 452
453(defvar cperl-problems 'please-ignore-this-line 453(defvar cperl-problems 'please-ignore-this-line
454"Emacs had a _very_ restricted syntax parsing engine (until RMS's Emacs 454"Some faces will not be shown on some versions of Emacs unless you
45520.1). 455install choose-color.el, available from
456 ftp://ftp.math.ohio-state.edu/pub/users/ilya/emacs/
457
458Emacs had a _very_ restricted syntax parsing engine until RMS's Emacs
45920.1. Most problems below are corrected starting from this version of
460Emacs, and all of them should go with (future) RMS's version 20.3.
461
462Note that even with newer Emacsen interaction of `font-lock' and
463syntaxification is not cleaned up. You may get slightly different
464colors basing on the order of fontification and syntaxification. This
465might be corrected by setting `cperl-syntaxify-by-font-lock' to t, but
466the corresponding code is still extremely buggy.
456 467
457Even with older Emacsen CPerl mode tries to corrects some Emacs 468Even with older Emacsen CPerl mode tries to corrects some Emacs
458misunderstandings, however, for efficiency reasons the degree of 469misunderstandings, however, for efficiency reasons the degree of
@@ -532,9 +543,9 @@ To speed up coloring the following compromises exist:
532Imenu in 19.31 is broken. Set `imenu-use-keymap-menu' to t, and remove 543Imenu in 19.31 is broken. Set `imenu-use-keymap-menu' to t, and remove
533`car' before `imenu-choose-buffer-index' in `imenu'. 544`car' before `imenu-choose-buffer-index' in `imenu'.
534`imenu-add-to-menubar' in 20.2 is broken. 545`imenu-add-to-menubar' in 20.2 is broken.
535Most things on XEmacs are broken too, judging by bug reports I recieve. 546A lot of things on XEmacs may be broken too, judging by bug reports I
536Note that some releases of XEmacs are better than the others as far as bugs 547recieve. Note that some releases of XEmacs are better than the others
537reports I see are concerned.") 548as far as bugs reports I see are concerned.")
538 549
539(defvar cperl-praise 'please-ignore-this-line 550(defvar cperl-praise 'please-ignore-this-line
540 "RMS asked me to list good things about CPerl. Here they go: 551 "RMS asked me to list good things about CPerl. Here they go:
@@ -546,7 +557,7 @@ mode - but the latter number may have improved too in last years) even
546without `syntax-table' property; When using this property, it should 557without `syntax-table' property; When using this property, it should
547handle 99.995% of lines correct - or somesuch. 558handle 99.995% of lines correct - or somesuch.
548 559
5492) It is generally belived to be \"the most user-friendly Emacs 5602) It is generally believed to be \"the most user-friendly Emacs
550package\" whatever it may mean (I doubt that the people who say similar 561package\" whatever it may mean (I doubt that the people who say similar
551things tried _all_ the rest of Emacs ;-), but this was not a lonely 562things tried _all_ the rest of Emacs ;-), but this was not a lonely
552voice); 563voice);
@@ -1302,7 +1313,8 @@ or as help on variables `cperl-tips', `cperl-problems',
1302 (if cperl-pod-here-scan 1313 (if cperl-pod-here-scan
1303 (or (and (boundp 'font-lock-mode) 1314 (or (and (boundp 'font-lock-mode)
1304 (eval 'font-lock-mode) ; Avoid warning 1315 (eval 'font-lock-mode) ; Avoid warning
1305 (boundp 'font-lock-hot-pass)) ; Newer font-lock 1316 (boundp 'font-lock-hot-pass) ; Newer font-lock
1317 cperl-syntaxify-by-font-lock)
1306 (cperl-find-pods-heres)))) 1318 (cperl-find-pods-heres))))
1307 1319
1308;; Fix for perldb - make default reasonable 1320;; Fix for perldb - make default reasonable
@@ -1496,7 +1508,14 @@ char is \"{\", insert extra newline before only if
1496 (skip-chars-backward "$") 1508 (skip-chars-backward "$")
1497 (looking-at "\\(\\$\\$\\)*\\$\\([^\\$]\\|$\\)")) 1509 (looking-at "\\(\\$\\$\\)*\\$\\([^\\$]\\|$\\)"))
1498 (insert ?\ )) 1510 (insert ?\ ))
1499 (if (cperl-after-expr-p nil "{;)") nil (setq cperl-auto-newline nil)) 1511 ;; Check whether we are in comment
1512 (if (and
1513 (save-excursion
1514 (beginning-of-line)
1515 (not (looking-at "[ \t]*#")))
1516 (cperl-after-expr-p nil "{;)"))
1517 nil
1518 (setq cperl-auto-newline nil))
1500 (cperl-electric-brace arg) 1519 (cperl-electric-brace arg)
1501 (and (cperl-val 'cperl-electric-parens) 1520 (and (cperl-val 'cperl-electric-parens)
1502 (eq last-command-char ?{) 1521 (eq last-command-char ?{)
@@ -3157,7 +3176,8 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3157 (progn 3176 (progn
3158 (forward-sexp -1) 3177 (forward-sexp -1)
3159 (cperl-backward-to-noncomment lim) 3178 (cperl-backward-to-noncomment lim)
3160 (or (eq (preceding-char) ?\) ) ; if () {} sub f () {} 3179 (or (eq (point) lim)
3180 (eq (preceding-char) ?\) ) ; if () {} sub f () {}
3161 (if (eq (char-syntax (preceding-char)) ?w) ; else {} 3181 (if (eq (char-syntax (preceding-char)) ?w) ; else {}
3162 (save-excursion 3182 (save-excursion
3163 (forward-sexp -1) 3183 (forward-sexp -1)
@@ -3190,7 +3210,8 @@ CHARS is a string that contains good characters to have before us (however,
3190 (skip-chars-backward " \t") 3210 (skip-chars-backward " \t")
3191 (if (< p (point)) (goto-char p)) 3211 (if (< p (point)) (goto-char p))
3192 (setq stop t))) 3212 (setq stop t)))
3193 (or (bobp) 3213 (or (bobp) ; ???? Needed
3214 (eq (point) lim)
3194 (progn 3215 (progn
3195 (if test (eval test) 3216 (if test (eval test)
3196 (or (memq (preceding-char) (append (or chars "{;") nil)) 3217 (or (memq (preceding-char) (append (or chars "{;") nil))
@@ -3213,6 +3234,7 @@ CHARS is a string that contains good characters to have before us (however,
3213 (forward-sexp -1) 3234 (forward-sexp -1)
3214 (cperl-backward-to-noncomment (point-min)) 3235 (cperl-backward-to-noncomment (point-min))
3215 (or (bobp) 3236 (or (bobp)
3237 (eq (point) lim)
3216 (not (= (char-syntax (preceding-char)) ?w)) 3238 (not (= (char-syntax (preceding-char)) ?w))
3217 (progn 3239 (progn
3218 (forward-sexp -1) 3240 (forward-sexp -1)
@@ -3435,6 +3457,7 @@ conditional/loop constructs."
3435 (current-column)) 3457 (current-column))
3436 new-comm-indent old-comm-indent) 3458 new-comm-indent old-comm-indent)
3437 (goto-char start) 3459 (goto-char start)
3460 (setq end (set-marker (make-marker) end)) ; indentation changes pos
3438 (or (bolp) (beginning-of-line 2)) 3461 (or (bolp) (beginning-of-line 2))
3439 (or (fboundp 'imenu-progress-message) 3462 (or (fboundp 'imenu-progress-message)
3440 (message "Indenting... For feedback load `imenu'...")) 3463 (message "Indenting... For feedback load `imenu'..."))
@@ -4255,6 +4278,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4255(defconst cperl-styles-entries 4278(defconst cperl-styles-entries
4256 '(cperl-indent-level cperl-brace-offset cperl-continued-brace-offset 4279 '(cperl-indent-level cperl-brace-offset cperl-continued-brace-offset
4257 cperl-label-offset cperl-extra-newline-before-brace 4280 cperl-label-offset cperl-extra-newline-before-brace
4281 cperl-merge-trailing-else
4258 cperl-continued-statement-offset)) 4282 cperl-continued-statement-offset))
4259 4283
4260(defconst cperl-style-alist 4284(defconst cperl-style-alist
@@ -4264,6 +4288,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4264 (cperl-continued-brace-offset . 0) 4288 (cperl-continued-brace-offset . 0)
4265 (cperl-label-offset . -2) 4289 (cperl-label-offset . -2)
4266 (cperl-extra-newline-before-brace . nil) 4290 (cperl-extra-newline-before-brace . nil)
4291 (cperl-merge-trailing-else . t)
4267 (cperl-continued-statement-offset . 2)) 4292 (cperl-continued-statement-offset . 2))
4268 ("PerlStyle" ; CPerl with 4 as indent 4293 ("PerlStyle" ; CPerl with 4 as indent
4269 (cperl-indent-level . 4) 4294 (cperl-indent-level . 4)
@@ -4271,6 +4296,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4271 (cperl-continued-brace-offset . 0) 4296 (cperl-continued-brace-offset . 0)
4272 (cperl-label-offset . -4) 4297 (cperl-label-offset . -4)
4273 (cperl-extra-newline-before-brace . nil) 4298 (cperl-extra-newline-before-brace . nil)
4299 (cperl-merge-trailing-else . t)
4274 (cperl-continued-statement-offset . 4)) 4300 (cperl-continued-statement-offset . 4))
4275 ("GNU" 4301 ("GNU"
4276 (cperl-indent-level . 2) 4302 (cperl-indent-level . 2)
@@ -4278,6 +4304,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4278 (cperl-continued-brace-offset . 0) 4304 (cperl-continued-brace-offset . 0)
4279 (cperl-label-offset . -2) 4305 (cperl-label-offset . -2)
4280 (cperl-extra-newline-before-brace . t) 4306 (cperl-extra-newline-before-brace . t)
4307 (cperl-merge-trailing-else . nil)
4281 (cperl-continued-statement-offset . 2)) 4308 (cperl-continued-statement-offset . 2))
4282 ("K&R" 4309 ("K&R"
4283 (cperl-indent-level . 5) 4310 (cperl-indent-level . 5)
@@ -4285,6 +4312,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4285 (cperl-continued-brace-offset . -5) 4312 (cperl-continued-brace-offset . -5)
4286 (cperl-label-offset . -5) 4313 (cperl-label-offset . -5)
4287 ;;(cperl-extra-newline-before-brace . nil) ; ??? 4314 ;;(cperl-extra-newline-before-brace . nil) ; ???
4315 (cperl-merge-trailing-else . nil)
4288 (cperl-continued-statement-offset . 5)) 4316 (cperl-continued-statement-offset . 5))
4289 ("BSD" 4317 ("BSD"
4290 (cperl-indent-level . 4) 4318 (cperl-indent-level . 4)
@@ -4299,6 +4327,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4299 (cperl-continued-brace-offset . -4) 4327 (cperl-continued-brace-offset . -4)
4300 (cperl-label-offset . -4) 4328 (cperl-label-offset . -4)
4301 (cperl-continued-statement-offset . 4) 4329 (cperl-continued-statement-offset . 4)
4330 (cperl-merge-trailing-else . nil)
4302 (cperl-extra-newline-before-brace . t)) 4331 (cperl-extra-newline-before-brace . t))
4303 ("Current") 4332 ("Current")
4304 ("Whitesmith" 4333 ("Whitesmith"