know about them.")
(defvar cperl-problems 'please-ignore-this-line
-"Emacs had a _very_ restricted syntax parsing engine (until RMS's Emacs
-20.1).
+"Some faces will not be shown on some versions of Emacs unless you
+install choose-color.el, available from
+ ftp://ftp.math.ohio-state.edu/pub/users/ilya/emacs/
+
+Emacs had a _very_ restricted syntax parsing engine until RMS's Emacs
+20.1. Most problems below are corrected starting from this version of
+Emacs, and all of them should go with (future) RMS's version 20.3.
+
+Note that even with newer Emacsen interaction of `font-lock' and
+syntaxification is not cleaned up. You may get slightly different
+colors basing on the order of fontification and syntaxification. This
+might be corrected by setting `cperl-syntaxify-by-font-lock' to t, but
+the corresponding code is still extremely buggy.
Even with older Emacsen CPerl mode tries to corrects some Emacs
misunderstandings, however, for efficiency reasons the degree of
Imenu in 19.31 is broken. Set `imenu-use-keymap-menu' to t, and remove
`car' before `imenu-choose-buffer-index' in `imenu'.
`imenu-add-to-menubar' in 20.2 is broken.
-Most things on XEmacs are broken too, judging by bug reports I recieve.
-Note that some releases of XEmacs are better than the others as far as bugs
-reports I see are concerned.")
+A lot of things on XEmacs may be broken too, judging by bug reports I
+recieve. Note that some releases of XEmacs are better than the others
+as far as bugs reports I see are concerned.")
(defvar cperl-praise 'please-ignore-this-line
"RMS asked me to list good things about CPerl. Here they go:
without `syntax-table' property; When using this property, it should
handle 99.995% of lines correct - or somesuch.
-2) It is generally belived to be \"the most user-friendly Emacs
+2) It is generally believed to be \"the most user-friendly Emacs
package\" whatever it may mean (I doubt that the people who say similar
things tried _all_ the rest of Emacs ;-), but this was not a lonely
voice);
(if cperl-pod-here-scan
(or (and (boundp 'font-lock-mode)
(eval 'font-lock-mode) ; Avoid warning
- (boundp 'font-lock-hot-pass)) ; Newer font-lock
+ (boundp 'font-lock-hot-pass) ; Newer font-lock
+ cperl-syntaxify-by-font-lock)
(cperl-find-pods-heres))))
\f
;; Fix for perldb - make default reasonable
(skip-chars-backward "$")
(looking-at "\\(\\$\\$\\)*\\$\\([^\\$]\\|$\\)"))
(insert ?\ ))
- (if (cperl-after-expr-p nil "{;)") nil (setq cperl-auto-newline nil))
+ ;; Check whether we are in comment
+ (if (and
+ (save-excursion
+ (beginning-of-line)
+ (not (looking-at "[ \t]*#")))
+ (cperl-after-expr-p nil "{;)"))
+ nil
+ (setq cperl-auto-newline nil))
(cperl-electric-brace arg)
(and (cperl-val 'cperl-electric-parens)
(eq last-command-char ?{)
(progn
(forward-sexp -1)
(cperl-backward-to-noncomment lim)
- (or (eq (preceding-char) ?\) ) ; if () {} sub f () {}
+ (or (eq (point) lim)
+ (eq (preceding-char) ?\) ) ; if () {} sub f () {}
(if (eq (char-syntax (preceding-char)) ?w) ; else {}
(save-excursion
(forward-sexp -1)
(skip-chars-backward " \t")
(if (< p (point)) (goto-char p))
(setq stop t)))
- (or (bobp)
+ (or (bobp) ; ???? Needed
+ (eq (point) lim)
(progn
(if test (eval test)
(or (memq (preceding-char) (append (or chars "{;") nil))
(forward-sexp -1)
(cperl-backward-to-noncomment (point-min))
(or (bobp)
+ (eq (point) lim)
(not (= (char-syntax (preceding-char)) ?w))
(progn
(forward-sexp -1)
(current-column))
new-comm-indent old-comm-indent)
(goto-char start)
+ (setq end (set-marker (make-marker) end)) ; indentation changes pos
(or (bolp) (beginning-of-line 2))
(or (fboundp 'imenu-progress-message)
(message "Indenting... For feedback load `imenu'..."))
(defconst cperl-styles-entries
'(cperl-indent-level cperl-brace-offset cperl-continued-brace-offset
cperl-label-offset cperl-extra-newline-before-brace
+ cperl-merge-trailing-else
cperl-continued-statement-offset))
(defconst cperl-style-alist
(cperl-continued-brace-offset . 0)
(cperl-label-offset . -2)
(cperl-extra-newline-before-brace . nil)
+ (cperl-merge-trailing-else . t)
(cperl-continued-statement-offset . 2))
("PerlStyle" ; CPerl with 4 as indent
(cperl-indent-level . 4)
(cperl-continued-brace-offset . 0)
(cperl-label-offset . -4)
(cperl-extra-newline-before-brace . nil)
+ (cperl-merge-trailing-else . t)
(cperl-continued-statement-offset . 4))
("GNU"
(cperl-indent-level . 2)
(cperl-continued-brace-offset . 0)
(cperl-label-offset . -2)
(cperl-extra-newline-before-brace . t)
+ (cperl-merge-trailing-else . nil)
(cperl-continued-statement-offset . 2))
("K&R"
(cperl-indent-level . 5)
(cperl-continued-brace-offset . -5)
(cperl-label-offset . -5)
;;(cperl-extra-newline-before-brace . nil) ; ???
+ (cperl-merge-trailing-else . nil)
(cperl-continued-statement-offset . 5))
("BSD"
(cperl-indent-level . 4)
(cperl-continued-brace-offset . -4)
(cperl-label-offset . -4)
(cperl-continued-statement-offset . 4)
+ (cperl-merge-trailing-else . nil)
(cperl-extra-newline-before-brace . t))
("Current")
("Whitesmith"