--- cperl-mode.el.1.33 Sun Jun 23 18:02:26 2002 +++ cperl-mode.el Sun Jun 23 18:36:29 2002 @@ -390,7 +390,7 @@ Currently only changes how scalar variables are highlighted. Note that that variable is only read at initialization time for the variable `cperl-font-lock-keywords-2', so changing it after you've -entered `cperl-mode' the first time will have no effect." +entered CPerl mode the first time will have no effect." :type 'boolean :group 'cperl) @@ -510,8 +510,8 @@ :type 'boolean :group 'cperl-indentation-details) -(defcustom cperl-syntaxify-by-font-lock - (and window-system +(defcustom cperl-syntaxify-by-font-lock + (and window-system (boundp 'parse-sexp-lookup-properties)) "*Non-nil means that CPerl uses `font-lock's routines for syntaxification." :type '(choice (const message) boolean) @@ -519,7 +519,7 @@ (defcustom cperl-syntaxify-unwind t - "*Non-nil means that CPerl unwinds to a start of along construction + "*Non-nil means that CPerl unwinds to a start of a long construction when syntaxifying a chunk of buffer." :type 'boolean :group 'cperl-speed) @@ -621,7 +621,7 @@ (defalias 'perl-mode 'cperl-mode) -Get perl5-info from +Get perl5-info from $CPAN/doc/manual/info/perl-info.tar.gz older version was on http://www.metronet.com:70/9/perlinfo/perl5/manual/perl5-info.tar.gz @@ -653,7 +653,7 @@ micro-docs on what I know about CPerl problems.") (defvar cperl-problems 'please-ignore-this-line -"Some faces will not be shown on some versions of Emacs unless you + "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/ @@ -702,7 +702,7 @@ via `cperl-use-syntax-table-text-property'." ) (defvar cperl-non-problems 'please-ignore-this-line -"As you know from `problems' section, Perl syntax is too hard for CPerl on + "As you know from `problems' section, Perl syntax is too hard for CPerl on older Emacsen. Here is what you can do if you cannot upgrade, or if you want to switch off these capabilities on Emacs 20.2 (+patches) or 20.3 or better. Please skip this docs if you run a capable Emacs already. @@ -897,7 +897,7 @@ syntaxically to be not code `font-lock-constant-face' HERE-doc delimiters, labels, delimiters of 2-arg operators s/y/tr/ or of RExen, - `font-lock-function-name-face' Special-cased m// and s//foo/, _ as + `font-lock-function-name-face' Special-cased m// and s//foo/, _ as a target of a file tests, file tests, subroutine names at the moment of definition (except those conflicting with Perl operators), @@ -987,7 +987,7 @@ to cperl-do-not-fontify t))) (defcustom cperl-mode-hook nil - "Hook run by `cperl-mode'." + "Hook run by CPerl mode." :type 'hook :group 'cperl) @@ -1041,7 +1041,7 @@ (require 'cl)) (defvar cperl-mode-abbrev-table nil - "Abbrev table in use in Cperl-mode buffers.") + "Abbrev table in use in CPerl mode buffers.") (add-hook 'edit-var-mode-alist '(perl-mode (regexp . "^cperl-"))) @@ -1253,10 +1253,10 @@ (concat cperl-imenu--function-name-regexp-perl "\\|" "\\`")) (defvar cperl-mode-syntax-table nil - "Syntax table in use in Cperl-mode buffers.") + "Syntax table in use in CPerl mode buffers.") (defvar cperl-string-syntax-table nil - "Syntax table in use in Cperl-mode string-like chunks.") + "Syntax table in use in CPerl mode string-like chunks.") (if cperl-mode-syntax-table () @@ -1303,7 +1303,7 @@ well, with optional special formatting done on {}. (Disabled by default.) You can always quote (with \\[quoted-insert]) the left \"paren\" to avoid the expansion. The processing of < is special, -since most the time you mean \"less\". Cperl mode tries to guess +since most the time you mean \"less\". CPerl mode tries to guess whether you want to type pair <>, and inserts is if it appropriate. You can set `cperl-electric-parens-string' to the string that contains the parenths from the above list you want to be electrical. @@ -1968,7 +1968,7 @@ head1 notlast name p really-delete over) (and (save-excursion (forward-word -1) - (and + (and (eq (preceding-char) ?=) (progn (setq head1 (looking-at "head1\\>[ \t]*$")) @@ -1980,8 +1980,8 @@ (get-text-property (point) 'in-pod) (cperl-after-expr-p nil "{;:") (and (re-search-backward - ;; "\\(\\`\n?\\|\n\n\\)=\\sw+" - "\\(\\`\n?\\|^\n\\)=\\sw+" + ;; "\\(\\`\n?\\|\n\n\\)=\\sw+" + "\\(\\`\n?\\|^\n\\)=\\sw+" (point-min) t) (not (or (looking-at "=cut") @@ -1996,13 +1996,13 @@ (insert "\n\n=cut") (cperl-ensure-newlines 2) (forward-word -2) - (if (and head1 - (not + (if (and head1 + (not (save-excursion (forward-char -1) (re-search-backward "\\(\\`\n?\\|\n\n\\)=head1\\>" nil t)))) ; Only one - (progn + (progn (forward-word 1) (setq name (file-name-sans-extension (file-name-nondirectory (buffer-file-name))) @@ -2524,7 +2524,7 @@ (list pre-indent-point))) 0) cperl-continued-statement-offset)))) - ((not + ((not (or (setq is-block (and (setq delim (= (char-after containing-sexp) ?{)) (save-excursion ; Is it a hash? @@ -2575,7 +2575,7 @@ ;;; (skip-chars-forward " \t")) ;;; (+ (current-column) ; Correct indentation of trailing ?\} ;;; (if (eq char-after ?\}) (+ cperl-indent-level -;;; cperl-close-paren-offset) +;;; cperl-close-paren-offset) ;;; 0))) (t ;; Statement level. Is it a continuation or a new statement? @@ -2602,7 +2602,7 @@ (memq (preceding-char) (append (if is-block " ;{" " ,;{") '(nil))) (and (eq (preceding-char) ?\}) - (cperl-after-block-and-statement-beg + (cperl-after-block-and-statement-beg containing-sexp)))) ;; This line is continuation of preceding line's statement; ;; indent `cperl-continued-statement-offset' more than the @@ -2615,7 +2615,7 @@ (+ (if (memq char-after (append "}])" nil)) 0 ; Closing parenth cperl-continued-statement-offset) - (if (or is-block + (if (or is-block (not delim) (not (eq char-after ?\}))) 0 @@ -2626,7 +2626,7 @@ (- (current-indentation) cperl-label-offset) ;; Do not move `parse-data', this should ;; be quick anyway (this comment comes - ;;from different location): + ;; from different location): (cperl-calculate-indent)) (current-column)) (if (eq char-after ?\{) @@ -2676,7 +2676,7 @@ (+ (if (and (bolp) (zerop cperl-indent-level)) (+ cperl-brace-offset cperl-continued-statement-offset) cperl-indent-level) - (if (or is-block + (if (or is-block (not delim) (not (eq char-after ?\}))) 0 @@ -3155,7 +3155,7 @@ (or max (setq max (point-max))) (let* (face head-face here-face b e bb tag qtag b1 e1 argument i c tail tb is-REx is-x-REx REx-comment-start REx-comment-end was-comment i2 - (cperl-pod-here-fontify (eval cperl-pod-here-fontify)) go tmpend + (cperl-pod-here-fontify (eval cperl-pod-here-fontify)) go tmpend (case-fold-search nil) (inhibit-read-only t) (buffer-undo-list t) (modified (buffer-modified-p)) (after-change-functions nil) @@ -3179,11 +3179,11 @@ (if (boundp 'font-lock-function-name-face) font-lock-function-name-face 'font-lock-function-name-face)) - (font-lock-comment-face + (font-lock-comment-face (if (boundp 'font-lock-comment-face) font-lock-comment-face 'font-lock-comment-face)) - (cperl-nonoverridable-face + (cperl-nonoverridable-face (if (boundp 'cperl-nonoverridable-face) cperl-nonoverridable-face 'cperl-nonoverridable-face)) @@ -3192,7 +3192,7 @@ max)) (search (concat - "\\(\\`\n?\\|^\n\\)=" + "\\(\\`\n?\\|^\n\\)=" "\\|" ;; One extra () before this: "<<" @@ -3266,7 +3266,7 @@ (setq tmpend nil) ; Valid for most cases (cond ((match-beginning 1) ; POD section - ;; "\\(\\`\n?\\|^\n\\)=" + ;; "\\(\\`\n?\\|^\n\\)=" (if (looking-at "cut\\>") (if ignore-max nil ; Doing a chunk only @@ -3292,7 +3292,7 @@ (setq e (point)) (and (> e max) (progn - (remove-text-properties + (remove-text-properties max e '(syntax-type t in-pod t syntax-table t cperl-postpone t syntax-subtype t @@ -3308,22 +3308,22 @@ (put-text-property (cperl-1- b) (point) 'syntax-type 'pod) (cperl-put-do-not-fontify b (point) t) ;; mark the non-literal parts as PODs - (if cperl-pod-here-fontify + (if cperl-pod-here-fontify (cperl-postpone-fontification b (point) 'face face t)) (re-search-forward "\n\n[^ \t\f\n]" e 'toend) (beginning-of-line) (setq b (point))) (put-text-property (cperl-1- (point)) e 'syntax-type 'pod) (cperl-put-do-not-fontify (point) e t) - (if cperl-pod-here-fontify - (progn + (if cperl-pod-here-fontify + (progn ;; mark the non-literal parts as PODs (cperl-postpone-fontification (point) e 'face face t) (goto-char bb) - (if (looking-at + (if (looking-at "=[a-zA-Z0-9_]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$") ;; mark the headers - (cperl-postpone-fontification + (cperl-postpone-fontification (match-beginning 1) (match-end 1) 'face head-face)) (while (re-search-forward @@ -3331,7 +3331,7 @@ "^\n=[a-zA-Z0-9_]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$" e 'toend) ;; mark the headers - (cperl-postpone-fontification + (cperl-postpone-fontification (match-beginning 1) (match-end 1) 'face head-face)))) (cperl-commentify bb e nil) @@ -3616,15 +3616,15 @@ (progn (forward-word 1) ; skip modifiers s///s (if tail (cperl-commentify tail (point) t)) - (cperl-postpone-fontification + (cperl-postpone-fontification e1 (point) 'face 'cperl-nonoverridable-face))) ;; Check whether it is m// which means "previous match" ;; and highlight differently - (setq is-REx + (setq is-REx (and (string-match "^\\([sm]?\\|qr\\)$" argument) (or (not (= (length argument) 0)) (not (eq c ?\<))))) - (if (and is-REx + (if (and is-REx (eq e (+ 2 b)) ;; split // *is* using zero-pattern (save-excursion @@ -3674,7 +3674,7 @@ (progn (setq was-comment nil) (forward-char 1)) (if (match-beginning 2) - (progn + (progn (beginning-of-line 2) (if (> (point) e) (goto-char (1- e)))) @@ -3690,11 +3690,11 @@ (setq REx-comment-end (point)) (cperl-commentify REx-comment-start REx-comment-end nil) - (cperl-postpone-fontification + (cperl-postpone-fontification REx-comment-start REx-comment-end 'face font-lock-comment-face)))))) (if (and is-REx is-x-REx) - (put-text-property (1+ b) (1- e) + (put-text-property (1+ b) (1- e) 'syntax-subtype 'x-REx))) (if i2 (progn @@ -3766,7 +3766,7 @@ (goto-char b) (skip-chars-backward "\\\\") ;;;(setq i2 (= (% (skip-chars-backward "\\\\") 2) -1)) - (setq state (parse-partial-sexp + (setq state (parse-partial-sexp state-point b nil nil state) state-point b) (if (or (nth 3 state) (nth 4 state) ) @@ -3977,7 +3977,7 @@ (beginning-of-line))) ;; Looking at: ;; foreach my $var - (if (looking-at + (if (looking-at "[ \t]*\\\\([ \t]*(\\|[ \t\n]*{\\)\\|[ \t]*{") (progn (setq ml (match-beginning 8)) @@ -4390,7 +4390,7 @@ marker (make-marker)) (set-text-properties 0 (length name) nil name) (set-marker marker (match-end 3)) - (if (eq fchar ?p) + (if (eq fchar ?p) (setq name (concat "package " name)) (cond ((string-match "[:']" name) (setq meth t)) @@ -4398,7 +4398,7 @@ (t (setq name (concat package name) meth t)))) (setq index (cons name marker)) - (if (eq fchar ?p) + (if (eq fchar ?p) (push index index-pack-alist) (push index index-alist)) (if meth (push index index-meth-alist)) @@ -4487,7 +4487,7 @@ (t 3))) ; should not happen -(defvar cperl-compilation-error-regexp-alist +(defvar cperl-compilation-error-regexp-alist ;; This look like a paranoiac regexp: could anybody find a better one? (which WORK). '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]" 2 3)) @@ -4716,7 +4716,7 @@ 3 font-lock-variable-name-face))) '("\\ ;;; Getting help on modules in C-h f ? @@ -7153,7 +7153,7 @@ (defun cperl-fontify-syntaxically (end) ;; Some vars for debugging only ;; (message "Syntaxifying...") - (let (start (dbg (point)) (iend end) + (let (start (dbg (point)) (iend end) (istate (car cperl-syntax-state))) (and cperl-syntaxify-unwind (setq end (cperl-unwind-to-safe t end)))