aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/cperl-mode.el768
2 files changed, 389 insertions, 384 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1ceb91ff466..f720021b83c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12000-10-11 Sam Steingold <sds@gnu.org>
2
3 * progmodes/cperl-mode.el (cperl-invalid-face): double-quote
4 `underline' - fixes the bug introduced on 2000-09-21.
5
12000-10-11 Dave Love <fx@gnu.org> 62000-10-11 Dave Love <fx@gnu.org>
2 7
3 * progmodes/scheme.el (scheme-mode-variables, dsssl-mode): Avoid 8 * progmodes/scheme.el (scheme-mode-variables, dsssl-mode): Avoid
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 1bc03389181..2aecc92dc71 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -175,7 +175,7 @@ instead of:
175 :type 'boolean 175 :type 'boolean
176 :group 'cperl-autoinsert-details) 176 :group 'cperl-autoinsert-details)
177 177
178(defcustom cperl-extra-newline-before-brace-multiline 178(defcustom cperl-extra-newline-before-brace-multiline
179 cperl-extra-newline-before-brace 179 cperl-extra-newline-before-brace
180 "*Non-nil means the same as `cperl-extra-newline-before-brace', but 180 "*Non-nil means the same as `cperl-extra-newline-before-brace', but
181for constructs with multiline if/unless/while/until/for/foreach condition." 181for constructs with multiline if/unless/while/until/for/foreach condition."
@@ -230,7 +230,7 @@ This is in addition to cperl-continued-statement-offset."
230 "*Non-nil means automatically newline before and after braces, 230 "*Non-nil means automatically newline before and after braces,
231and after colons and semicolons, inserted in CPerl code. The following 231and after colons and semicolons, inserted in CPerl code. The following
232\\[cperl-electric-backspace] will remove the inserted whitespace. 232\\[cperl-electric-backspace] will remove the inserted whitespace.
233Insertion after colons requires both this variable and 233Insertion after colons requires both this variable and
234`cperl-auto-newline-after-colon' set." 234`cperl-auto-newline-after-colon' set."
235 :type 'boolean 235 :type 'boolean
236 :group 'cperl-autoinsert-details) 236 :group 'cperl-autoinsert-details)
@@ -273,7 +273,7 @@ Can be overwritten by `cperl-hairy' if nil."
273 273
274(defvar zmacs-regions) ; Avoid warning 274(defvar zmacs-regions) ; Avoid warning
275 275
276(defcustom cperl-electric-parens-mark 276(defcustom cperl-electric-parens-mark
277 (and window-system 277 (and window-system
278 (or (and (boundp 'transient-mark-mode) ; For Emacs 278 (or (and (boundp 'transient-mark-mode) ; For Emacs
279 transient-mark-mode) 279 transient-mark-mode)
@@ -299,7 +299,7 @@ Can be overwritten by `cperl-hairy' if nil."
299 299
300(defcustom cperl-hairy nil 300(defcustom cperl-hairy nil
301 "*Not-nil means most of the bells and whistles are enabled in CPerl. 301 "*Not-nil means most of the bells and whistles are enabled in CPerl.
302Affects: `cperl-font-lock', `cperl-electric-lbrace-space', 302Affects: `cperl-font-lock', `cperl-electric-lbrace-space',
303`cperl-electric-parens', `cperl-electric-linefeed', `cperl-electric-keywords', 303`cperl-electric-parens', `cperl-electric-linefeed', `cperl-electric-keywords',
304`cperl-info-on-command-no-prompt', `cperl-clobber-lisp-bindings', 304`cperl-info-on-command-no-prompt', `cperl-clobber-lisp-bindings',
305`cperl-lazy-help-time'." 305`cperl-lazy-help-time'."
@@ -317,7 +317,7 @@ Affects: `cperl-font-lock', `cperl-electric-lbrace-space',
317 :type '(repeat (list symbol string)) 317 :type '(repeat (list symbol string))
318 :group 'cperl) 318 :group 'cperl)
319 319
320(defcustom cperl-clobber-mode-lists 320(defcustom cperl-clobber-mode-lists
321 (not 321 (not
322 (and 322 (and
323 (boundp 'interpreter-mode-alist) 323 (boundp 'interpreter-mode-alist)
@@ -363,7 +363,7 @@ Font for POD headers."
363 :type 'face 363 :type 'face
364 :group 'cperl-faces) 364 :group 'cperl-faces)
365 365
366(defcustom cperl-invalid-face 'underline 366(defcustom cperl-invalid-face ''underline
367 "*Face for highlighting trailing whitespace." 367 "*Face for highlighting trailing whitespace."
368 :type 'face 368 :type 'face
369 :group 'cperl-faces) 369 :group 'cperl-faces)
@@ -406,13 +406,13 @@ Older version of this page was called `perl5', newer `perl'."
406 :type 'string 406 :type 'string
407 :group 'cperl-help-system) 407 :group 'cperl-help-system)
408 408
409(defcustom cperl-use-syntax-table-text-property 409(defcustom cperl-use-syntax-table-text-property
410 (boundp 'parse-sexp-lookup-properties) 410 (boundp 'parse-sexp-lookup-properties)
411 "*Non-nil means CPerl sets up and uses `syntax-table' text property." 411 "*Non-nil means CPerl sets up and uses `syntax-table' text property."
412 :type 'boolean 412 :type 'boolean
413 :group 'cperl-speed) 413 :group 'cperl-speed)
414 414
415(defcustom cperl-use-syntax-table-text-property-for-tags 415(defcustom cperl-use-syntax-table-text-property-for-tags
416 cperl-use-syntax-table-text-property 416 cperl-use-syntax-table-text-property
417 "*Non-nil means: set up and use `syntax-table' text property generating TAGS." 417 "*Non-nil means: set up and use `syntax-table' text property generating TAGS."
418 :type 'boolean 418 :type 'boolean
@@ -470,19 +470,19 @@ need to be reformated into multiline ones when indenting a region."
470 470
471(defcustom cperl-fix-hanging-brace-when-indent t 471(defcustom cperl-fix-hanging-brace-when-indent t
472 "*Non-nil means that BLOCK-end `}' may be put on a separate line 472 "*Non-nil means that BLOCK-end `}' may be put on a separate line
473when indenting a region. 473when indenting a region.
474Braces followed by else/elsif/while/until are excepted." 474Braces followed by else/elsif/while/until are excepted."
475 :type 'boolean 475 :type 'boolean
476 :group 'cperl-indentation-details) 476 :group 'cperl-indentation-details)
477 477
478(defcustom cperl-merge-trailing-else t 478(defcustom cperl-merge-trailing-else t
479 "*Non-nil means that BLOCK-end `}' followed by else/elsif/continue 479 "*Non-nil means that BLOCK-end `}' followed by else/elsif/continue
480may be merged to be on the same line when indenting a region." 480may be merged to be on the same line when indenting a region."
481 :type 'boolean 481 :type 'boolean
482 :group 'cperl-indentation-details) 482 :group 'cperl-indentation-details)
483 483
484(defcustom cperl-syntaxify-by-font-lock 484(defcustom cperl-syntaxify-by-font-lock
485 (and window-system 485 (and window-system
486 (boundp 'parse-sexp-lookup-properties)) 486 (boundp 'parse-sexp-lookup-properties))
487 "*Non-nil means that CPerl uses `font-lock's routines for syntaxification. 487 "*Non-nil means that CPerl uses `font-lock's routines for syntaxification.
488Having it TRUE may be not completely debugged yet." 488Having it TRUE may be not completely debugged yet."
@@ -509,7 +509,7 @@ when syntaxifying a chunk of buffer."
509 (font-lock-type-face nil nil underline) 509 (font-lock-type-face nil nil underline)
510 (underline nil "LightGray" strikeout)) 510 (underline nil "LightGray" strikeout))
511 "List given as an argument to `ps-extend-face-list' in `cperl-ps-print'." 511 "List given as an argument to `ps-extend-face-list' in `cperl-ps-print'."
512 :type '(repeat (cons symbol 512 :type '(repeat (cons symbol
513 (cons (choice (const nil) string) 513 (cons (choice (const nil) string)
514 (cons (choice (const nil) string) 514 (cons (choice (const nil) string)
515 (repeat symbol))))) 515 (repeat symbol)))))
@@ -517,9 +517,9 @@ when syntaxifying a chunk of buffer."
517 517
518(if window-system 518(if window-system
519 (progn 519 (progn
520 (defvar cperl-dark-background 520 (defvar cperl-dark-background
521 (cperl-choose-color "navy" "os2blue" "darkgreen")) 521 (cperl-choose-color "navy" "os2blue" "darkgreen"))
522 (defvar cperl-dark-foreground 522 (defvar cperl-dark-foreground
523 (cperl-choose-color "orchid1" "orange")) 523 (cperl-choose-color "orchid1" "orange"))
524 524
525 (defface cperl-nonoverridable-face 525 (defface cperl-nonoverridable-face
@@ -527,9 +527,9 @@ when syntaxifying a chunk of buffer."
527 (:background "Gray90" :italic t :underline t)) 527 (:background "Gray90" :italic t :underline t))
528 (((class grayscale) (background dark)) 528 (((class grayscale) (background dark))
529 (:foreground "Gray80" :italic t :underline t :bold t)) 529 (:foreground "Gray80" :italic t :underline t :bold t))
530 (((class color) (background light)) 530 (((class color) (background light))
531 (:foreground "chartreuse3")) 531 (:foreground "chartreuse3"))
532 (((class color) (background dark)) 532 (((class color) (background dark))
533 (:foreground ,cperl-dark-foreground)) 533 (:foreground ,cperl-dark-foreground))
534 (t (:bold t :underline t))) 534 (t (:bold t :underline t)))
535 "Font Lock mode face used to highlight array names." 535 "Font Lock mode face used to highlight array names."
@@ -540,9 +540,9 @@ when syntaxifying a chunk of buffer."
540 (:background "Gray90" :bold t)) 540 (:background "Gray90" :bold t))
541 (((class grayscale) (background dark)) 541 (((class grayscale) (background dark))
542 (:foreground "Gray80" :bold t)) 542 (:foreground "Gray80" :bold t))
543 (((class color) (background light)) 543 (((class color) (background light))
544 (:foreground "Blue" :background "lightyellow2" :bold t)) 544 (:foreground "Blue" :background "lightyellow2" :bold t))
545 (((class color) (background dark)) 545 (((class color) (background dark))
546 (:foreground "yellow" :background ,cperl-dark-background :bold t)) 546 (:foreground "yellow" :background ,cperl-dark-background :bold t))
547 (t (:bold t))) 547 (t (:bold t)))
548 "Font Lock mode face used to highlight array names." 548 "Font Lock mode face used to highlight array names."
@@ -553,9 +553,9 @@ when syntaxifying a chunk of buffer."
553 (:background "Gray90" :bold t :italic t)) 553 (:background "Gray90" :bold t :italic t))
554 (((class grayscale) (background dark)) 554 (((class grayscale) (background dark))
555 (:foreground "Gray80" :bold t :italic t)) 555 (:foreground "Gray80" :bold t :italic t))
556 (((class color) (background light)) 556 (((class color) (background light))
557 (:foreground "Red" :background "lightyellow2" :bold t :italic t)) 557 (:foreground "Red" :background "lightyellow2" :bold t :italic t))
558 (((class color) (background dark)) 558 (((class color) (background dark))
559 (:foreground "Red" :background ,cperl-dark-background :bold t :italic t)) 559 (:foreground "Red" :background ,cperl-dark-background :bold t :italic t))
560 (t (:bold t :italic t))) 560 (t (:bold t :italic t)))
561 "Font Lock mode face used to highlight hash names." 561 "Font Lock mode face used to highlight hash names."
@@ -575,7 +575,7 @@ patches to related files.
575 575
576For best results apply to an older Emacs the patches from 576For best results apply to an older Emacs the patches from
577 ftp://ftp.math.ohio-state.edu/pub/users/ilya/cperl-mode/patches 577 ftp://ftp.math.ohio-state.edu/pub/users/ilya/cperl-mode/patches
578\(this upgrades syntax-parsing abilities of RMS Emaxen v19.34 and 578\(this upgrades syntax-parsing abilities of RMS Emaxen v19.34 and
579v20.2 up to the level of RMS Emacs v20.3 - a must for a good Perl 579v20.2 up to the level of RMS Emacs v20.3 - a must for a good Perl
580mode.) You will not get much from XEmacs, it's syntax abilities are 580mode.) You will not get much from XEmacs, it's syntax abilities are
581too primitive. 581too primitive.
@@ -583,13 +583,13 @@ too primitive.
583Get support packages choose-color.el (or font-lock-extra.el before 583Get support packages choose-color.el (or font-lock-extra.el before
58419.30), imenu-go.el from the same place. \(Look for other files there 58419.30), imenu-go.el from the same place. \(Look for other files there
585too... ;-). Get a patch for imenu.el in 19.29. Note that for 19.30 and 585too... ;-). Get a patch for imenu.el in 19.29. Note that for 19.30 and
586later you should use choose-color.el *instead* of font-lock-extra.el 586later you should use choose-color.el *instead* of font-lock-extra.el
587\(and you will not get smart highlighting in C :-(). 587\(and you will not get smart highlighting in C :-().
588 588
589Note that to enable Compile choices in the menu you need to install 589Note that to enable Compile choices in the menu you need to install
590mode-compile.el. 590mode-compile.el.
591 591
592Get perl5-info from 592Get perl5-info from
593 $CPAN/doc/manual/info/perl-info.tar.gz 593 $CPAN/doc/manual/info/perl-info.tar.gz
594older version was on 594older version was on
595 http://www.metronet.com:70/9/perlinfo/perl5/manual/perl5-info.tar.gz 595 http://www.metronet.com:70/9/perlinfo/perl5/manual/perl5-info.tar.gz
@@ -650,7 +650,7 @@ should work if the balance of delimiters is not broken by POD).
650 650
651The main trick (to make $ a \"backslash\") makes constructions like 651The main trick (to make $ a \"backslash\") makes constructions like
652${aaa} look like unbalanced braces. The only trick I can think of is 652${aaa} look like unbalanced braces. The only trick I can think of is
653to insert it as $ {aaa} (legal in perl5, not in perl4). 653to insert it as $ {aaa} (legal in perl5, not in perl4).
654 654
655Similar problems arise in regexps, when /(\\s|$)/ should be rewritten 655Similar problems arise in regexps, when /(\\s|$)/ should be rewritten
656as /($|\\s)/. Note that such a transposition is not always possible. 656as /($|\\s)/. Note that such a transposition is not always possible.
@@ -665,7 +665,7 @@ environment and cannot recompile), you may still disable all the fancy stuff
665via `cperl-use-syntax-table-text-property'." ) 665via `cperl-use-syntax-table-text-property'." )
666 666
667(defvar cperl-non-problems 'please-ignore-this-line 667(defvar cperl-non-problems 'please-ignore-this-line
668"As you know from `problems' section, Perl syntax is too hard for CPerl on 668"As you know from `problems' section, Perl syntax is too hard for CPerl on
669older Emacsen. Here is what you can do if you cannot upgrade, or if 669older Emacsen. Here is what you can do if you cannot upgrade, or if
670you want to switch off these capabilities on RMS Emacs 20.2 (+patches) or 20.3 670you want to switch off these capabilities on RMS Emacs 20.2 (+patches) or 20.3
671or better. Please skip this docs if you run a capable Emacs already. 671or better. Please skip this docs if you run a capable Emacs already.
@@ -715,7 +715,7 @@ To speed up coloring the following compromises exist:
715 715
716Imenu in 19.31 is broken. Set `imenu-use-keymap-menu' to t, and remove 716Imenu in 19.31 is broken. Set `imenu-use-keymap-menu' to t, and remove
717`car' before `imenu-choose-buffer-index' in `imenu'. 717`car' before `imenu-choose-buffer-index' in `imenu'.
718`imenu-add-to-menubar' in 20.2 is broken. 718`imenu-add-to-menubar' in 20.2 is broken.
719 719
720A lot of things on XEmacs may be broken too, judging by bug reports I 720A lot of things on XEmacs may be broken too, judging by bug reports I
721recieve. Note that some releases of XEmacs are better than the others 721recieve. Note that some releases of XEmacs are better than the others
@@ -727,7 +727,7 @@ as far as bugs reports I see are concerned.")
7270) It uses the newest `syntax-table' property ;-); 7270) It uses the newest `syntax-table' property ;-);
728 728
7291) It does 99% of Perl syntax correct (as opposed to 80-90% in Perl 7291) It does 99% of Perl syntax correct (as opposed to 80-90% in Perl
730mode - but the latter number may have improved too in last years) even 730mode - but the latter number may have improved too in last years) even
731with old Emaxen which do not support `syntax-table' property. 731with old Emaxen which do not support `syntax-table' property.
732 732
733When using `syntax-table' property for syntax assist hints, it should 733When using `syntax-table' property for syntax assist hints, it should
@@ -789,7 +789,7 @@ voice);
789not needed anymore with the support for `syntax-table' property. Has 789not needed anymore with the support for `syntax-table' property. Has
790progress indicator for indentation (with `imenu' loaded). 790progress indicator for indentation (with `imenu' loaded).
791 791
7926) Indent-region improves inline-comments as well; also corrects 7926) Indent-region improves inline-comments as well; also corrects
793whitespace *inside* the conditional/loop constructs. 793whitespace *inside* the conditional/loop constructs.
794 794
7957) Fill-paragraph correctly handles multi-line comments; 7957) Fill-paragraph correctly handles multi-line comments;
@@ -797,7 +797,7 @@ whitespace *inside* the conditional/loop constructs.
7978) Can switch to different indentation styles by one command, and restore 7978) Can switch to different indentation styles by one command, and restore
798the settings present before the switch. 798the settings present before the switch.
799 799
8009) When doing indentation of control constructs, may correct 8009) When doing indentation of control constructs, may correct
801line-breaks/spacing between elements of the construct. 801line-breaks/spacing between elements of the construct.
802") 802")
803 803
@@ -833,7 +833,7 @@ syntax-parsing routines, and marks them up so that either
833 `cperl-pod-here-scan' 833 `cperl-pod-here-scan'
834 to nil. 834 to nil.
835 835
836B) Speed of editing operations. 836B) Speed of editing operations.
837 837
838 One can add a (minor) speedup to editing operations by setting 838 One can add a (minor) speedup to editing operations by setting
839 `cperl-use-syntax-table-text-property' 839 `cperl-use-syntax-table-text-property'
@@ -855,7 +855,7 @@ B) Speed of editing operations.
855 syntaxically to be not code 855 syntaxically to be not code
856 font-lock-constant-face HERE-doc delimiters, labels, delimiters of 856 font-lock-constant-face HERE-doc delimiters, labels, delimiters of
857 2-arg operators s/y/tr/ or of RExen, 857 2-arg operators s/y/tr/ or of RExen,
858 font-lock-function-name-face Special-cased m// and s//foo/, _ as 858 font-lock-function-name-face Special-cased m// and s//foo/, _ as
859 a target of a file tests, file tests, 859 a target of a file tests, file tests,
860 subroutine names at the moment of definition 860 subroutine names at the moment of definition
861 (except those conflicting with Perl operators), 861 (except those conflicting with Perl operators),
@@ -876,7 +876,7 @@ possible confusion, such as different colors for function names in
876declarations depending on what they (do not) override, or special cases 876declarations depending on what they (do not) override, or special cases
877m// and s/// which do not do what one would expect them to do. 877m// and s/// which do not do what one would expect them to do.
878 878
879Help with best setup of these faces for printout requested (for each of 879Help with best setup of these faces for printout requested (for each of
880the faces: please specify bold, italic, underline, shadow and box.) 880the faces: please specify bold, italic, underline, shadow and box.)
881 881
882\(Not finished.)") 882\(Not finished.)")
@@ -899,7 +899,7 @@ the faces: please specify bold, italic, underline, shadow and box.)
899 (where-is-internal 'backward-delete-char-untabify))) 899 (where-is-internal 'backward-delete-char-untabify)))
900 "Character generated by key bound to delete-backward-char.") 900 "Character generated by key bound to delete-backward-char.")
901 901
902(and (vectorp cperl-del-back-ch) (= (length cperl-del-back-ch) 1) 902(and (vectorp cperl-del-back-ch) (= (length cperl-del-back-ch) 1)
903 (setq cperl-del-back-ch (aref cperl-del-back-ch 0))) 903 (setq cperl-del-back-ch (aref cperl-del-back-ch 0)))
904 904
905(defun cperl-mark-active () (mark)) ; Avoid undefined warning 905(defun cperl-mark-active () (mark)) ; Avoid undefined warning
@@ -1059,7 +1059,7 @@ the faces: please specify bold, italic, underline, shadow and box.)
1059 ;;(concat (char-to-string help-char) "v") ; does not work 1059 ;;(concat (char-to-string help-char) "v") ; does not work
1060 'cperl-get-help 1060 'cperl-get-help
1061 [(control c) (control h) v])) 1061 [(control c) (control h) v]))
1062 (if (and cperl-xemacs-p 1062 (if (and cperl-xemacs-p
1063 (<= emacs-minor-version 11) (<= emacs-major-version 19)) 1063 (<= emacs-minor-version 11) (<= emacs-major-version 19))
1064 (progn 1064 (progn
1065 ;; substitute-key-definition is usefulness-deenhanced... 1065 ;; substitute-key-definition is usefulness-deenhanced...
@@ -1123,7 +1123,7 @@ the faces: please specify bold, italic, underline, shadow and box.)
1123 ["Insert spaces if needed" cperl-find-bad-style t] 1123 ["Insert spaces if needed" cperl-find-bad-style t]
1124 ["Class Hierarchy from TAGS" cperl-tags-hier-init t] 1124 ["Class Hierarchy from TAGS" cperl-tags-hier-init t]
1125 ;;["Update classes" (cperl-tags-hier-init t) tags-table-list] 1125 ;;["Update classes" (cperl-tags-hier-init t) tags-table-list]
1126 ["CPerl pretty print (exprmntl)" cperl-ps-print 1126 ["CPerl pretty print (exprmntl)" cperl-ps-print
1127 (fboundp 'ps-extend-face-list)] 1127 (fboundp 'ps-extend-face-list)]
1128 ["Imenu on info" cperl-imenu-on-info (featurep 'imenu)] 1128 ["Imenu on info" cperl-imenu-on-info (featurep 'imenu)]
1129 ("Tags" 1129 ("Tags"
@@ -1131,23 +1131,23 @@ the faces: please specify bold, italic, underline, shadow and box.)
1131;;; ["Add tags for current file" (cperl-etags t) t] 1131;;; ["Add tags for current file" (cperl-etags t) t]
1132;;; ["Create tags for Perl files in directory" (cperl-etags nil t) t] 1132;;; ["Create tags for Perl files in directory" (cperl-etags nil t) t]
1133;;; ["Add tags for Perl files in directory" (cperl-etags t t) t] 1133;;; ["Add tags for Perl files in directory" (cperl-etags t t) t]
1134;;; ["Create tags for Perl files in (sub)directories" 1134;;; ["Create tags for Perl files in (sub)directories"
1135;;; (cperl-etags nil 'recursive) t] 1135;;; (cperl-etags nil 'recursive) t]
1136;;; ["Add tags for Perl files in (sub)directories" 1136;;; ["Add tags for Perl files in (sub)directories"
1137;;; (cperl-etags t 'recursive) t]) 1137;;; (cperl-etags t 'recursive) t])
1138;;;; cperl-write-tags (&optional file erase recurse dir inbuffer) 1138;;;; cperl-write-tags (&optional file erase recurse dir inbuffer)
1139 ["Create tags for current file" (cperl-write-tags nil t) t] 1139 ["Create tags for current file" (cperl-write-tags nil t) t]
1140 ["Add tags for current file" (cperl-write-tags) t] 1140 ["Add tags for current file" (cperl-write-tags) t]
1141 ["Create tags for Perl files in directory" 1141 ["Create tags for Perl files in directory"
1142 (cperl-write-tags nil t nil t) t] 1142 (cperl-write-tags nil t nil t) t]
1143 ["Add tags for Perl files in directory" 1143 ["Add tags for Perl files in directory"
1144 (cperl-write-tags nil nil nil t) t] 1144 (cperl-write-tags nil nil nil t) t]
1145 ["Create tags for Perl files in (sub)directories" 1145 ["Create tags for Perl files in (sub)directories"
1146 (cperl-write-tags nil t t t) t] 1146 (cperl-write-tags nil t t t) t]
1147 ["Add tags for Perl files in (sub)directories" 1147 ["Add tags for Perl files in (sub)directories"
1148 (cperl-write-tags nil nil t t) t])) 1148 (cperl-write-tags nil nil t t) t]))
1149 ("Perl docs" 1149 ("Perl docs"
1150 ["Define word at point" imenu-go-find-at-position 1150 ["Define word at point" imenu-go-find-at-position
1151 (fboundp 'imenu-go-find-at-position)] 1151 (fboundp 'imenu-go-find-at-position)]
1152 ["Help on function" cperl-info-on-command t] 1152 ["Help on function" cperl-info-on-command t]
1153 ["Help on function at point" cperl-info-on-current-command t] 1153 ["Help on function at point" cperl-info-on-current-command t]
@@ -1155,10 +1155,10 @@ the faces: please specify bold, italic, underline, shadow and box.)
1155 ["Perldoc" cperl-perldoc t] 1155 ["Perldoc" cperl-perldoc t]
1156 ["Perldoc on word at point" cperl-perldoc-at-point t] 1156 ["Perldoc on word at point" cperl-perldoc-at-point t]
1157 ["View manpage of POD in this file" cperl-pod-to-manpage t] 1157 ["View manpage of POD in this file" cperl-pod-to-manpage t]
1158 ["Auto-help on" cperl-lazy-install 1158 ["Auto-help on" cperl-lazy-install
1159 (and (fboundp 'run-with-idle-timer) 1159 (and (fboundp 'run-with-idle-timer)
1160 (not cperl-lazy-installed))] 1160 (not cperl-lazy-installed))]
1161 ["Auto-help off" (eval '(cperl-lazy-unstall)) 1161 ["Auto-help off" (eval '(cperl-lazy-unstall))
1162 (and (fboundp 'run-with-idle-timer) 1162 (and (fboundp 'run-with-idle-timer)
1163 cperl-lazy-installed)]) 1163 cperl-lazy-installed)])
1164 ("Toggle..." 1164 ("Toggle..."
@@ -1166,7 +1166,7 @@ the faces: please specify bold, italic, underline, shadow and box.)
1166 ["Electric parens" cperl-toggle-electric t] 1166 ["Electric parens" cperl-toggle-electric t]
1167 ["Electric keywords" cperl-toggle-abbrev t] 1167 ["Electric keywords" cperl-toggle-abbrev t]
1168 ["Fix whitespace on indent" cperl-toggle-construct-fix t] 1168 ["Fix whitespace on indent" cperl-toggle-construct-fix t]
1169 ["Auto fill" auto-fill-mode t]) 1169 ["Auto fill" auto-fill-mode t])
1170 ("Indent styles..." 1170 ("Indent styles..."
1171 ["CPerl" (cperl-set-style "CPerl") t] 1171 ["CPerl" (cperl-set-style "CPerl") t]
1172 ["PerlStyle" (cperl-set-style "PerlStyle") t] 1172 ["PerlStyle" (cperl-set-style "PerlStyle") t]
@@ -1185,8 +1185,8 @@ the faces: please specify bold, italic, underline, shadow and box.)
1185 ["Praise" (describe-variable 'cperl-praise) t] 1185 ["Praise" (describe-variable 'cperl-praise) t]
1186 ["Faces" (describe-variable 'cperl-tips-faces) t] 1186 ["Faces" (describe-variable 'cperl-tips-faces) t]
1187 ["CPerl mode" (describe-function 'cperl-mode) t] 1187 ["CPerl mode" (describe-function 'cperl-mode) t]
1188 ["CPerl version" 1188 ["CPerl version"
1189 (message "The version of master-file for this CPerl is %s" 1189 (message "The version of master-file for this CPerl is %s"
1190 cperl-version) t])))) 1190 cperl-version) t]))))
1191 (error nil)) 1191 (error nil))
1192 1192
@@ -1256,7 +1256,7 @@ look for active mark and \"embrace\" a region if possible.'
1256 1256
1257CPerl mode provides expansion of the Perl control constructs: 1257CPerl mode provides expansion of the Perl control constructs:
1258 1258
1259 if, else, elsif, unless, while, until, continue, do, 1259 if, else, elsif, unless, while, until, continue, do,
1260 for, foreach, formy and foreachmy. 1260 for, foreach, formy and foreachmy.
1261 1261
1262and POD directives (Disabled by default, see `cperl-electric-keywords'.) 1262and POD directives (Disabled by default, see `cperl-electric-keywords'.)
@@ -1269,7 +1269,7 @@ following \"if\" the following appears in the buffer: if () { or if ()
1269type some boolean expression within the parens. Having done that, 1269type some boolean expression within the parens. Having done that,
1270typing \\[cperl-linefeed] places you - appropriately indented - on a 1270typing \\[cperl-linefeed] places you - appropriately indented - on a
1271new line between the braces (if you typed \\[cperl-linefeed] in a POD 1271new line between the braces (if you typed \\[cperl-linefeed] in a POD
1272directive line, then appropriate number of new lines is inserted). 1272directive line, then appropriate number of new lines is inserted).
1273 1273
1274If CPerl decides that you want to insert \"English\" style construct like 1274If CPerl decides that you want to insert \"English\" style construct like
1275 1275
@@ -1288,8 +1288,8 @@ you type it inside the inline block of control construct, like
1288 1288
1289and you are on a boundary of a statement inside braces, it will 1289and you are on a boundary of a statement inside braces, it will
1290transform the construct into a multiline and will place you into an 1290transform the construct into a multiline and will place you into an
1291appropriately indented blank line. If you need a usual 1291appropriately indented blank line. If you need a usual
1292`newline-and-indent' behaviour, it is on \\[newline-and-indent], 1292`newline-and-indent' behaviour, it is on \\[newline-and-indent],
1293see documentation on `cperl-electric-linefeed'. 1293see documentation on `cperl-electric-linefeed'.
1294 1294
1295Use \\[cperl-invert-if-unless] to change a construction of the form 1295Use \\[cperl-invert-if-unless] to change a construction of the form
@@ -1320,7 +1320,7 @@ If your site has perl5 documentation in info format, you can use commands
1320\\[cperl-info-on-current-command] and \\[cperl-info-on-command] to access it. 1320\\[cperl-info-on-current-command] and \\[cperl-info-on-command] to access it.
1321These keys run commands `cperl-info-on-current-command' and 1321These keys run commands `cperl-info-on-current-command' and
1322`cperl-info-on-command', which one is which is controlled by variable 1322`cperl-info-on-command', which one is which is controlled by variable
1323`cperl-info-on-command-no-prompt' and `cperl-clobber-lisp-bindings' 1323`cperl-info-on-command-no-prompt' and `cperl-clobber-lisp-bindings'
1324\(in turn affected by `cperl-hairy'). 1324\(in turn affected by `cperl-hairy').
1325 1325
1326Even if you have no info-format documentation, short one-liner-style 1326Even if you have no info-format documentation, short one-liner-style
@@ -1352,8 +1352,8 @@ Variables controlling indentation style:
1352 Non-nil means automatically newline before and after braces, 1352 Non-nil means automatically newline before and after braces,
1353 and after colons and semicolons, inserted in Perl code. The following 1353 and after colons and semicolons, inserted in Perl code. The following
1354 \\[cperl-electric-backspace] will remove the inserted whitespace. 1354 \\[cperl-electric-backspace] will remove the inserted whitespace.
1355 Insertion after colons requires both this variable and 1355 Insertion after colons requires both this variable and
1356 `cperl-auto-newline-after-colon' set. 1356 `cperl-auto-newline-after-colon' set.
1357 `cperl-auto-newline-after-colon' 1357 `cperl-auto-newline-after-colon'
1358 Non-nil means automatically newline even after colons. 1358 Non-nil means automatically newline even after colons.
1359 Subject to `cperl-auto-newline' setting. 1359 Subject to `cperl-auto-newline' setting.
@@ -1389,7 +1389,7 @@ corresponding variables. Use \\[cperl-set-style] to do this. Use
1389\(both available from menu). 1389\(both available from menu).
1390 1390
1391If `cperl-indent-level' is 0, the statement after opening brace in 1391If `cperl-indent-level' is 0, the statement after opening brace in
1392column 0 is indented on 1392column 0 is indented on
1393`cperl-brace-offset'+`cperl-continued-statement-offset'. 1393`cperl-brace-offset'+`cperl-continued-statement-offset'.
1394 1394
1395Turning on CPerl mode calls the hooks in the variable `cperl-mode-hook' 1395Turning on CPerl mode calls the hooks in the variable `cperl-mode-hook'
@@ -1496,7 +1496,7 @@ or as help on variables `cperl-tips', `cperl-problems',
1496 (set 'font-lock-unfontify-region-function 1496 (set 'font-lock-unfontify-region-function
1497 'font-lock-default-unfontify-region)) 1497 'font-lock-default-unfontify-region))
1498 (make-variable-buffer-local 'font-lock-unfontify-region-function) 1498 (make-variable-buffer-local 'font-lock-unfontify-region-function)
1499 (set 'font-lock-unfontify-region-function 1499 (set 'font-lock-unfontify-region-function
1500 'cperl-font-lock-unfontify-region-function) 1500 'cperl-font-lock-unfontify-region-function)
1501 (make-variable-buffer-local 'cperl-syntax-done-to) 1501 (make-variable-buffer-local 'cperl-syntax-done-to)
1502 ;; Another bug: unless font-lock-syntactic-keywords, font-lock 1502 ;; Another bug: unless font-lock-syntactic-keywords, font-lock
@@ -1504,7 +1504,7 @@ or as help on variables `cperl-tips', `cperl-problems',
1504 ;; to make font-lock think that font-lock-syntactic-keywords 1504 ;; to make font-lock think that font-lock-syntactic-keywords
1505 ;; are defined 1505 ;; are defined
1506 (make-variable-buffer-local 'font-lock-syntactic-keywords) 1506 (make-variable-buffer-local 'font-lock-syntactic-keywords)
1507 (setq font-lock-syntactic-keywords 1507 (setq font-lock-syntactic-keywords
1508 (if cperl-syntaxify-by-font-lock 1508 (if cperl-syntaxify-by-font-lock
1509 '(t (cperl-fontify-syntaxically)) 1509 '(t (cperl-fontify-syntaxically))
1510 '(t))))) 1510 '(t)))))
@@ -1512,7 +1512,7 @@ or as help on variables `cperl-tips', `cperl-problems',
1512 (set (make-local-variable 'normal-auto-fill-function) 1512 (set (make-local-variable 'normal-auto-fill-function)
1513 #'cperl-old-auto-fill-mode) 1513 #'cperl-old-auto-fill-mode)
1514 (if (cperl-enable-font-lock) 1514 (if (cperl-enable-font-lock)
1515 (if (cperl-val 'cperl-font-lock) 1515 (if (cperl-val 'cperl-font-lock)
1516 (progn (or cperl-faces-init (cperl-init-faces)) 1516 (progn (or cperl-faces-init (cperl-init-faces))
1517 (font-lock-mode 1)))) 1517 (font-lock-mode 1))))
1518 (and (boundp 'msb-menu-cond) 1518 (and (boundp 'msb-menu-cond)
@@ -1522,7 +1522,7 @@ or as help on variables `cperl-tips', `cperl-problems',
1522 (easy-menu-add cperl-menu)) ; A NOP in Emacs. 1522 (easy-menu-add cperl-menu)) ; A NOP in Emacs.
1523 (run-hooks 'cperl-mode-hook) 1523 (run-hooks 'cperl-mode-hook)
1524 ;; After hooks since fontification will break this 1524 ;; After hooks since fontification will break this
1525 (if cperl-pod-here-scan 1525 (if cperl-pod-here-scan
1526 (or ;;(and (boundp 'font-lock-mode) 1526 (or ;;(and (boundp 'font-lock-mode)
1527 ;; (eval 'font-lock-mode) ; Avoid warning 1527 ;; (eval 'font-lock-mode) ; Avoid warning
1528 ;; (boundp 'font-lock-hot-pass) ; Newer font-lock 1528 ;; (boundp 'font-lock-hot-pass) ; Newer font-lock
@@ -1604,7 +1604,7 @@ or as help on variables `cperl-tips', `cperl-problems',
1604;;; (let ((c (current-column)) target cnt prevc) 1604;;; (let ((c (current-column)) target cnt prevc)
1605;;; (if (= c comment-column) nil 1605;;; (if (= c comment-column) nil
1606;;; (setq cnt (skip-chars-backward "[ \t]")) 1606;;; (setq cnt (skip-chars-backward "[ \t]"))
1607;;; (setq target (max (1+ (setq prevc 1607;;; (setq target (max (1+ (setq prevc
1608;;; (current-column))) ; Else indent at comment column 1608;;; (current-column))) ; Else indent at comment column
1609;;; comment-column)) 1609;;; comment-column))
1610;;; (if (= c comment-column) nil 1610;;; (if (= c comment-column) nil
@@ -1646,14 +1646,14 @@ See `comment-region'."
1646 "Insert character and correct line's indentation. 1646 "Insert character and correct line's indentation.
1647If ONLY-BEFORE and `cperl-auto-newline', will insert newline before the 1647If ONLY-BEFORE and `cperl-auto-newline', will insert newline before the
1648place (even in empty line), but not after. If after \")\" and the inserted 1648place (even in empty line), but not after. If after \")\" and the inserted
1649char is \"{\", insert extra newline before only if 1649char is \"{\", insert extra newline before only if
1650`cperl-extra-newline-before-brace'." 1650`cperl-extra-newline-before-brace'."
1651 (interactive "P") 1651 (interactive "P")
1652 (let (insertpos 1652 (let (insertpos
1653 (other-end (if (and cperl-electric-parens-mark 1653 (other-end (if (and cperl-electric-parens-mark
1654 (cperl-mark-active) 1654 (cperl-mark-active)
1655 (< (mark) (point))) 1655 (< (mark) (point)))
1656 (mark) 1656 (mark)
1657 nil))) 1657 nil)))
1658 (if (and other-end 1658 (if (and other-end
1659 (not cperl-brace-recursing) 1659 (not cperl-brace-recursing)
@@ -1669,7 +1669,7 @@ char is \"{\", insert extra newline before only if
1669 (forward-char 1)) 1669 (forward-char 1))
1670 ;: Check whether we close something "usual" with `}' 1670 ;: Check whether we close something "usual" with `}'
1671 (if (and (eq last-command-char ?\}) 1671 (if (and (eq last-command-char ?\})
1672 (not 1672 (not
1673 (condition-case nil 1673 (condition-case nil
1674 (save-excursion 1674 (save-excursion
1675 (up-list (- (prefix-numeric-value arg))) 1675 (up-list (- (prefix-numeric-value arg)))
@@ -1691,7 +1691,7 @@ char is \"{\", insert extra newline before only if
1691 (save-excursion 1691 (save-excursion
1692 (skip-chars-backward " \t") 1692 (skip-chars-backward " \t")
1693 (eq (preceding-char) ?\)))) 1693 (eq (preceding-char) ?\))))
1694 (if cperl-auto-newline 1694 (if cperl-auto-newline
1695 (progn (cperl-indent-line) (newline) t) nil))) 1695 (progn (cperl-indent-line) (newline) t) nil)))
1696 (progn 1696 (progn
1697 (self-insert-command (prefix-numeric-value arg)) 1697 (self-insert-command (prefix-numeric-value arg))
@@ -1704,7 +1704,7 @@ char is \"{\", insert extra newline before only if
1704 (cperl-indent-line))) 1704 (cperl-indent-line)))
1705 (save-excursion 1705 (save-excursion
1706 (if insertpos (progn (goto-char insertpos) 1706 (if insertpos (progn (goto-char insertpos)
1707 (search-forward (make-string 1707 (search-forward (make-string
1708 1 last-command-char)) 1708 1 last-command-char))
1709 (setq insertpos (1- (point))))) 1709 (setq insertpos (1- (point)))))
1710 (delete-char -1)))) 1710 (delete-char -1))))
@@ -1717,7 +1717,7 @@ char is \"{\", insert extra newline before only if
1717(defun cperl-electric-lbrace (arg &optional end) 1717(defun cperl-electric-lbrace (arg &optional end)
1718 "Insert character, correct line's indentation, correct quoting by space." 1718 "Insert character, correct line's indentation, correct quoting by space."
1719 (interactive "P") 1719 (interactive "P")
1720 (let (pos after 1720 (let (pos after
1721 (cperl-brace-recursing t) 1721 (cperl-brace-recursing t)
1722 (cperl-auto-newline cperl-auto-newline) 1722 (cperl-auto-newline cperl-auto-newline)
1723 (other-end (or end 1723 (other-end (or end
@@ -1726,7 +1726,7 @@ char is \"{\", insert extra newline before only if
1726 (> (mark) (point))) 1726 (> (mark) (point)))
1727 (save-excursion 1727 (save-excursion
1728 (goto-char (mark)) 1728 (goto-char (mark))
1729 (point-marker)) 1729 (point-marker))
1730 nil)))) 1730 nil))))
1731 (and (cperl-val 'cperl-electric-lbrace-space) 1731 (and (cperl-val 'cperl-electric-lbrace-space)
1732 (eq (preceding-char) ?$) 1732 (eq (preceding-char) ?$)
@@ -1735,7 +1735,7 @@ char is \"{\", insert extra newline before only if
1735 (looking-at "\\(\\$\\$\\)*\\$\\([^\\$]\\|$\\)")) 1735 (looking-at "\\(\\$\\$\\)*\\$\\([^\\$]\\|$\\)"))
1736 (insert ?\ )) 1736 (insert ?\ ))
1737 ;; Check whether we are in comment 1737 ;; Check whether we are in comment
1738 (if (and 1738 (if (and
1739 (save-excursion 1739 (save-excursion
1740 (beginning-of-line) 1740 (beginning-of-line)
1741 (not (looking-at "[ \t]*#"))) 1741 (not (looking-at "[ \t]*#")))
@@ -1745,7 +1745,7 @@ char is \"{\", insert extra newline before only if
1745 (cperl-electric-brace arg) 1745 (cperl-electric-brace arg)
1746 (and (cperl-val 'cperl-electric-parens) 1746 (and (cperl-val 'cperl-electric-parens)
1747 (eq last-command-char ?{) 1747 (eq last-command-char ?{)
1748 (memq last-command-char 1748 (memq last-command-char
1749 (append cperl-electric-parens-string nil)) 1749 (append cperl-electric-parens-string nil))
1750 (or (if other-end (goto-char (marker-position other-end))) 1750 (or (if other-end (goto-char (marker-position other-end)))
1751 t) 1751 t)
@@ -1758,11 +1758,11 @@ char is \"{\", insert extra newline before only if
1758 (interactive "P") 1758 (interactive "P")
1759 (let ((beg (save-excursion (beginning-of-line) (point))) 1759 (let ((beg (save-excursion (beginning-of-line) (point)))
1760 (other-end (if (and cperl-electric-parens-mark 1760 (other-end (if (and cperl-electric-parens-mark
1761 (cperl-mark-active) 1761 (cperl-mark-active)
1762 (> (mark) (point))) 1762 (> (mark) (point)))
1763 (save-excursion 1763 (save-excursion
1764 (goto-char (mark)) 1764 (goto-char (mark))
1765 (point-marker)) 1765 (point-marker))
1766 nil))) 1766 nil)))
1767 (if (and (cperl-val 'cperl-electric-parens) 1767 (if (and (cperl-val 'cperl-electric-parens)
1768 (memq last-command-char 1768 (memq last-command-char
@@ -1778,7 +1778,7 @@ char is \"{\", insert extra newline before only if
1778 (progn 1778 (progn
1779 (self-insert-command (prefix-numeric-value arg)) 1779 (self-insert-command (prefix-numeric-value arg))
1780 (if other-end (goto-char (marker-position other-end))) 1780 (if other-end (goto-char (marker-position other-end)))
1781 (insert (make-string 1781 (insert (make-string
1782 (prefix-numeric-value arg) 1782 (prefix-numeric-value arg)
1783 (cdr (assoc last-command-char '((?{ .?}) 1783 (cdr (assoc last-command-char '((?{ .?})
1784 (?[ . ?]) 1784 (?[ . ?])
@@ -1796,9 +1796,9 @@ If not, or if we are not at the end of marking range, would self-insert."
1796 (cperl-val 'cperl-electric-parens) 1796 (cperl-val 'cperl-electric-parens)
1797 (memq last-command-char 1797 (memq last-command-char
1798 (append cperl-electric-parens-string nil)) 1798 (append cperl-electric-parens-string nil))
1799 (cperl-mark-active) 1799 (cperl-mark-active)
1800 (< (mark) (point))) 1800 (< (mark) (point)))
1801 (mark) 1801 (mark)
1802 nil)) 1802 nil))
1803 p) 1803 p)
1804 (if (and other-end 1804 (if (and other-end
@@ -1824,7 +1824,7 @@ If not, or if we are not at the end of marking range, would self-insert."
1824 "Insert a construction appropriate after a keyword. 1824 "Insert a construction appropriate after a keyword.
1825Help message may be switched off by setting `cperl-message-electric-keyword' 1825Help message may be switched off by setting `cperl-message-electric-keyword'
1826to nil." 1826to nil."
1827 (let ((beg (save-excursion (beginning-of-line) (point))) 1827 (let ((beg (save-excursion (beginning-of-line) (point)))
1828 (dollar (and (eq last-command-char ?$) 1828 (dollar (and (eq last-command-char ?$)
1829 (eq this-command 'self-insert-command))) 1829 (eq this-command 'self-insert-command)))
1830 (delete (and (memq last-command-char '(?\ ?\n ?\t ?\f)) 1830 (delete (and (memq last-command-char '(?\ ?\n ?\t ?\f))
@@ -1837,8 +1837,8 @@ to nil."
1837 (setq do (looking-at "do\\>"))) 1837 (setq do (looking-at "do\\>")))
1838 (error nil)) 1838 (error nil))
1839 (cperl-after-expr-p nil "{;:")) 1839 (cperl-after-expr-p nil "{;:"))
1840 (save-excursion 1840 (save-excursion
1841 (not 1841 (not
1842 (re-search-backward 1842 (re-search-backward
1843 "[#\"'`]\\|\\<q\\(\\|[wqxr]\\)\\>" 1843 "[#\"'`]\\|\\<q\\(\\|[wqxr]\\)\\>"
1844 beg t))) 1844 beg t)))
@@ -1855,8 +1855,8 @@ to nil."
1855 (forward-char -2) 1855 (forward-char -2)
1856 (insert " ") 1856 (insert " ")
1857 (forward-char 2) 1857 (forward-char 2)
1858 (setq my t dollar t 1858 (setq my t dollar t
1859 delete 1859 delete
1860 (memq this-command '(self-insert-command newline))))) 1860 (memq this-command '(self-insert-command newline)))))
1861 (and dollar (insert " $")) 1861 (and dollar (insert " $"))
1862 (cperl-indent-line) 1862 (cperl-indent-line)
@@ -1876,7 +1876,7 @@ to nil."
1876 (or (looking-at "[ \t]\\|$") (insert " ")) 1876 (or (looking-at "[ \t]\\|$") (insert " "))
1877 (cperl-indent-line) 1877 (cperl-indent-line)
1878 (if dollar (progn (search-backward "$") 1878 (if dollar (progn (search-backward "$")
1879 (if my 1879 (if my
1880 (forward-char 1) 1880 (forward-char 1)
1881 (delete-char 1))) 1881 (delete-char 1)))
1882 (search-backward ")")) 1882 (search-backward ")"))
@@ -1904,14 +1904,14 @@ to nil."
1904 (condition-case nil 1904 (condition-case nil
1905 (backward-sexp 1) 1905 (backward-sexp 1)
1906 (error nil)) 1906 (error nil))
1907 (and 1907 (and
1908 (eq (preceding-char) ?=) 1908 (eq (preceding-char) ?=)
1909 (progn 1909 (progn
1910 (setq head1 (looking-at "head1\\>")) 1910 (setq head1 (looking-at "head1\\>"))
1911 (setq over (looking-at "over\\>")) 1911 (setq over (looking-at "over\\>"))
1912 (forward-char -1) 1912 (forward-char -1)
1913 (bolp)) 1913 (bolp))
1914 (or 1914 (or
1915 (get-text-property (point) 'in-pod) 1915 (get-text-property (point) 'in-pod)
1916 (cperl-after-expr-p nil "{;:") 1916 (cperl-after-expr-p nil "{;:")
1917 (and (re-search-backward 1917 (and (re-search-backward
@@ -1929,18 +1929,18 @@ to nil."
1929 (insert "\n\n=cut") 1929 (insert "\n\n=cut")
1930 (cperl-ensure-newlines 2) 1930 (cperl-ensure-newlines 2)
1931 (forward-sexp -2) 1931 (forward-sexp -2)
1932 (if (and head1 1932 (if (and head1
1933 (not 1933 (not
1934 (save-excursion 1934 (save-excursion
1935 (forward-char -1) 1935 (forward-char -1)
1936 (re-search-backward "\\(\\`\n?\\|\n\n\\)=head1\\>" 1936 (re-search-backward "\\(\\`\n?\\|\n\n\\)=head1\\>"
1937 nil t)))) ; Only one 1937 nil t)))) ; Only one
1938 (progn 1938 (progn
1939 (forward-sexp 1) 1939 (forward-sexp 1)
1940 (setq name (file-name-sans-extension 1940 (setq name (file-name-sans-extension
1941 (file-name-nondirectory (buffer-file-name))) 1941 (file-name-nondirectory (buffer-file-name)))
1942 p (point)) 1942 p (point))
1943 (insert " NAME\n\n" name 1943 (insert " NAME\n\n" name
1944 " - \n\n=head1 SYNOPSYS\n\n\n\n" 1944 " - \n\n=head1 SYNOPSYS\n\n\n\n"
1945 "=head1 DESCRIPTION") 1945 "=head1 DESCRIPTION")
1946 (cperl-ensure-newlines 4) 1946 (cperl-ensure-newlines 4)
@@ -1970,8 +1970,8 @@ to nil."
1970 (and (save-excursion 1970 (and (save-excursion
1971 (backward-sexp 1) 1971 (backward-sexp 1)
1972 (cperl-after-expr-p nil "{;:")) 1972 (cperl-after-expr-p nil "{;:"))
1973 (save-excursion 1973 (save-excursion
1974 (not 1974 (not
1975 (re-search-backward 1975 (re-search-backward
1976 "[#\"'`]\\|\\<q\\(\\|[wqxr]\\)\\>" 1976 "[#\"'`]\\|\\<q\\(\\|[wqxr]\\)\\>"
1977 beg t))) 1977 beg t)))
@@ -2010,7 +2010,7 @@ If in POD, insert appropriate lines."
2010 (end (save-excursion (end-of-line) (point))) 2010 (end (save-excursion (end-of-line) (point)))
2011 (pos (point)) start over cut res) 2011 (pos (point)) start over cut res)
2012 (if (and ; Check if we need to split: 2012 (if (and ; Check if we need to split:
2013 ; i.e., on a boundary and inside "{...}" 2013 ; i.e., on a boundary and inside "{...}"
2014 (save-excursion (cperl-to-comment-or-eol) 2014 (save-excursion (cperl-to-comment-or-eol)
2015 (>= (point) pos)) ; Not in a comment 2015 (>= (point) pos)) ; Not in a comment
2016 (or (save-excursion 2016 (or (save-excursion
@@ -2021,7 +2021,7 @@ If in POD, insert appropriate lines."
2021 (re-search-forward "\\=[ \t]*;" end t)) ; Before spaces + ; 2021 (re-search-forward "\\=[ \t]*;" end t)) ; Before spaces + ;
2022 (save-excursion 2022 (save-excursion
2023 (and 2023 (and
2024 (eq (car (parse-partial-sexp pos end -1)) -1) 2024 (eq (car (parse-partial-sexp pos end -1)) -1)
2025 ; Leave the level of parens 2025 ; Leave the level of parens
2026 (looking-at "[,; \t]*\\($\\|#\\)") ; Comma to allow anon subr 2026 (looking-at "[,; \t]*\\($\\|#\\)") ; Comma to allow anon subr
2027 ; Are at end 2027 ; Are at end
@@ -2058,7 +2058,7 @@ If in POD, insert appropriate lines."
2058 (insert "\n") 2058 (insert "\n")
2059 (cperl-indent-line) 2059 (cperl-indent-line)
2060 (forward-line -1))) 2060 (forward-line -1)))
2061 (forward-line -1) ; We are on the line before target 2061 (forward-line -1) ; We are on the line before target
2062 (end-of-line) 2062 (end-of-line)
2063 (newline-and-indent)) 2063 (newline-and-indent))
2064 (end-of-line) ; else - no splitting 2064 (end-of-line) ; else - no splitting
@@ -2075,7 +2075,7 @@ If in POD, insert appropriate lines."
2075 ;; (re-search-backward "\\(\\`\n?\\|\n\n\\)=head1\\b") 2075 ;; (re-search-backward "\\(\\`\n?\\|\n\n\\)=head1\\b")
2076 ;; We are after \n now, so look for the rest 2076 ;; We are after \n now, so look for the rest
2077 (if (looking-at "\\(\\`\n?\\|\n\\)=\\sw+") 2077 (if (looking-at "\\(\\`\n?\\|\n\\)=\\sw+")
2078 (progn 2078 (progn
2079 (setq cut (looking-at "\\(\\`\n?\\|\n\\)=cut\\>")) 2079 (setq cut (looking-at "\\(\\`\n?\\|\n\\)=cut\\>"))
2080 (setq over (looking-at "\\(\\`\n?\\|\n\\)=over\\>")) 2080 (setq over (looking-at "\\(\\`\n?\\|\n\\)=over\\>"))
2081 t))) 2081 t)))
@@ -2117,11 +2117,11 @@ If in POD, insert appropriate lines."
2117(defun cperl-electric-terminator (arg) 2117(defun cperl-electric-terminator (arg)
2118 "Insert character and correct line's indentation." 2118 "Insert character and correct line's indentation."
2119 (interactive "P") 2119 (interactive "P")
2120 (let (insertpos (end (point)) 2120 (let (insertpos (end (point))
2121 (auto (and cperl-auto-newline 2121 (auto (and cperl-auto-newline
2122 (or (not (eq last-command-char ?:)) 2122 (or (not (eq last-command-char ?:))
2123 cperl-auto-newline-after-colon)))) 2123 cperl-auto-newline-after-colon))))
2124 (if (and ;;(not arg) 2124 (if (and ;;(not arg)
2125 (eolp) 2125 (eolp)
2126 (not (save-excursion 2126 (not (save-excursion
2127 (beginning-of-line) 2127 (beginning-of-line)
@@ -2164,16 +2164,16 @@ If in POD, insert appropriate lines."
2164 (self-insert-command (prefix-numeric-value arg))))) 2164 (self-insert-command (prefix-numeric-value arg)))))
2165 2165
2166(defun cperl-electric-backspace (arg) 2166(defun cperl-electric-backspace (arg)
2167 "Backspace-untabify, or remove the whitespace around the point inserted 2167 "Backspace-untabify, or remove the whitespace around the point inserted
2168by an electric key." 2168by an electric key."
2169 (interactive "p") 2169 (interactive "p")
2170 (if (and cperl-auto-newline 2170 (if (and cperl-auto-newline
2171 (memq last-command '(cperl-electric-semi 2171 (memq last-command '(cperl-electric-semi
2172 cperl-electric-terminator 2172 cperl-electric-terminator
2173 cperl-electric-lbrace)) 2173 cperl-electric-lbrace))
2174 (memq (preceding-char) '(?\ ?\t ?\n))) 2174 (memq (preceding-char) '(?\ ?\t ?\n)))
2175 (let (p) 2175 (let (p)
2176 (if (eq last-command 'cperl-electric-lbrace) 2176 (if (eq last-command 'cperl-electric-lbrace)
2177 (skip-chars-forward " \t\n")) 2177 (skip-chars-forward " \t\n"))
2178 (setq p (point)) 2178 (setq p (point))
2179 (skip-chars-backward " \t\n") 2179 (skip-chars-backward " \t\n")
@@ -2181,7 +2181,7 @@ by an electric key."
2181 (and (eq last-command 'cperl-electric-else) 2181 (and (eq last-command 'cperl-electric-else)
2182 ;; We are removing the whitespace *inside* cperl-electric-else 2182 ;; We are removing the whitespace *inside* cperl-electric-else
2183 (setq this-command 'cperl-electric-else-really)) 2183 (setq this-command 'cperl-electric-else-really))
2184 (if (and cperl-auto-newline 2184 (if (and cperl-auto-newline
2185 (eq last-command 'cperl-electric-else-really) 2185 (eq last-command 'cperl-electric-else-really)
2186 (memq (preceding-char) '(?\ ?\t ?\n))) 2186 (memq (preceding-char) '(?\ ?\t ?\n)))
2187 (let (p) 2187 (let (p)
@@ -2203,7 +2203,7 @@ by an electric key."
2203 2203
2204(defun cperl-indent-command (&optional whole-exp) 2204(defun cperl-indent-command (&optional whole-exp)
2205 "Indent current line as Perl code, or in some cases insert a tab character. 2205 "Indent current line as Perl code, or in some cases insert a tab character.
2206If `cperl-tab-always-indent' is non-nil (the default), always indent current 2206If `cperl-tab-always-indent' is non-nil (the default), always indent current
2207line. Otherwise, indent the current line only if point is at the left margin 2207line. Otherwise, indent the current line only if point is at the left margin
2208or in the line's indentation; otherwise insert a tab. 2208or in the line's indentation; otherwise insert a tab.
2209 2209
@@ -2291,7 +2291,7 @@ Return the amount the indentation changed by."
2291(defun cperl-get-state (&optional parse-start start-state) 2291(defun cperl-get-state (&optional parse-start start-state)
2292 ;; returns list (START STATE DEPTH PRESTART), 2292 ;; returns list (START STATE DEPTH PRESTART),
2293 ;; START is a good place to start parsing, or equal to 2293 ;; START is a good place to start parsing, or equal to
2294 ;; PARSE-START if preset, 2294 ;; PARSE-START if preset,
2295 ;; STATE is what is returned by `parse-partial-sexp'. 2295 ;; STATE is what is returned by `parse-partial-sexp'.
2296 ;; DEPTH is true is we are immediately after end of block 2296 ;; DEPTH is true is we are immediately after end of block
2297 ;; which contains START. 2297 ;; which contains START.
@@ -2337,7 +2337,7 @@ Return the amount the indentation changed by."
2337 (and (memq (char-syntax (preceding-char)) '(?w ?_)) 2337 (and (memq (char-syntax (preceding-char)) '(?w ?_))
2338 (progn 2338 (progn
2339 (backward-sexp) 2339 (backward-sexp)
2340 (looking-at 2340 (looking-at
2341 "sub[ \t]+[a-zA-Z0-9_:]+[ \t\n\f]*\\(([^()]*)[ \t\n\f]*\\)?[#{]"))))))))) 2341 "sub[ \t]+[a-zA-Z0-9_:]+[ \t\n\f]*\\(([^()]*)[ \t\n\f]*\\)?[#{]")))))))))
2342 2342
2343(defvar cperl-look-for-prop '((pod in-pod) (here-doc-delim here-doc-group))) 2343(defvar cperl-look-for-prop '((pod in-pod) (here-doc-delim here-doc-group)))
@@ -2351,7 +2351,7 @@ Will not correct the indentation for labels, but will correct it for braces
2351and closing parentheses and brackets.." 2351and closing parentheses and brackets.."
2352 (save-excursion 2352 (save-excursion
2353 (if (or 2353 (if (or
2354 (memq (get-text-property (point) 'syntax-type) 2354 (memq (get-text-property (point) 'syntax-type)
2355 '(pod here-doc here-doc-delim format)) 2355 '(pod here-doc here-doc-delim format))
2356 ;; before start of POD - whitespace found since do not have 'pod! 2356 ;; before start of POD - whitespace found since do not have 'pod!
2357 (and (looking-at "[ \t]*\n=") 2357 (and (looking-at "[ \t]*\n=")
@@ -2368,10 +2368,10 @@ and closing parentheses and brackets.."
2368 (pre-indent-point (point)) 2368 (pre-indent-point (point))
2369 p prop look-prop) 2369 p prop look-prop)
2370 (cond 2370 (cond
2371 (in-pod 2371 (in-pod
2372 ;; In the verbatim part, probably code example. What to do??? 2372 ;; In the verbatim part, probably code example. What to do???
2373 ) 2373 )
2374 (t 2374 (t
2375 (save-excursion 2375 (save-excursion
2376 ;; Not in pod 2376 ;; Not in pod
2377 (cperl-backward-to-noncomment nil) 2377 (cperl-backward-to-noncomment nil)
@@ -2381,21 +2381,21 @@ and closing parentheses and brackets.."
2381 'syntax-type)) 2381 'syntax-type))
2382 (if (memq prop '(pod here-doc format here-doc-delim)) 2382 (if (memq prop '(pod here-doc format here-doc-delim))
2383 (progn 2383 (progn
2384 (goto-char (or (previous-single-property-change p look-prop) 2384 (goto-char (or (previous-single-property-change p look-prop)
2385 (point-min))) 2385 (point-min)))
2386 (beginning-of-line) 2386 (beginning-of-line)
2387 (setq pre-indent-point (point))))))) 2387 (setq pre-indent-point (point)))))))
2388 (goto-char pre-indent-point) 2388 (goto-char pre-indent-point)
2389 (let* ((case-fold-search nil) 2389 (let* ((case-fold-search nil)
2390 (s-s (cperl-get-state (car parse-data) (nth 1 parse-data))) 2390 (s-s (cperl-get-state (car parse-data) (nth 1 parse-data)))
2391 (start (or (nth 2 parse-data) 2391 (start (or (nth 2 parse-data)
2392 (nth 0 s-s))) 2392 (nth 0 s-s)))
2393 (state (nth 1 s-s)) 2393 (state (nth 1 s-s))
2394 (containing-sexp (car (cdr state))) 2394 (containing-sexp (car (cdr state)))
2395 old-indent) 2395 old-indent)
2396 (if (and 2396 (if (and
2397 ;;containing-sexp ;; We are buggy at toplevel :-( 2397 ;;containing-sexp ;; We are buggy at toplevel :-(
2398 parse-data) 2398 parse-data)
2399 (progn 2399 (progn
2400 (setcar parse-data pre-indent-point) 2400 (setcar parse-data pre-indent-point)
2401 (setcar (cdr parse-data) state) 2401 (setcar (cdr parse-data) state)
@@ -2404,8 +2404,8 @@ and closing parentheses and brackets.."
2404 ;; Before this point: end of statement 2404 ;; Before this point: end of statement
2405 (setq old-indent (nth 3 parse-data)))) 2405 (setq old-indent (nth 3 parse-data))))
2406 ;; (or parse-start (null symbol) 2406 ;; (or parse-start (null symbol)
2407 ;; (setq parse-start (symbol-value symbol) 2407 ;; (setq parse-start (symbol-value symbol)
2408 ;; start-indent (nth 2 parse-start) 2408 ;; start-indent (nth 2 parse-start)
2409 ;; parse-start (car parse-start))) 2409 ;; parse-start (car parse-start)))
2410 ;; (if parse-start 2410 ;; (if parse-start
2411 ;; (goto-char parse-start) 2411 ;; (goto-char parse-start)
@@ -2427,17 +2427,17 @@ and closing parentheses and brackets.."
2427 ;; (setq start-indent (- start-indent cperl-indent-level)))) 2427 ;; (setq start-indent (- start-indent cperl-indent-level))))
2428 ;; (setq start-indent 0)) 2428 ;; (setq start-indent 0))
2429 ;; (if (< (point) indent-point) (setq parse-start (point))) 2429 ;; (if (< (point) indent-point) (setq parse-start (point)))
2430 ;; (or state (setq state (parse-partial-sexp 2430 ;; (or state (setq state (parse-partial-sexp
2431 ;; (point) indent-point -1 nil start-state))) 2431 ;; (point) indent-point -1 nil start-state)))
2432 ;; (setq containing-sexp 2432 ;; (setq containing-sexp
2433 ;; (or (car (cdr state)) 2433 ;; (or (car (cdr state))
2434 ;; (and (>= (nth 6 state) 0) old-containing-sexp)) 2434 ;; (and (>= (nth 6 state) 0) old-containing-sexp))
2435 ;; old-containing-sexp nil start-state nil) 2435 ;; old-containing-sexp nil start-state nil)
2436;;;; (while (< (point) indent-point) 2436;;;; (while (< (point) indent-point)
2437;;;; (setq parse-start (point)) 2437;;;; (setq parse-start (point))
2438;;;; (setq state (parse-partial-sexp (point) indent-point -1 nil start-state)) 2438;;;; (setq state (parse-partial-sexp (point) indent-point -1 nil start-state))
2439;;;; (setq containing-sexp 2439;;;; (setq containing-sexp
2440;;;; (or (car (cdr state)) 2440;;;; (or (car (cdr state))
2441;;;; (and (>= (nth 6 state) 0) old-containing-sexp)) 2441;;;; (and (>= (nth 6 state) 0) old-containing-sexp))
2442;;;; old-containing-sexp nil start-state nil)) 2442;;;; old-containing-sexp nil start-state nil))
2443 ;; (if symbol (set symbol (list indent-point state start-indent))) 2443 ;; (if symbol (set symbol (list indent-point state start-indent)))
@@ -2475,7 +2475,7 @@ and closing parentheses and brackets.."
2475 (progn 2475 (progn
2476 (forward-sexp -1) 2476 (forward-sexp -1)
2477 (skip-chars-backward " \t") 2477 (skip-chars-backward " \t")
2478 (looking-at "[ \t]*[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:")))) 2478 (looking-at "[ \t]*[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:"))))
2479 (progn 2479 (progn
2480 (if (and parse-data 2480 (if (and parse-data
2481 (not (eq char-after ?\C-j))) 2481 (not (eq char-after ?\C-j)))
@@ -2502,7 +2502,7 @@ and closing parentheses and brackets.."
2502 (skip-chars-forward " \t")) 2502 (skip-chars-forward " \t"))
2503 (+ (current-column) ; Correct indentation of trailing ?\} 2503 (+ (current-column) ; Correct indentation of trailing ?\}
2504 (if (eq char-after ?\}) (+ cperl-indent-level 2504 (if (eq char-after ?\}) (+ cperl-indent-level
2505 cperl-close-paren-offset) 2505 cperl-close-paren-offset)
2506 0))) 2506 0)))
2507 (t 2507 (t
2508 ;; Statement level. Is it a continuation or a new statement? 2508 ;; Statement level. Is it a continuation or a new statement?
@@ -2528,7 +2528,7 @@ and closing parentheses and brackets.."
2528 ;; Had \?, too: 2528 ;; Had \?, too:
2529 (if (not (or (memq (preceding-char) (append " ;{" '(nil))) 2529 (if (not (or (memq (preceding-char) (append " ;{" '(nil)))
2530 (and (eq (preceding-char) ?\}) 2530 (and (eq (preceding-char) ?\})
2531 (cperl-after-block-and-statement-beg 2531 (cperl-after-block-and-statement-beg
2532 containing-sexp)))) ; Was ?\, 2532 containing-sexp)))) ; Was ?\,
2533 ;; This line is continuation of preceding line's statement; 2533 ;; This line is continuation of preceding line's statement;
2534 ;; indent `cperl-continued-statement-offset' more than the 2534 ;; indent `cperl-continued-statement-offset' more than the
@@ -2545,7 +2545,7 @@ and closing parentheses and brackets.."
2545 (if (> (current-indentation) cperl-min-label-indent) 2545 (if (> (current-indentation) cperl-min-label-indent)
2546 (- (current-indentation) cperl-label-offset) 2546 (- (current-indentation) cperl-label-offset)
2547 ;; Do not move `parse-data', this should 2547 ;; Do not move `parse-data', this should
2548 ;; be quick anyway (this comment comes 2548 ;; be quick anyway (this comment comes
2549 ;;from different location): 2549 ;;from different location):
2550 (cperl-calculate-indent)) 2550 (cperl-calculate-indent))
2551 (current-column)) 2551 (current-column))
@@ -2578,7 +2578,7 @@ and closing parentheses and brackets.."
2578 ;; if it is before the line we want to indent. 2578 ;; if it is before the line we want to indent.
2579 (and (< (point) indent-point) 2579 (and (< (point) indent-point)
2580 (if (> colon-line-end (point)) ; After label 2580 (if (> colon-line-end (point)) ; After label
2581 (if (> (current-indentation) 2581 (if (> (current-indentation)
2582 cperl-min-label-indent) 2582 cperl-min-label-indent)
2583 (- (current-indentation) cperl-label-offset) 2583 (- (current-indentation) cperl-label-offset)
2584 ;; Do not believe: `max' is involved 2584 ;; Do not believe: `max' is involved
@@ -2617,10 +2617,10 @@ and closing parentheses and brackets.."
2617 (progn 2617 (progn
2618 (forward-sexp -1) 2618 (forward-sexp -1)
2619 (looking-at "sub\\>")) 2619 (looking-at "sub\\>"))
2620 (setq old-indent 2620 (setq old-indent
2621 (nth 1 2621 (nth 1
2622 (parse-partial-sexp 2622 (parse-partial-sexp
2623 (save-excursion (beginning-of-line) (point)) 2623 (save-excursion (beginning-of-line) (point))
2624 (point))))) 2624 (point)))))
2625 (progn (goto-char (1+ old-indent)) 2625 (progn (goto-char (1+ old-indent))
2626 (skip-chars-forward " \t") 2626 (skip-chars-forward " \t")
@@ -2671,7 +2671,7 @@ Not finished, not used."
2671 ((nth 4 state) ; In comment 2671 ((nth 4 state) ; In comment
2672 (setq res (cons '(comment) res))) 2672 (setq res (cons '(comment) res)))
2673 ((null containing-sexp) 2673 ((null containing-sexp)
2674 ;; Line is at top level. 2674 ;; Line is at top level.
2675 ;; Indent like the previous top level line 2675 ;; Indent like the previous top level line
2676 ;; unless that ends in a closeparen without semicolon, 2676 ;; unless that ends in a closeparen without semicolon,
2677 ;; in which case this line is the first argument decl. 2677 ;; in which case this line is the first argument decl.
@@ -2683,7 +2683,7 @@ Not finished, not used."
2683 (setq res (cons (list 'toplevel start) res))) 2683 (setq res (cons (list 'toplevel start) res)))
2684 ((eq (preceding-char) ?\) ) 2684 ((eq (preceding-char) ?\) )
2685 (setq res (cons (list 'toplevel-after-parenth start) res))) 2685 (setq res (cons (list 'toplevel-after-parenth start) res)))
2686 (t 2686 (t
2687 (setq res (cons (list 'toplevel-continued start) res))))) 2687 (setq res (cons (list 'toplevel-continued start) res)))))
2688 ((/= (char-after containing-sexp) ?{) 2688 ((/= (char-after containing-sexp) ?{)
2689 ;; line is expression, not statement: 2689 ;; line is expression, not statement:
@@ -2753,12 +2753,12 @@ Not finished, not used."
2753 (save-excursion (end-of-line) 2753 (save-excursion (end-of-line)
2754 (setq colon-line-end (point))) 2754 (setq colon-line-end (point)))
2755 (search-forward ":")))) 2755 (search-forward ":"))))
2756 ;; Now at the point, after label, or at start 2756 ;; Now at the point, after label, or at start
2757 ;; of first statement in the block. 2757 ;; of first statement in the block.
2758 (and (< (point) start-point) 2758 (and (< (point) start-point)
2759 (if (> colon-line-end (point)) 2759 (if (> colon-line-end (point))
2760 ;; Before statement after label 2760 ;; Before statement after label
2761 (if (> (current-indentation) 2761 (if (> (current-indentation)
2762 cperl-min-label-indent) 2762 cperl-min-label-indent)
2763 (list (list 'label-in-block (point))) 2763 (list (list 'label-in-block (point)))
2764 ;; Do not believe: `max' is involved 2764 ;; Do not believe: `max' is involved
@@ -2821,7 +2821,7 @@ the current line is to be regarded as part of a block comment."
2821Returns true if comment is found." 2821Returns true if comment is found."
2822 (let (state stop-in cpoint (lim (progn (end-of-line) (point)))) 2822 (let (state stop-in cpoint (lim (progn (end-of-line) (point))))
2823 (beginning-of-line) 2823 (beginning-of-line)
2824 (if (or 2824 (if (or
2825 (eq (get-text-property (point) 'syntax-type) 'pod) 2825 (eq (get-text-property (point) 'syntax-type) 'pod)
2826 (re-search-forward "\\=[ \t]*\\(#\\|$\\)" lim t)) 2826 (re-search-forward "\\=[ \t]*\\(#\\|$\\)" lim t))
2827 (if (eq (preceding-char) ?\#) (progn (backward-char 1) t)) 2827 (if (eq (preceding-char) ?\#) (progn (backward-char 1) t))
@@ -2878,7 +2878,7 @@ Returns true if comment is found."
2878 (put-text-property (1- (point)) (point) 'syntax-table cperl-st-punct)))) 2878 (put-text-property (1- (point)) (point) 'syntax-table cperl-st-punct))))
2879 2879
2880(defun cperl-commentify (bb e string &optional noface) 2880(defun cperl-commentify (bb e string &optional noface)
2881 (if cperl-use-syntax-table-text-property 2881 (if cperl-use-syntax-table-text-property
2882 (if (eq noface 'n) ; Only immediate 2882 (if (eq noface 'n) ; Only immediate
2883 nil 2883 nil
2884 ;; We suppose that e is _after_ the end of construction, as after eol. 2884 ;; We suppose that e is _after_ the end of construction, as after eol.
@@ -2886,7 +2886,7 @@ Returns true if comment is found."
2886 (cperl-modify-syntax-type bb string) 2886 (cperl-modify-syntax-type bb string)
2887 (cperl-modify-syntax-type (1- e) string) 2887 (cperl-modify-syntax-type (1- e) string)
2888 (if (and (eq string cperl-st-sfence) (> (- e 2) bb)) 2888 (if (and (eq string cperl-st-sfence) (> (- e 2) bb))
2889 (put-text-property (1+ bb) (1- e) 2889 (put-text-property (1+ bb) (1- e)
2890 'syntax-table cperl-string-syntax-table)) 2890 'syntax-table cperl-string-syntax-table))
2891 (cperl-protect-defun-start bb e)) 2891 (cperl-protect-defun-start bb e))
2892 ;; Fontify 2892 ;; Fontify
@@ -2906,7 +2906,7 @@ Returns true if comment is found."
2906 (let (b starter ender st i i2 go-forward) 2906 (let (b starter ender st i i2 go-forward)
2907 (skip-chars-forward " \t") 2907 (skip-chars-forward " \t")
2908 ;; ender means matching-char matcher. 2908 ;; ender means matching-char matcher.
2909 (setq b (point) 2909 (setq b (point)
2910 starter (if (eobp) 0 (char-after b)) 2910 starter (if (eobp) 0 (char-after b))
2911 ender (cdr (assoc starter cperl-starters))) 2911 ender (cdr (assoc starter cperl-starters)))
2912 ;; What if starter == ?\\ ???? 2912 ;; What if starter == ?\\ ????
@@ -2968,7 +2968,7 @@ Returns true if comment is found."
2968 (setq i2 (point)))) 2968 (setq i2 (point))))
2969 (forward-char -1)) 2969 (forward-char -1))
2970 (modify-syntax-entry starter (if (eq starter ?\\) "\\" ".") st) 2970 (modify-syntax-entry starter (if (eq starter ?\\) "\\" ".") st)
2971 (if ender (modify-syntax-entry ender "." st)) 2971 (if ender (modify-syntax-entry ender "." st))
2972 (setq set-st nil) 2972 (setq set-st nil)
2973 (setq ender (cperl-forward-re lim end nil t st-l err-l 2973 (setq ender (cperl-forward-re lim end nil t st-l err-l
2974 argument starter ender) 2974 argument starter ender)
@@ -2993,7 +2993,7 @@ Returns true if comment is found."
2993 ;; go-forward: has 2 args, and the second part is empth 2993 ;; go-forward: has 2 args, and the second part is empth
2994 (list i i2 ender starter go-forward))) 2994 (list i i2 ender starter go-forward)))
2995 2995
2996(defsubst cperl-postpone-fontification (b e type val &optional now) 2996(defsubst cperl-postpone-fontification (b e type val &optional now)
2997 ;; Do after syntactic fontification? 2997 ;; Do after syntactic fontification?
2998 (if cperl-syntaxify-by-font-lock 2998 (if cperl-syntaxify-by-font-lock
2999 (or now (put-text-property b e 'cperl-postpone (cons type val))) 2999 (or now (put-text-property b e 'cperl-postpone (cons type val)))
@@ -3001,17 +3001,17 @@ Returns true if comment is found."
3001 3001
3002;;; Here is how the global structures (those which cannot be 3002;;; Here is how the global structures (those which cannot be
3003;;; recognized locally) are marked: 3003;;; recognized locally) are marked:
3004;; a) PODs: 3004;; a) PODs:
3005;; Start-to-end is marked `in-pod' ==> t 3005;; Start-to-end is marked `in-pod' ==> t
3006;; Each non-literal part is marked `syntax-type' ==> `pod' 3006;; Each non-literal part is marked `syntax-type' ==> `pod'
3007;; Each literal part is marked `syntax-type' ==> `in-pod' 3007;; Each literal part is marked `syntax-type' ==> `in-pod'
3008;; b) HEREs: 3008;; b) HEREs:
3009;; Start-to-end is marked `here-doc-group' ==> t 3009;; Start-to-end is marked `here-doc-group' ==> t
3010;; The body is marked `syntax-type' ==> `here-doc' 3010;; The body is marked `syntax-type' ==> `here-doc'
3011;; The delimiter is marked `syntax-type' ==> `here-doc-delim' 3011;; The delimiter is marked `syntax-type' ==> `here-doc-delim'
3012;; c) FORMATs: 3012;; c) FORMATs:
3013;; After-initial-line--to-end is marked `syntax-type' ==> `format' 3013;; After-initial-line--to-end is marked `syntax-type' ==> `format'
3014;; d) 'Q'uoted string: 3014;; d) 'Q'uoted string:
3015;; part between markers inclusive is marked `syntax-type' ==> `string' 3015;; part between markers inclusive is marked `syntax-type' ==> `string'
3016 3016
3017(defun cperl-unwind-to-safe (before &optional end) 3017(defun cperl-unwind-to-safe (before &optional end)
@@ -3039,8 +3039,8 @@ Returns true if comment is found."
3039 3039
3040(defun cperl-find-pods-heres (&optional min max non-inter end ignore-max) 3040(defun cperl-find-pods-heres (&optional min max non-inter end ignore-max)
3041 "Scans the buffer for hard-to-parse Perl constructions. 3041 "Scans the buffer for hard-to-parse Perl constructions.
3042If `cperl-pod-here-fontify' is not-nil after evaluation, will fontify 3042If `cperl-pod-here-fontify' is not-nil after evaluation, will fontify
3043the sections using `cperl-pod-head-face', `cperl-pod-face', 3043the sections using `cperl-pod-head-face', `cperl-pod-face',
3044`cperl-here-face'." 3044`cperl-here-face'."
3045 (interactive) 3045 (interactive)
3046 (or min (setq min (point-min) 3046 (or min (setq min (point-min)
@@ -3048,7 +3048,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3048 cperl-syntax-done-to min)) 3048 cperl-syntax-done-to min))
3049 (or max (setq max (point-max))) 3049 (or max (setq max (point-max)))
3050 (let* (face head-face here-face b e bb tag qtag b1 e1 argument i c tail tb 3050 (let* (face head-face here-face b e bb tag qtag b1 e1 argument i c tail tb
3051 (cperl-pod-here-fontify (eval cperl-pod-here-fontify)) go tmpend 3051 (cperl-pod-here-fontify (eval cperl-pod-here-fontify)) go tmpend
3052 (case-fold-search nil) (inhibit-read-only t) (buffer-undo-list t) 3052 (case-fold-search nil) (inhibit-read-only t) (buffer-undo-list t)
3053 (modified (buffer-modified-p)) 3053 (modified (buffer-modified-p))
3054 (after-change-functions nil) 3054 (after-change-functions nil)
@@ -3067,23 +3067,23 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3067 (font-lock-constant-face (if (boundp 'font-lock-constant-face) 3067 (font-lock-constant-face (if (boundp 'font-lock-constant-face)
3068 font-lock-constant-face 3068 font-lock-constant-face
3069 'font-lock-constant-face)) 3069 'font-lock-constant-face))
3070 (font-lock-function-name-face 3070 (font-lock-function-name-face
3071 (if (boundp 'font-lock-function-name-face) 3071 (if (boundp 'font-lock-function-name-face)
3072 font-lock-function-name-face 3072 font-lock-function-name-face
3073 'font-lock-function-name-face)) 3073 'font-lock-function-name-face))
3074 (cperl-nonoverridable-face 3074 (cperl-nonoverridable-face
3075 (if (boundp 'cperl-nonoverridable-face) 3075 (if (boundp 'cperl-nonoverridable-face)
3076 cperl-nonoverridable-face 3076 cperl-nonoverridable-face
3077 'cperl-nonoverridable-face)) 3077 'cperl-nonoverridable-face))
3078 (stop-point (if ignore-max 3078 (stop-point (if ignore-max
3079 (point-max) 3079 (point-max)
3080 max)) 3080 max))
3081 (search 3081 (search
3082 (concat 3082 (concat
3083 "\\(\\`\n?\\|\n\n\\)=" 3083 "\\(\\`\n?\\|\n\n\\)="
3084 "\\|" 3084 "\\|"
3085 ;; One extra () before this: 3085 ;; One extra () before this:
3086 "<<" 3086 "<<"
3087 "\\(" ; 1 + 1 3087 "\\(" ; 1 + 1
3088 ;; First variant "BLAH" or just ``. 3088 ;; First variant "BLAH" or just ``.
3089 "\\([\"'`]\\)" ; 2 + 1 3089 "\\([\"'`]\\)" ; 2 + 1
@@ -3131,31 +3131,31 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3131 (setq face cperl-pod-face 3131 (setq face cperl-pod-face
3132 head-face cperl-pod-head-face 3132 head-face cperl-pod-head-face
3133 here-face cperl-here-face)) 3133 here-face cperl-here-face))
3134 (remove-text-properties min max 3134 (remove-text-properties min max
3135 '(syntax-type t in-pod t syntax-table t 3135 '(syntax-type t in-pod t syntax-table t
3136 cperl-postpone t)) 3136 cperl-postpone t))
3137 ;; Need to remove face as well... 3137 ;; Need to remove face as well...
3138 (goto-char min) 3138 (goto-char min)
3139 (and (eq system-type 'emx) 3139 (and (eq system-type 'emx)
3140 (looking-at "extproc[ \t]") ; Analogue of #! 3140 (looking-at "extproc[ \t]") ; Analogue of #!
3141 (cperl-commentify min 3141 (cperl-commentify min
3142 (save-excursion (end-of-line) (point)) 3142 (save-excursion (end-of-line) (point))
3143 nil)) 3143 nil))
3144 (while (and 3144 (while (and
3145 (< (point) max) 3145 (< (point) max)
3146 (re-search-forward search max t)) 3146 (re-search-forward search max t))
3147 (setq tmpend nil) ; Valid for most cases 3147 (setq tmpend nil) ; Valid for most cases
3148 (cond 3148 (cond
3149 ((match-beginning 1) ; POD section 3149 ((match-beginning 1) ; POD section
3150 ;; "\\(\\`\n?\\|\n\n\\)=" 3150 ;; "\\(\\`\n?\\|\n\n\\)="
3151 (if (looking-at "\n*cut\\>") 3151 (if (looking-at "\n*cut\\>")
3152 (if ignore-max 3152 (if ignore-max
3153 nil ; Doing a chunk only 3153 nil ; Doing a chunk only
3154 (message "=cut is not preceded by a POD section") 3154 (message "=cut is not preceded by a POD section")
3155 (or (car err-l) (setcar err-l (point)))) 3155 (or (car err-l) (setcar err-l (point))))
3156 (beginning-of-line) 3156 (beginning-of-line)
3157 3157
3158 (setq b (point) 3158 (setq b (point)
3159 bb b 3159 bb b
3160 tb (match-beginning 0) 3160 tb (match-beginning 0)
3161 b1 nil) ; error condition 3161 b1 nil) ; error condition
@@ -3173,7 +3173,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3173 nil 3173 nil
3174 (and (> e max) 3174 (and (> e max)
3175 (progn 3175 (progn
3176 (remove-text-properties 3176 (remove-text-properties
3177 max e '(syntax-type t in-pod t syntax-table t 3177 max e '(syntax-type t in-pod t syntax-table t
3178 'cperl-postpone t)) 3178 'cperl-postpone t))
3179 (setq tmpend tb))) 3179 (setq tmpend tb)))
@@ -3186,22 +3186,22 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3186 (put-text-property (cperl-1- b) (point) 'syntax-type 'pod) 3186 (put-text-property (cperl-1- b) (point) 'syntax-type 'pod)
3187 (cperl-put-do-not-fontify b (point) t) 3187 (cperl-put-do-not-fontify b (point) t)
3188 ;; mark the non-literal parts as PODs 3188 ;; mark the non-literal parts as PODs
3189 (if cperl-pod-here-fontify 3189 (if cperl-pod-here-fontify
3190 (cperl-postpone-fontification b (point) 'face face t)) 3190 (cperl-postpone-fontification b (point) 'face face t))
3191 (re-search-forward "\n\n[^ \t\f\n]" e 'toend) 3191 (re-search-forward "\n\n[^ \t\f\n]" e 'toend)
3192 (beginning-of-line) 3192 (beginning-of-line)
3193 (setq b (point))) 3193 (setq b (point)))
3194 (put-text-property (cperl-1- (point)) e 'syntax-type 'pod) 3194 (put-text-property (cperl-1- (point)) e 'syntax-type 'pod)
3195 (cperl-put-do-not-fontify (point) e t) 3195 (cperl-put-do-not-fontify (point) e t)
3196 (if cperl-pod-here-fontify 3196 (if cperl-pod-here-fontify
3197 (progn 3197 (progn
3198 ;; mark the non-literal parts as PODs 3198 ;; mark the non-literal parts as PODs
3199 (cperl-postpone-fontification (point) e 'face face t) 3199 (cperl-postpone-fontification (point) e 'face face t)
3200 (goto-char bb) 3200 (goto-char bb)
3201 (if (looking-at 3201 (if (looking-at
3202 "=[a-zA-Z0-9_]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$") 3202 "=[a-zA-Z0-9_]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$")
3203 ;; mark the headers 3203 ;; mark the headers
3204 (cperl-postpone-fontification 3204 (cperl-postpone-fontification
3205 (match-beginning 1) (match-end 1) 3205 (match-beginning 1) (match-end 1)
3206 'face head-face)) 3206 'face head-face))
3207 (while (re-search-forward 3207 (while (re-search-forward
@@ -3209,7 +3209,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3209 "\n\n=[a-zA-Z0-9_]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$" 3209 "\n\n=[a-zA-Z0-9_]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$"
3210 e 'toend) 3210 e 'toend)
3211 ;; mark the headers 3211 ;; mark the headers
3212 (cperl-postpone-fontification 3212 (cperl-postpone-fontification
3213 (match-beginning 1) (match-end 1) 3213 (match-beginning 1) (match-end 1)
3214 'face head-face)))) 3214 'face head-face))))
3215 (cperl-commentify bb e nil) 3215 (cperl-commentify bb e nil)
@@ -3219,7 +3219,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3219 ;; Here document 3219 ;; Here document
3220 ;; We do only one here-per-line 3220 ;; We do only one here-per-line
3221 ;; ;; One extra () before this: 3221 ;; ;; One extra () before this:
3222 ;;"<<" 3222 ;;"<<"
3223 ;; "\\(" ; 1 + 1 3223 ;; "\\(" ; 1 + 1
3224 ;; ;; First variant "BLAH" or just ``. 3224 ;; ;; First variant "BLAH" or just ``.
3225 ;; "\\([\"'`]\\)" ; 2 + 1 3225 ;; "\\([\"'`]\\)" ; 2 + 1
@@ -3239,7 +3239,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3239 state-point b 3239 state-point b
3240 tb (match-beginning 0) 3240 tb (match-beginning 0)
3241 i (or (nth 3 state) (nth 4 state))) 3241 i (or (nth 3 state) (nth 4 state)))
3242 (if i 3242 (if i
3243 (setq c t) 3243 (setq c t)
3244 (setq c (and 3244 (setq c (and
3245 (match-beginning 5) 3245 (match-beginning 5)
@@ -3255,7 +3255,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3255 e1 (match-end 4))) ; 3 + 1 3255 e1 (match-end 4))) ; 3 + 1
3256 (setq tag (buffer-substring b1 e1) 3256 (setq tag (buffer-substring b1 e1)
3257 qtag (regexp-quote tag)) 3257 qtag (regexp-quote tag))
3258 (cond (cperl-pod-here-fontify 3258 (cond (cperl-pod-here-fontify
3259 ;; Highlight the starting delimiter 3259 ;; Highlight the starting delimiter
3260 (cperl-postpone-fontification b1 e1 'face font-lock-constant-face) 3260 (cperl-postpone-fontification b1 e1 'face font-lock-constant-face)
3261 (cperl-put-do-not-fontify b1 e1 t))) 3261 (cperl-put-do-not-fontify b1 e1 t)))
@@ -3263,19 +3263,19 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3263 (setq b (point)) 3263 (setq b (point))
3264 ;; We do not search to max, since we may be called from 3264 ;; We do not search to max, since we may be called from
3265 ;; some hook of fontification, and max is random 3265 ;; some hook of fontification, and max is random
3266 (cond ((re-search-forward (concat "^" qtag "$") 3266 (cond ((re-search-forward (concat "^" qtag "$")
3267 stop-point 'toend) 3267 stop-point 'toend)
3268 (if cperl-pod-here-fontify 3268 (if cperl-pod-here-fontify
3269 (progn 3269 (progn
3270 ;; Highlight the ending delimiter 3270 ;; Highlight the ending delimiter
3271 (cperl-postpone-fontification (match-beginning 0) (match-end 0) 3271 (cperl-postpone-fontification (match-beginning 0) (match-end 0)
3272 'face font-lock-constant-face) 3272 'face font-lock-constant-face)
3273 (cperl-put-do-not-fontify b (match-end 0) t) 3273 (cperl-put-do-not-fontify b (match-end 0) t)
3274 ;; Highlight the HERE-DOC 3274 ;; Highlight the HERE-DOC
3275 (cperl-postpone-fontification b (match-beginning 0) 3275 (cperl-postpone-fontification b (match-beginning 0)
3276 'face here-face))) 3276 'face here-face)))
3277 (setq e1 (cperl-1+ (match-end 0))) 3277 (setq e1 (cperl-1+ (match-end 0)))
3278 (put-text-property b (match-beginning 0) 3278 (put-text-property b (match-beginning 0)
3279 'syntax-type 'here-doc) 3279 'syntax-type 'here-doc)
3280 (put-text-property (match-beginning 0) e1 3280 (put-text-property (match-beginning 0) e1
3281 'syntax-type 'here-doc-delim) 3281 'syntax-type 'here-doc-delim)
@@ -3298,13 +3298,13 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3298 "") 3298 "")
3299 tb (match-beginning 0)) 3299 tb (match-beginning 0))
3300 (setq argument nil) 3300 (setq argument nil)
3301 (if cperl-pod-here-fontify 3301 (if cperl-pod-here-fontify
3302 (while (and (eq (forward-line) 0) 3302 (while (and (eq (forward-line) 0)
3303 (not (looking-at "^[.;]$"))) 3303 (not (looking-at "^[.;]$")))
3304 (cond 3304 (cond
3305 ((looking-at "^#")) ; Skip comments 3305 ((looking-at "^#")) ; Skip comments
3306 ((and argument ; Skip argument multi-lines 3306 ((and argument ; Skip argument multi-lines
3307 (looking-at "^[ \t]*{")) 3307 (looking-at "^[ \t]*{"))
3308 (forward-sexp 1) 3308 (forward-sexp 1)
3309 (setq argument nil)) 3309 (setq argument nil))
3310 (argument ; Skip argument lines 3310 (argument ; Skip argument lines
@@ -3314,7 +3314,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3314 (setq argument (looking-at "^[^\n]*[@^]")) 3314 (setq argument (looking-at "^[^\n]*[@^]"))
3315 (end-of-line) 3315 (end-of-line)
3316 ;; Highlight the format line 3316 ;; Highlight the format line
3317 (cperl-postpone-fontification b1 (point) 3317 (cperl-postpone-fontification b1 (point)
3318 'face font-lock-string-face) 3318 'face font-lock-string-face)
3319 (cperl-commentify b1 (point) nil) 3319 (cperl-commentify b1 (point) nil)
3320 (cperl-put-do-not-fontify b1 (point) t)))) 3320 (cperl-put-do-not-fontify b1 (point) t))))
@@ -3354,14 +3354,14 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3354 (memq bb '(?\$ ?\@ ?\% ?\* ?\#)) ; $#y 3354 (memq bb '(?\$ ?\@ ?\% ?\* ?\#)) ; $#y
3355 (and (eq bb ?-) (eq c ?s)) ; -s file test 3355 (and (eq bb ?-) (eq c ?s)) ; -s file test
3356 (and (eq bb ?\&) ; &&m/blah/ 3356 (and (eq bb ?\&) ; &&m/blah/
3357 (not (eq (char-after 3357 (not (eq (char-after
3358 (- (match-beginning b1) 2)) 3358 (- (match-beginning b1) 2))
3359 ?\&)))) 3359 ?\&))))
3360 ;; <file> or <$file> 3360 ;; <file> or <$file>
3361 (and (eq c ?\<) 3361 (and (eq c ?\<)
3362 ;; Do not stringify <FH> : 3362 ;; Do not stringify <FH> :
3363 (save-match-data 3363 (save-match-data
3364 (looking-at 3364 (looking-at
3365 "\\s *\\$?\\([_a-zA-Z:][_a-zA-Z0-9:]*\\s *\\)?>")))) 3365 "\\s *\\$?\\([_a-zA-Z:][_a-zA-Z0-9:]*\\s *\\)?>"))))
3366 tb (match-beginning 0)) 3366 tb (match-beginning 0))
3367 (goto-char (match-beginning b1)) 3367 (goto-char (match-beginning b1))
@@ -3371,7 +3371,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3371 (setq argument "" 3371 (setq argument ""
3372 bb ; Not a regexp? 3372 bb ; Not a regexp?
3373 (progn 3373 (progn
3374 (not 3374 (not
3375 ;; What is below: regexp-p? 3375 ;; What is below: regexp-p?
3376 (and 3376 (and
3377 (or (memq (preceding-char) 3377 (or (memq (preceding-char)
@@ -3389,7 +3389,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3389 (if (eq (preceding-char) ?-) 3389 (if (eq (preceding-char) ?-)
3390 ;; -d ?foo? is a RE 3390 ;; -d ?foo? is a RE
3391 (looking-at "[a-zA-Z]\\>") 3391 (looking-at "[a-zA-Z]\\>")
3392 (looking-at 3392 (looking-at
3393 "\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\)\\>")))) 3393 "\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\)\\>"))))
3394 (and (eq (preceding-char) ?.) 3394 (and (eq (preceding-char) ?.)
3395 (eq (char-after (- (point) 2)) ?.)) 3395 (eq (char-after (- (point) 2)) ?.))
@@ -3397,7 +3397,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3397 ;; m|blah| ? foo : bar; 3397 ;; m|blah| ? foo : bar;
3398 (not 3398 (not
3399 (and (eq c ?\?) 3399 (and (eq c ?\?)
3400 cperl-use-syntax-table-text-property 3400 cperl-use-syntax-table-text-property
3401 (not (bobp)) 3401 (not (bobp))
3402 (progn 3402 (progn
3403 (forward-char -1) 3403 (forward-char -1)
@@ -3409,7 +3409,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3409 (eq (char-after (- (point) 2)) ?-)) 3409 (eq (char-after (- (point) 2)) ?-))
3410 ;; Not a regexp 3410 ;; Not a regexp
3411 (setq bb t)))) 3411 (setq bb t))))
3412 (or bb (setq state (parse-partial-sexp 3412 (or bb (setq state (parse-partial-sexp
3413 state-point b nil nil state) 3413 state-point b nil nil state)
3414 state-point b)) 3414 state-point b))
3415 (goto-char b) 3415 (goto-char b)
@@ -3431,13 +3431,13 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3431 t st-l err-l argument) 3431 t st-l err-l argument)
3432 ;; Note that if `go', then it is considered as 1-arg 3432 ;; Note that if `go', then it is considered as 1-arg
3433 b1 (nth 1 i) ; start of the second part 3433 b1 (nth 1 i) ; start of the second part
3434 tag (nth 2 i) ; ender-char, true if second part 3434 tag (nth 2 i) ; ender-char, true if second part
3435 ; is with matching chars [] 3435 ; is with matching chars []
3436 go (nth 4 i) ; There is a 1-char part after the end 3436 go (nth 4 i) ; There is a 1-char part after the end
3437 i (car i) ; intermediate point 3437 i (car i) ; intermediate point
3438 e1 (point) ; end 3438 e1 (point) ; end
3439 ;; Before end of the second part if non-matching: /// 3439 ;; Before end of the second part if non-matching: ///
3440 tail (if (and i (not tag)) 3440 tail (if (and i (not tag))
3441 (1- e1)) 3441 (1- e1))
3442 e (if i i e1) ; end of the first part 3442 e (if i i e1) ; end of the first part
3443 qtag nil) ; need to preserve backslashitis 3443 qtag nil) ; need to preserve backslashitis
@@ -3477,7 +3477,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3477 (progn 3477 (progn
3478 (forward-word 1) ; skip modifiers s///s 3478 (forward-word 1) ; skip modifiers s///s
3479 (if tail (cperl-commentify tail (point) t)) 3479 (if tail (cperl-commentify tail (point) t))
3480 (cperl-postpone-fontification 3480 (cperl-postpone-fontification
3481 e1 (point) 'face cperl-nonoverridable-face))) 3481 e1 (point) 'face cperl-nonoverridable-face)))
3482 ;; Check whether it is m// which means "previous match" 3482 ;; Check whether it is m// which means "previous match"
3483 ;; and highlight differently 3483 ;; and highlight differently
@@ -3492,7 +3492,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3492 (forward-sexp -1) 3492 (forward-sexp -1)
3493 (not (looking-at "split\\>"))) 3493 (not (looking-at "split\\>")))
3494 (error t)))) 3494 (error t))))
3495 (cperl-postpone-fontification 3495 (cperl-postpone-fontification
3496 b e 'face font-lock-function-name-face) 3496 b e 'face font-lock-function-name-face)
3497 (if (or i2 ; Has 2 args 3497 (if (or i2 ; Has 2 args
3498 (and cperl-fontify-m-as-s 3498 (and cperl-fontify-m-as-s
@@ -3501,16 +3501,16 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3501 (and (eq 0 (length argument)) 3501 (and (eq 0 (length argument))
3502 (not (eq ?\< (char-after b))))))) 3502 (not (eq ?\< (char-after b)))))))
3503 (progn 3503 (progn
3504 (cperl-postpone-fontification 3504 (cperl-postpone-fontification
3505 b (cperl-1+ b) 'face font-lock-constant-face) 3505 b (cperl-1+ b) 'face font-lock-constant-face)
3506 (cperl-postpone-fontification 3506 (cperl-postpone-fontification
3507 (1- e) e 'face font-lock-constant-face)))) 3507 (1- e) e 'face font-lock-constant-face))))
3508 (if i2 3508 (if i2
3509 (progn 3509 (progn
3510 (cperl-postpone-fontification 3510 (cperl-postpone-fontification
3511 (1- e1) e1 'face font-lock-constant-face) 3511 (1- e1) e1 'face font-lock-constant-face)
3512 (if (assoc (char-after b) cperl-starters) 3512 (if (assoc (char-after b) cperl-starters)
3513 (cperl-postpone-fontification 3513 (cperl-postpone-fontification
3514 b1 (1+ b1) 'face font-lock-constant-face)))) 3514 b1 (1+ b1) 'face font-lock-constant-face))))
3515 (if (> (point) max) 3515 (if (> (point) max)
3516 (setq tmpend tb)))) 3516 (setq tmpend tb))))
@@ -3519,7 +3519,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3519 (if (memq (char-after (1- b)) 3519 (if (memq (char-after (1- b))
3520 '(?\$ ?\@ ?\% ?\& ?\*)) 3520 '(?\$ ?\@ ?\% ?\& ?\*))
3521 nil 3521 nil
3522 (setq state (parse-partial-sexp 3522 (setq state (parse-partial-sexp
3523 state-point b nil nil state) 3523 state-point b nil nil state)
3524 state-point b) 3524 state-point b)
3525 (if (or (nth 3 state) (nth 4 state)) 3525 (if (or (nth 3 state) (nth 4 state))
@@ -3532,7 +3532,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3532 ((and (match-beginning 14) 3532 ((and (match-beginning 14)
3533 (eq (preceding-char) ?\')) ; $' 3533 (eq (preceding-char) ?\')) ; $'
3534 (setq b (1- (point)) 3534 (setq b (1- (point))
3535 state (parse-partial-sexp 3535 state (parse-partial-sexp
3536 state-point (1- b) nil nil state) 3536 state-point (1- b) nil nil state)
3537 state-point (1- b)) 3537 state-point (1- b))
3538 (if (nth 3 state) ; in string 3538 (if (nth 3 state) ; in string
@@ -3548,7 +3548,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3548 ((match-beginning 15) ; old $abc'efg syntax 3548 ((match-beginning 15) ; old $abc'efg syntax
3549 (setq bb (match-end 0) 3549 (setq bb (match-end 0)
3550 b (match-beginning 0) 3550 b (match-beginning 0)
3551 state (parse-partial-sexp 3551 state (parse-partial-sexp
3552 state-point b nil nil state) 3552 state-point b nil nil state)
3553 state-point b) 3553 state-point b)
3554 (if (nth 3 state) ; in string 3554 (if (nth 3 state) ; in string
@@ -3560,7 +3560,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3560 (t ; __END__, __DATA__ 3560 (t ; __END__, __DATA__
3561 (setq bb (match-end 0) 3561 (setq bb (match-end 0)
3562 b (match-beginning 0) 3562 b (match-beginning 0)
3563 state (parse-partial-sexp 3563 state (parse-partial-sexp
3564 state-point b nil nil state) 3564 state-point b nil nil state)
3565 state-point b) 3565 state-point b)
3566 (if (or (nth 3 state) (nth 4 state)) 3566 (if (or (nth 3 state) (nth 4 state))
@@ -3571,7 +3571,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3571 (goto-char bb))) 3571 (goto-char bb)))
3572 (if (> (point) stop-point) 3572 (if (> (point) stop-point)
3573 (progn 3573 (progn
3574 (if end 3574 (if end
3575 (message "Garbage after __END__/__DATA__ ignored") 3575 (message "Garbage after __END__/__DATA__ ignored")
3576 (message "Unbalanced syntax found while scanning") 3576 (message "Unbalanced syntax found while scanning")
3577 (or (car err-l) (setcar err-l b))) 3577 (or (car err-l) (setcar err-l b)))
@@ -3633,7 +3633,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3633TEST is the expression to evaluate at the found position. If absent, 3633TEST is the expression to evaluate at the found position. If absent,
3634CHARS is a string that contains good characters to have before us (however, 3634CHARS is a string that contains good characters to have before us (however,
3635`}' is treated \"smartly\" if it is not in the list)." 3635`}' is treated \"smartly\" if it is not in the list)."
3636 (let (stop p 3636 (let (stop p
3637 (lim (or lim (point-min)))) 3637 (lim (or lim (point-min))))
3638 (save-excursion 3638 (save-excursion
3639 (while (and (not stop) (> (point) lim)) 3639 (while (and (not stop) (> (point) lim))
@@ -3642,7 +3642,7 @@ CHARS is a string that contains good characters to have before us (however,
3642 (beginning-of-line) 3642 (beginning-of-line)
3643 (if (looking-at "^[ \t]*\\(#\\|$\\)") nil ; Only comment, skip 3643 (if (looking-at "^[ \t]*\\(#\\|$\\)") nil ; Only comment, skip
3644 ;; Else: last iteration, or a label 3644 ;; Else: last iteration, or a label
3645 (cperl-to-comment-or-eol) 3645 (cperl-to-comment-or-eol)
3646 (skip-chars-backward " \t") 3646 (skip-chars-backward " \t")
3647 (if (< p (point)) (goto-char p)) 3647 (if (< p (point)) (goto-char p))
3648 (setq p (point)) 3648 (setq p (point))
@@ -3672,7 +3672,7 @@ CHARS is a string that contains good characters to have before us (however,
3672 3672
3673(defun cperl-after-block-and-statement-beg (lim) 3673(defun cperl-after-block-and-statement-beg (lim)
3674 ;; We assume that we are after ?\} 3674 ;; We assume that we are after ?\}
3675 (and 3675 (and
3676 (cperl-after-block-p lim) 3676 (cperl-after-block-p lim)
3677 (save-excursion 3677 (save-excursion
3678 (forward-sexp -1) 3678 (forward-sexp -1)
@@ -3682,7 +3682,7 @@ CHARS is a string that contains good characters to have before us (however,
3682 (not (= (char-syntax (preceding-char)) ?w)) 3682 (not (= (char-syntax (preceding-char)) ?w))
3683 (progn 3683 (progn
3684 (forward-sexp -1) 3684 (forward-sexp -1)
3685 (not 3685 (not
3686 (looking-at 3686 (looking-at
3687 "\\(map\\|grep\\|printf?\\|system\\|exec\\|tr\\|s\\)\\>"))))))) 3687 "\\(map\\|grep\\|printf?\\|system\\|exec\\|tr\\|s\\)\\>")))))))
3688 3688
@@ -3693,7 +3693,7 @@ CHARS is a string that contains good characters to have before us (however,
3693Will not indent comment if it starts at `comment-indent' or looks like 3693Will not indent comment if it starts at `comment-indent' or looks like
3694continuation of the comment on the previous line. 3694continuation of the comment on the previous line.
3695 3695
3696If `cperl-indent-region-fix-constructs', will improve spacing on 3696If `cperl-indent-region-fix-constructs', will improve spacing on
3697conditional/loop constructs." 3697conditional/loop constructs."
3698 (interactive) 3698 (interactive)
3699 (save-excursion 3699 (save-excursion
@@ -3733,14 +3733,14 @@ Returns some position at the last line."
3733 (save-excursion 3733 (save-excursion
3734 (beginning-of-line) 3734 (beginning-of-line)
3735 (setq ret (point)) 3735 (setq ret (point))
3736 ;; }? continue 3736 ;; }? continue
3737 ;; blah; } 3737 ;; blah; }
3738 (if (not 3738 (if (not
3739 (or (looking-at "[ \t]*\\(els\\(e\\|if\\)\\|continue\\|if\\|while\\|for\\(each\\)?\\|until\\)") 3739 (or (looking-at "[ \t]*\\(els\\(e\\|if\\)\\|continue\\|if\\|while\\|for\\(each\\)?\\|until\\)")
3740 (setq have-brace (save-excursion (search-forward "}" ee t))))) 3740 (setq have-brace (save-excursion (search-forward "}" ee t)))))
3741 nil ; Do not need to do anything 3741 nil ; Do not need to do anything
3742 ;; Looking at: 3742 ;; Looking at:
3743 ;; } 3743 ;; }
3744 ;; else 3744 ;; else
3745 (if (and cperl-merge-trailing-else 3745 (if (and cperl-merge-trailing-else
3746 (looking-at 3746 (looking-at
@@ -3762,7 +3762,7 @@ Returns some position at the last line."
3762 (beginning-of-line))) 3762 (beginning-of-line)))
3763 ;; Looking at: 3763 ;; Looking at:
3764 ;; else { 3764 ;; else {
3765 (if (looking-at 3765 (if (looking-at
3766 "[ \t]*}?[ \t]*\\<\\(\\els\\(e\\|if\\)\\|continue\\|unless\\|if\\|while\\|for\\(each\\)?\\|until\\)\\>\\(\t*\\|[ \t][ \t]+\\)[^ \t\n#]") 3766 "[ \t]*}?[ \t]*\\<\\(\\els\\(e\\|if\\)\\|continue\\|unless\\|if\\|while\\|for\\(each\\)?\\|until\\)\\>\\(\t*\\|[ \t][ \t]+\\)[^ \t\n#]")
3767 (progn 3767 (progn
3768 (forward-word 1) 3768 (forward-word 1)
@@ -3771,7 +3771,7 @@ Returns some position at the last line."
3771 (beginning-of-line))) 3771 (beginning-of-line)))
3772 ;; Looking at: 3772 ;; Looking at:
3773 ;; foreach my $var 3773 ;; foreach my $var
3774 (if (looking-at 3774 (if (looking-at
3775 "[ \t]*\\<for\\(each\\)?[ \t]+\\(my\\|local\\)\\(\t*\\|[ \t][ \t]+\\)[^ \t\n]") 3775 "[ \t]*\\<for\\(each\\)?[ \t]+\\(my\\|local\\)\\(\t*\\|[ \t][ \t]+\\)[^ \t\n]")
3776 (progn 3776 (progn
3777 (forward-word 2) 3777 (forward-word 2)
@@ -3780,7 +3780,7 @@ Returns some position at the last line."
3780 (beginning-of-line))) 3780 (beginning-of-line)))
3781 ;; Looking at: 3781 ;; Looking at:
3782 ;; foreach my $var ( 3782 ;; foreach my $var (
3783 (if (looking-at 3783 (if (looking-at
3784 "[ \t]*\\<for\\(each\\)?[ \t]+\\(my\\|local\\)[ \t]*\\$[_a-zA-Z0-9]+\\(\t*\\|[ \t][ \t]+\\)[^ \t\n#]") 3784 "[ \t]*\\<for\\(each\\)?[ \t]+\\(my\\|local\\)[ \t]*\\$[_a-zA-Z0-9]+\\(\t*\\|[ \t][ \t]+\\)[^ \t\n#]")
3785 (progn 3785 (progn
3786 (forward-word 3) 3786 (forward-word 3)
@@ -3790,7 +3790,7 @@ Returns some position at the last line."
3790 (beginning-of-line))) 3790 (beginning-of-line)))
3791 ;; Looking at: 3791 ;; Looking at:
3792 ;; } foreach my $var () { 3792 ;; } foreach my $var () {
3793 (if (looking-at 3793 (if (looking-at
3794 "[ \t]*\\(}[ \t]*\\)?\\<\\(\\els\\(e\\|if\\)\\|continue\\|if\\|unless\\|while\\|for\\(each\\)?\\(\\([ t]+\\(my\\|local\\)\\)?[ \t]*\\$[_a-zA-Z0-9]+\\)?\\|until\\)\\>\\([ \t]*(\\|[ \t\n]*{\\)\\|[ \t]*{") 3794 "[ \t]*\\(}[ \t]*\\)?\\<\\(\\els\\(e\\|if\\)\\|continue\\|if\\|unless\\|while\\|for\\(each\\)?\\(\\([ t]+\\(my\\|local\\)\\)?[ \t]*\\$[_a-zA-Z0-9]+\\)?\\|until\\)\\>\\([ \t]*(\\|[ \t\n]*{\\)\\|[ \t]*{")
3795 (progn 3795 (progn
3796 (setq ml (match-beginning 8)) 3796 (setq ml (match-beginning 8))
@@ -3813,12 +3813,12 @@ Returns some position at the last line."
3813 (if (and (or (not pp) (< pp end)) 3813 (if (and (or (not pp) (< pp end))
3814 (looking-at "[ \t\n]*{")) 3814 (looking-at "[ \t\n]*{"))
3815 (progn 3815 (progn
3816 (cond 3816 (cond
3817 ((bolp) ; Were before `{', no if/else/etc 3817 ((bolp) ; Were before `{', no if/else/etc
3818 nil) 3818 nil)
3819 ((looking-at "\\(\t*\\| [ \t]+\\){") 3819 ((looking-at "\\(\t*\\| [ \t]+\\){")
3820 (delete-horizontal-space) 3820 (delete-horizontal-space)
3821 (if (if ml 3821 (if (if ml
3822 cperl-extra-newline-before-brace-multiline 3822 cperl-extra-newline-before-brace-multiline
3823 cperl-extra-newline-before-brace) 3823 cperl-extra-newline-before-brace)
3824 (progn 3824 (progn
@@ -3826,13 +3826,13 @@ Returns some position at the last line."
3826 (insert "\n") 3826 (insert "\n")
3827 (setq ret (point)) 3827 (setq ret (point))
3828 (if (cperl-indent-line parse-data) 3828 (if (cperl-indent-line parse-data)
3829 (progn 3829 (progn
3830 (cperl-fix-line-spacing end parse-data) 3830 (cperl-fix-line-spacing end parse-data)
3831 (setq ret (point))))) 3831 (setq ret (point)))))
3832 (insert 3832 (insert
3833 (make-string cperl-indent-region-fix-constructs ?\ )))) 3833 (make-string cperl-indent-region-fix-constructs ?\ ))))
3834 ((and (looking-at "[ \t]*\n") 3834 ((and (looking-at "[ \t]*\n")
3835 (not (if ml 3835 (not (if ml
3836 cperl-extra-newline-before-brace-multiline 3836 cperl-extra-newline-before-brace-multiline
3837 cperl-extra-newline-before-brace))) 3837 cperl-extra-newline-before-brace)))
3838 (setq pp (point)) 3838 (setq pp (point))
@@ -3863,16 +3863,16 @@ Returns some position at the last line."
3863 ;; Now check whether there is a hanging `}' 3863 ;; Now check whether there is a hanging `}'
3864 ;; Looking at: 3864 ;; Looking at:
3865 ;; } blah 3865 ;; } blah
3866 (if (and 3866 (if (and
3867 cperl-fix-hanging-brace-when-indent 3867 cperl-fix-hanging-brace-when-indent
3868 have-brace 3868 have-brace
3869 (not (looking-at "[ \t]*}[ \t]*\\(\\<\\(els\\(if\\|e\\)\\|continue\\|while\\|until\\)\\>\\|$\\|#\\)")) 3869 (not (looking-at "[ \t]*}[ \t]*\\(\\<\\(els\\(if\\|e\\)\\|continue\\|while\\|until\\)\\>\\|$\\|#\\)"))
3870 (condition-case nil 3870 (condition-case nil
3871 (progn 3871 (progn
3872 (up-list 1) 3872 (up-list 1)
3873 (if (and (<= (point) pp) 3873 (if (and (<= (point) pp)
3874 (eq (preceding-char) ?\} ) 3874 (eq (preceding-char) ?\} )
3875 (cperl-after-block-and-statement-beg (point-min))) 3875 (cperl-after-block-and-statement-beg (point-min)))
3876 t 3876 t
3877 (goto-char p) 3877 (goto-char p)
3878 nil)) 3878 nil))
@@ -3908,12 +3908,12 @@ Returns some position at the last line."
3908 3908
3909(defun cperl-indent-region (start end) 3909(defun cperl-indent-region (start end)
3910 "Simple variant of indentation of region in CPerl mode. 3910 "Simple variant of indentation of region in CPerl mode.
3911Should be slow. Will not indent comment if it starts at `comment-indent' 3911Should be slow. Will not indent comment if it starts at `comment-indent'
3912or looks like continuation of the comment on the previous line. 3912or looks like continuation of the comment on the previous line.
3913Indents all the lines whose first character is between START and END 3913Indents all the lines whose first character is between START and END
3914inclusive. 3914inclusive.
3915 3915
3916If `cperl-indent-region-fix-constructs', will improve spacing on 3916If `cperl-indent-region-fix-constructs', will improve spacing on
3917conditional/loop constructs." 3917conditional/loop constructs."
3918 (interactive "r") 3918 (interactive "r")
3919 (cperl-update-syntaxification end end) 3919 (cperl-update-syntaxification end end)
@@ -3937,13 +3937,13 @@ conditional/loop constructs."
3937 (message "Indenting... For feedback load `imenu'...")) 3937 (message "Indenting... For feedback load `imenu'..."))
3938 (while (and (<= (point) end) (not (eobp))) ; bol to check start 3938 (while (and (<= (point) end) (not (eobp))) ; bol to check start
3939 (and (fboundp 'imenu-progress-message) 3939 (and (fboundp 'imenu-progress-message)
3940 (imenu-progress-message 3940 (imenu-progress-message
3941 pm (/ (* 100 (- (point) start)) (- end start -1)))) 3941 pm (/ (* 100 (- (point) start)) (- end start -1))))
3942 (setq st (point)) 3942 (setq st (point))
3943 (if (or 3943 (if (or
3944 (setq empty (looking-at "[ \t]*\n")) 3944 (setq empty (looking-at "[ \t]*\n"))
3945 (and (setq comm (looking-at "[ \t]*#")) 3945 (and (setq comm (looking-at "[ \t]*#"))
3946 (or (eq (current-indentation) (or old-comm-indent 3946 (or (eq (current-indentation) (or old-comm-indent
3947 comment-column)) 3947 comment-column))
3948 (setq old-comm-indent nil)))) 3948 (setq old-comm-indent nil))))
3949 (if (and old-comm-indent 3949 (if (and old-comm-indent
@@ -3954,19 +3954,19 @@ conditional/loop constructs."
3954 cperl-st-cfence))) 3954 cperl-st-cfence)))
3955 (let ((comment-column new-comm-indent)) 3955 (let ((comment-column new-comm-indent))
3956 (indent-for-comment))) 3956 (indent-for-comment)))
3957 (progn 3957 (progn
3958 (setq i (cperl-indent-line indent-info)) 3958 (setq i (cperl-indent-line indent-info))
3959 (or comm 3959 (or comm
3960 (not i) 3960 (not i)
3961 (progn 3961 (progn
3962 (if cperl-indent-region-fix-constructs 3962 (if cperl-indent-region-fix-constructs
3963 (goto-char (cperl-fix-line-spacing end indent-info))) 3963 (goto-char (cperl-fix-line-spacing end indent-info)))
3964 (if (setq old-comm-indent 3964 (if (setq old-comm-indent
3965 (and (cperl-to-comment-or-eol) 3965 (and (cperl-to-comment-or-eol)
3966 (not (memq (get-text-property (point) 3966 (not (memq (get-text-property (point)
3967 'syntax-type) 3967 'syntax-type)
3968 '(pod here-doc))) 3968 '(pod here-doc)))
3969 (not (eq (get-text-property (point) 3969 (not (eq (get-text-property (point)
3970 'syntax-table) 3970 'syntax-table)
3971 cperl-st-cfence)) 3971 cperl-st-cfence))
3972 (current-column))) 3972 (current-column)))
@@ -4024,13 +4024,13 @@ indentation and initial hashes. Behaves usually outside of comment."
4024 ((cperl-to-comment-or-eol) 4024 ((cperl-to-comment-or-eol)
4025 (setq has-comment t) 4025 (setq has-comment t)
4026 (looking-at "#+[ \t]*") 4026 (looking-at "#+[ \t]*")
4027 (setq start (point) c (current-column) 4027 (setq start (point) c (current-column)
4028 comment-fill-prefix 4028 comment-fill-prefix
4029 (concat (make-string (current-column) ?\ ) 4029 (concat (make-string (current-column) ?\ )
4030 (buffer-substring (match-beginning 0) (match-end 0))) 4030 (buffer-substring (match-beginning 0) (match-end 0)))
4031 spaces (progn (skip-chars-backward " \t") 4031 spaces (progn (skip-chars-backward " \t")
4032 (buffer-substring (point) start)) 4032 (buffer-substring (point) start))
4033 dc (- c (current-column)) len (- start (point)) 4033 dc (- c (current-column)) len (- start (point))
4034 start (point-marker)) 4034 start (point-marker))
4035 (delete-char len) 4035 (delete-char len)
4036 (insert (make-string dc ?-))))) 4036 (insert (make-string dc ?-)))))
@@ -4057,7 +4057,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4057 (goto-char (point-min)) 4057 (goto-char (point-min))
4058 (while (progn (forward-line 1) (< (point) (point-max))) 4058 (while (progn (forward-line 1) (< (point) (point-max)))
4059 (skip-chars-forward " \t") 4059 (skip-chars-forward " \t")
4060 (and (looking-at "#+") 4060 (and (looking-at "#+")
4061 (delete-char (- (match-end 0) (match-beginning 0))))) 4061 (delete-char (- (match-end 0) (match-beginning 0)))))
4062 4062
4063 ;; Lines with only hashes on them can be paragraph boundaries. 4063 ;; Lines with only hashes on them can be paragraph boundaries.
@@ -4066,7 +4066,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4066 (fill-prefix comment-fill-prefix)) 4066 (fill-prefix comment-fill-prefix))
4067 (fill-paragraph justify))) 4067 (fill-paragraph justify)))
4068 (if (and start) 4068 (if (and start)
4069 (progn 4069 (progn
4070 (goto-char start) 4070 (goto-char start)
4071 (if (> dc 0) 4071 (if (> dc 0)
4072 (progn (delete-char dc) (insert spaces))) 4072 (progn (delete-char dc) (insert spaces)))
@@ -4090,7 +4090,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4090 (cperl-fill-paragraph) 4090 (cperl-fill-paragraph)
4091 (goto-char marker) 4091 (goto-char marker)
4092 ;; Is not enough, sometimes marker is a start of line 4092 ;; Is not enough, sometimes marker is a start of line
4093 (if (bolp) (progn (re-search-forward "#+[ \t]*") 4093 (if (bolp) (progn (re-search-forward "#+[ \t]*")
4094 (goto-char (match-end 0)))) 4094 (goto-char (match-end 0))))
4095 ;; Following space could have gone: 4095 ;; Following space could have gone:
4096 (if (or (not s) (memq (following-char) '(?\ ?\t))) nil 4096 (if (or (not s) (memq (following-char) '(?\ ?\t))) nil
@@ -4100,7 +4100,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4100 (or (memq (preceding-char) '(?\ ?\t)) (insert " ")))))) 4100 (or (memq (preceding-char) '(?\ ?\t)) (insert " "))))))
4101 4101
4102(defvar cperl-imenu--function-name-regexp-perl 4102(defvar cperl-imenu--function-name-regexp-perl
4103 (concat 4103 (concat
4104 "^\\(" 4104 "^\\("
4105 "[ \t]*\\(sub\\|package\\)[ \t\n]+\\([a-zA-Z_0-9:']+\\)[ \t]*\\(([^()]*)[ \t]*\\)?" 4105 "[ \t]*\\(sub\\|package\\)[ \t\n]+\\([a-zA-Z_0-9:']+\\)[ \t]*\\(([^()]*)[ \t]*\\)?"
4106 "\\|" 4106 "\\|"
@@ -4113,7 +4113,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4113 ;; applied twice without ISBACK set. 4113 ;; applied twice without ISBACK set.
4114 (cond ((not cperl-imenu-addback) lst) 4114 (cond ((not cperl-imenu-addback) lst)
4115 (t 4115 (t
4116 (or name 4116 (or name
4117 (setq name "+++BACK+++")) 4117 (setq name "+++BACK+++"))
4118 (mapcar (function (lambda (elt) 4118 (mapcar (function (lambda (elt)
4119 (if (and (listp elt) (listp (cdr elt))) 4119 (if (and (listp elt) (listp (cdr elt)))
@@ -4129,7 +4129,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4129 4129
4130(defun cperl-imenu--create-perl-index (&optional regexp) 4130(defun cperl-imenu--create-perl-index (&optional regexp)
4131 (require 'imenu) ; May be called from TAGS creator 4131 (require 'imenu) ; May be called from TAGS creator
4132 (let ((index-alist '()) (index-pack-alist '()) (index-pod-alist '()) 4132 (let ((index-alist '()) (index-pack-alist '()) (index-pod-alist '())
4133 (index-unsorted-alist '()) (i-s-f (default-value 'imenu-sort-function)) 4133 (index-unsorted-alist '()) (i-s-f (default-value 'imenu-sort-function))
4134 (index-meth-alist '()) meth 4134 (index-meth-alist '()) meth
4135 packages ends-ranges p 4135 packages ends-ranges p
@@ -4164,7 +4164,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4164 ) 4164 )
4165 ;; (if (looking-at "([^()]*)[ \t\n\f]*") 4165 ;; (if (looking-at "([^()]*)[ \t\n\f]*")
4166 ;; (goto-char (match-end 0))) ; Messes what follows 4166 ;; (goto-char (match-end 0))) ; Messes what follows
4167 (setq char (following-char) 4167 (setq char (following-char)
4168 meth nil 4168 meth nil
4169 p (point)) 4169 p (point))
4170 (while (and ends-ranges (>= p (car ends-ranges))) 4170 (while (and ends-ranges (>= p (car ends-ranges)))
@@ -4177,9 +4177,9 @@ indentation and initial hashes. Behaves usually outside of comment."
4177 name (progn 4177 name (progn
4178 (set-text-properties 0 (length name) nil name) 4178 (set-text-properties 0 (length name) nil name)
4179 name) 4179 name)
4180 package (concat name "::") 4180 package (concat name "::")
4181 name (concat "package " name) 4181 name (concat "package " name)
4182 end-range 4182 end-range
4183 (save-excursion 4183 (save-excursion
4184 (parse-partial-sexp (point) (point-max) -1) (point)) 4184 (parse-partial-sexp (point) (point-max) -1) (point))
4185 ends-ranges (cons end-range ends-ranges) 4185 ends-ranges (cons end-range ends-ranges)
@@ -4194,10 +4194,10 @@ indentation and initial hashes. Behaves usually outside of comment."
4194 (cond ((string-match "[:']" name) 4194 (cond ((string-match "[:']" name)
4195 (setq meth t)) 4195 (setq meth t))
4196 ((> p end-range) nil) 4196 ((> p end-range) nil)
4197 (t 4197 (t
4198 (setq name (concat package name) meth t)))) 4198 (setq name (concat package name) meth t))))
4199 (setcar index name) 4199 (setcar index name)
4200 (if (eq fchar ?p) 4200 (if (eq fchar ?p)
4201 (push index index-pack-alist) 4201 (push index index-pack-alist)
4202 (push index index-alist)) 4202 (push index index-alist))
4203 (if meth (push index index-meth-alist)) 4203 (if meth (push index index-meth-alist))
@@ -4215,7 +4215,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4215 (push index1 index-unsorted-alist))))) 4215 (push index1 index-unsorted-alist)))))
4216 (or noninteractive 4216 (or noninteractive
4217 (imenu-progress-message prev-pos 100)) 4217 (imenu-progress-message prev-pos 100))
4218 (setq index-alist 4218 (setq index-alist
4219 (if (default-value 'imenu-sort-function) 4219 (if (default-value 'imenu-sort-function)
4220 (sort index-alist (default-value 'imenu-sort-function)) 4220 (sort index-alist (default-value 'imenu-sort-function))
4221 (nreverse index-alist))) 4221 (nreverse index-alist)))
@@ -4235,22 +4235,22 @@ indentation and initial hashes. Behaves usually outside of comment."
4235 (setq elt (car lst) lst (cdr lst)) 4235 (setq elt (car lst) lst (cdr lst))
4236 (cond ((string-match "\\(::\\|'\\)[_a-zA-Z0-9]+$" (car elt)) 4236 (cond ((string-match "\\(::\\|'\\)[_a-zA-Z0-9]+$" (car elt))
4237 (setq pack (substring (car elt) 0 (match-beginning 0))) 4237 (setq pack (substring (car elt) 0 (match-beginning 0)))
4238 (if (setq group (assoc pack hier-list)) 4238 (if (setq group (assoc pack hier-list))
4239 (if (listp (cdr group)) 4239 (if (listp (cdr group))
4240 ;; Have some functions already 4240 ;; Have some functions already
4241 (setcdr group 4241 (setcdr group
4242 (cons (cons (substring 4242 (cons (cons (substring
4243 (car elt) 4243 (car elt)
4244 (+ 2 (match-beginning 0))) 4244 (+ 2 (match-beginning 0)))
4245 (cdr elt)) 4245 (cdr elt))
4246 (cdr group))) 4246 (cdr group)))
4247 (setcdr group (list (cons (substring 4247 (setcdr group (list (cons (substring
4248 (car elt) 4248 (car elt)
4249 (+ 2 (match-beginning 0))) 4249 (+ 2 (match-beginning 0)))
4250 (cdr elt))))) 4250 (cdr elt)))))
4251 (setq hier-list 4251 (setq hier-list
4252 (cons (cons pack 4252 (cons (cons pack
4253 (list (cons (substring 4253 (list (cons (substring
4254 (car elt) 4254 (car elt)
4255 (+ 2 (match-beginning 0))) 4255 (+ 2 (match-beginning 0)))
4256 (cdr elt)))) 4256 (cdr elt))))
@@ -4262,7 +4262,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4262 (push (cons "+Packages+..." 4262 (push (cons "+Packages+..."
4263 (nreverse index-pack-alist)) 4263 (nreverse index-pack-alist))
4264 index-alist)) 4264 index-alist))
4265 (and (or index-pack-alist index-pod-alist 4265 (and (or index-pack-alist index-pod-alist
4266 (default-value 'imenu-sort-function)) 4266 (default-value 'imenu-sort-function))
4267 index-unsorted-alist 4267 index-unsorted-alist
4268 (push (cons "+Unsorted List+..." 4268 (push (cons "+Unsorted List+..."
@@ -4270,7 +4270,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4270 index-alist)) 4270 index-alist))
4271 (cperl-imenu-addback index-alist))) 4271 (cperl-imenu-addback index-alist)))
4272 4272
4273(defvar cperl-compilation-error-regexp-alist 4273(defvar cperl-compilation-error-regexp-alist
4274 ;; This look like a paranoiac regexp: could anybody find a better one? (which WORK). 4274 ;; This look like a paranoiac regexp: could anybody find a better one? (which WORK).
4275 '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]" 4275 '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]"
4276 2 3)) 4276 2 3))
@@ -4338,7 +4338,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4338 (let (t-font-lock-keywords t-font-lock-keywords-1 font-lock-anchored) 4338 (let (t-font-lock-keywords t-font-lock-keywords-1 font-lock-anchored)
4339 (if (fboundp 'font-lock-fontify-anchored-keywords) 4339 (if (fboundp 'font-lock-fontify-anchored-keywords)
4340 (setq font-lock-anchored t)) 4340 (setq font-lock-anchored t))
4341 (setq 4341 (setq
4342 t-font-lock-keywords 4342 t-font-lock-keywords
4343 (list 4343 (list
4344 (list "[ \t]+$" 0 cperl-invalid-face t) 4344 (list "[ \t]+$" 0 cperl-invalid-face t)
@@ -4391,7 +4391,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4391 ;; "telldir" "time" "times" "truncate" "uc" "ucfirst" 4391 ;; "telldir" "time" "times" "truncate" "uc" "ucfirst"
4392 ;; "umask" "unlink" "unpack" "utime" "values" "vec" 4392 ;; "umask" "unlink" "unpack" "utime" "values" "vec"
4393 ;; "wait" "waitpid" "wantarray" "warn" "write" "x" "xor" 4393 ;; "wait" "waitpid" "wantarray" "warn" "write" "x" "xor"
4394 "a\\(bs\\|ccept\\|tan2\\|larm\\|nd\\)\\|" 4394 "a\\(bs\\|ccept\\|tan2\\|larm\\|nd\\)\\|"
4395 "b\\(in\\(d\\|mode\\)\\|less\\)\\|" 4395 "b\\(in\\(d\\|mode\\)\\|less\\)\\|"
4396 "c\\(h\\(r\\(\\|oot\\)\\|dir\\|mod\\|own\\)\\|aller\\|rypt\\|" 4396 "c\\(h\\(r\\(\\|oot\\)\\|dir\\|mod\\|own\\)\\|aller\\|rypt\\|"
4397 "lose\\(\\|dir\\)\\|mp\\|o\\(s\\|n\\(tinue\\|nect\\)\\)\\)\\|" 4397 "lose\\(\\|dir\\)\\|mp\\|o\\(s\\|n\\(tinue\\|nect\\)\\)\\)\\|"
@@ -4462,7 +4462,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4462 '("^[ \t]*format[ \t]+\\([a-zA-z_][a-zA-z_0-9:]*\\)[ \t]*=[ \t]*$" 4462 '("^[ \t]*format[ \t]+\\([a-zA-z_][a-zA-z_0-9:]*\\)[ \t]*=[ \t]*$"
4463 1 font-lock-function-name-face) 4463 1 font-lock-function-name-face)
4464 (cond ((featurep 'font-lock-extra) 4464 (cond ((featurep 'font-lock-extra)
4465 '("\\([]}\\\\%@>*&]\\|\\$[a-zA-Z0-9_:]*\\)[ \t]*{[ \t]*\\(-?[a-zA-Z0-9_:]+\\)[ \t]*}" 4465 '("\\([]}\\\\%@>*&]\\|\\$[a-zA-Z0-9_:]*\\)[ \t]*{[ \t]*\\(-?[a-zA-Z0-9_:]+\\)[ \t]*}"
4466 (2 font-lock-string-face t) 4466 (2 font-lock-string-face t)
4467 (0 '(restart 2 t)))) ; To highlight $a{bc}{ef} 4467 (0 '(restart 2 t)))) ; To highlight $a{bc}{ef}
4468 (font-lock-anchored 4468 (font-lock-anchored
@@ -4475,7 +4475,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4475 2 font-lock-string-face t))) 4475 2 font-lock-string-face t)))
4476 '("[\[ \t{,(]\\(-?[a-zA-Z0-9_:]+\\)[ \t]*=>" 1 4476 '("[\[ \t{,(]\\(-?[a-zA-Z0-9_:]+\\)[ \t]*=>" 1
4477 font-lock-string-face t) 4477 font-lock-string-face t)
4478 '("^[ \t]*\\([a-zA-Z0-9_]+[ \t]*:\\)[ \t]*\\($\\|{\\|\\<\\(until\\|while\\|for\\(each\\)?\\|do\\)\\>\\)" 1 4478 '("^[ \t]*\\([a-zA-Z0-9_]+[ \t]*:\\)[ \t]*\\($\\|{\\|\\<\\(until\\|while\\|for\\(each\\)?\\|do\\)\\>\\)" 1
4479 font-lock-constant-face) ; labels 4479 font-lock-constant-face) ; labels
4480 '("\\<\\(continue\\|next\\|last\\|redo\\|goto\\)\\>[ \t]+\\([a-zA-Z0-9_:]+\\)" ; labels as targets 4480 '("\\<\\(continue\\|next\\|last\\|redo\\|goto\\)\\>[ \t]+\\([a-zA-Z0-9_:]+\\)" ; labels as targets
4481 2 font-lock-constant-face) 4481 2 font-lock-constant-face)
@@ -4485,7 +4485,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4485 (4 '(another 4 nil 4485 (4 '(another 4 nil
4486 ("\\=[ \t]*,[ \t]*\\([$@%*][a-zA-Z0-9_:]+\\)\\([ \t]*,\\)?" 4486 ("\\=[ \t]*,[ \t]*\\([$@%*][a-zA-Z0-9_:]+\\)\\([ \t]*,\\)?"
4487 (1 font-lock-variable-name-face) 4487 (1 font-lock-variable-name-face)
4488 (2 '(restart 2 nil) nil t))) 4488 (2 '(restart 2 nil) nil t)))
4489 nil t))) ; local variables, multiple 4489 nil t))) ; local variables, multiple
4490 (font-lock-anchored 4490 (font-lock-anchored
4491 '("^[ \t{}]*\\(my\\|local\\)[ \t]*\\(([ \t]*\\)?\\([$@%*][a-zA-Z0-9_:]+\\)" 4491 '("^[ \t{}]*\\(my\\|local\\)[ \t]*\\(([ \t]*\\)?\\([$@%*][a-zA-Z0-9_:]+\\)"
@@ -4497,7 +4497,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4497 3 font-lock-variable-name-face))) 4497 3 font-lock-variable-name-face)))
4498 '("\\<for\\(each\\)?[ \t]*\\(\\$[a-zA-Z_][a-zA-Z_0-9]*\\)[ \t]*(" 4498 '("\\<for\\(each\\)?[ \t]*\\(\\$[a-zA-Z_][a-zA-Z_0-9]*\\)[ \t]*("
4499 2 font-lock-variable-name-face))) 4499 2 font-lock-variable-name-face)))
4500 (setq 4500 (setq
4501 t-font-lock-keywords-1 4501 t-font-lock-keywords-1
4502 (and (fboundp 'turn-on-font-lock) ; Check for newer font-lock 4502 (and (fboundp 'turn-on-font-lock) ; Check for newer font-lock
4503 (not cperl-xemacs-p) ; not yet as of XEmacs 19.12 4503 (not cperl-xemacs-p) ; not yet as of XEmacs 19.12
@@ -4509,7 +4509,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4509 t) ; arrays and hashes 4509 t) ; arrays and hashes
4510 ("\\(\\([$@]+\\)[a-zA-Z_:][a-zA-Z0-9_:]*\\)[ \t]*\\([[{]\\)" 4510 ("\\(\\([$@]+\\)[a-zA-Z_:][a-zA-Z0-9_:]*\\)[ \t]*\\([[{]\\)"
4511 1 4511 1
4512 (if (= (- (match-end 2) (match-beginning 2)) 1) 4512 (if (= (- (match-end 2) (match-beginning 2)) 1)
4513 (if (eq (char-after (match-beginning 3)) ?{) 4513 (if (eq (char-after (match-beginning 3)) ?{)
4514 cperl-hash-face 4514 cperl-hash-face
4515 cperl-array-face) ; arrays and hashes 4515 cperl-array-face) ; arrays and hashes
@@ -4517,13 +4517,13 @@ indentation and initial hashes. Behaves usually outside of comment."
4517 t) 4517 t)
4518 ;;("\\([smy]\\|tr\\)\\([^a-z_A-Z0-9]\\)\\(\\([^\n\\]*||\\)\\)\\2") 4518 ;;("\\([smy]\\|tr\\)\\([^a-z_A-Z0-9]\\)\\(\\([^\n\\]*||\\)\\)\\2")
4519 ;;; Too much noise from \s* @s[ and friends 4519 ;;; Too much noise from \s* @s[ and friends
4520 ;;("\\(\\<\\([msy]\\|tr\\)[ \t]*\\([^ \t\na-zA-Z0-9_]\\)\\|\\(/\\)\\)" 4520 ;;("\\(\\<\\([msy]\\|tr\\)[ \t]*\\([^ \t\na-zA-Z0-9_]\\)\\|\\(/\\)\\)"
4521 ;;(3 font-lock-function-name-face t t) 4521 ;;(3 font-lock-function-name-face t t)
4522 ;;(4 4522 ;;(4
4523 ;; (if (cperl-slash-is-regexp) 4523 ;; (if (cperl-slash-is-regexp)
4524 ;; font-lock-function-name-face 'default) nil t)) 4524 ;; font-lock-function-name-face 'default) nil t))
4525 ))) 4525 )))
4526 (setq perl-font-lock-keywords-1 4526 (setq perl-font-lock-keywords-1
4527 (if cperl-syntaxify-by-font-lock 4527 (if cperl-syntaxify-by-font-lock
4528 (cons 'cperl-fontify-update 4528 (cons 'cperl-fontify-update
4529 t-font-lock-keywords) 4529 t-font-lock-keywords)
@@ -4608,13 +4608,13 @@ indentation and initial hashes. Behaves usually outside of comment."
4608 (defvar cperl-guessed-background nil 4608 (defvar cperl-guessed-background nil
4609 "Display characteristics as guessed by cperl.") 4609 "Display characteristics as guessed by cperl.")
4610;; (or (fboundp 'x-color-defined-p) 4610;; (or (fboundp 'x-color-defined-p)
4611;; (defalias 'x-color-defined-p 4611;; (defalias 'x-color-defined-p
4612;; (cond ((fboundp 'color-defined-p) 'color-defined-p) 4612;; (cond ((fboundp 'color-defined-p) 'color-defined-p)
4613;; ;; XEmacs >= 19.12 4613;; ;; XEmacs >= 19.12
4614;; ((fboundp 'valid-color-name-p) 'valid-color-name-p) 4614;; ((fboundp 'valid-color-name-p) 'valid-color-name-p)
4615;; ;; XEmacs 19.11 4615;; ;; XEmacs 19.11
4616;; (t 'x-valid-color-name-p)))) 4616;; (t 'x-valid-color-name-p))))
4617 (cperl-force-face font-lock-constant-face 4617 (cperl-force-face font-lock-constant-face
4618 "Face for constant and label names") 4618 "Face for constant and label names")
4619 (cperl-force-face font-lock-variable-name-face 4619 (cperl-force-face font-lock-variable-name-face
4620 "Face for variable names") 4620 "Face for variable names")
@@ -4654,18 +4654,18 @@ indentation and initial hashes. Behaves usually outside of comment."
4654 ;; 'font-lock-function-name-face 4654 ;; 'font-lock-function-name-face
4655 ;; "Face to use for function names."))) 4655 ;; "Face to use for function names.")))
4656 (if (and 4656 (if (and
4657 (not (cperl-is-face 'cperl-array-face)) 4657 (not (cperl-is-face 'cperl-array-face))
4658 (cperl-is-face 'font-lock-emphasized-face)) 4658 (cperl-is-face 'font-lock-emphasized-face))
4659 (copy-face 'font-lock-emphasized-face 'cperl-array-face)) 4659 (copy-face 'font-lock-emphasized-face 'cperl-array-face))
4660 (if (and 4660 (if (and
4661 (not (cperl-is-face 'cperl-hash-face)) 4661 (not (cperl-is-face 'cperl-hash-face))
4662 (cperl-is-face 'font-lock-other-emphasized-face)) 4662 (cperl-is-face 'font-lock-other-emphasized-face))
4663 (copy-face 'font-lock-other-emphasized-face 4663 (copy-face 'font-lock-other-emphasized-face
4664 'cperl-hash-face)) 4664 'cperl-hash-face))
4665 (if (and 4665 (if (and
4666 (not (cperl-is-face 'cperl-nonoverridable-face)) 4666 (not (cperl-is-face 'cperl-nonoverridable-face))
4667 (cperl-is-face 'font-lock-other-type-face)) 4667 (cperl-is-face 'font-lock-other-type-face))
4668 (copy-face 'font-lock-other-type-face 4668 (copy-face 'font-lock-other-type-face
4669 'cperl-nonoverridable-face)) 4669 'cperl-nonoverridable-face))
4670 ;;(or (boundp 'cperl-hash-face) 4670 ;;(or (boundp 'cperl-hash-face)
4671 ;; (defconst cperl-hash-face 4671 ;; (defconst cperl-hash-face
@@ -4679,7 +4679,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4679 (let ((background 4679 (let ((background
4680 (if (boundp 'font-lock-background-mode) 4680 (if (boundp 'font-lock-background-mode)
4681 font-lock-background-mode 4681 font-lock-background-mode
4682 'light)) 4682 'light))
4683 (face-list (and (fboundp 'face-list) (face-list))) 4683 (face-list (and (fboundp 'face-list) (face-list)))
4684 ;; cperl-is-face 4684 ;; cperl-is-face
4685 ) 4685 )
@@ -4696,9 +4696,9 @@ indentation and initial hashes. Behaves usually outside of comment."
4696 'gray 4696 'gray
4697 background) 4697 background)
4698 "Background as guessed by CPerl mode") 4698 "Background as guessed by CPerl mode")
4699 (if (and 4699 (if (and
4700 (not (cperl-is-face 'font-lock-constant-face)) 4700 (not (cperl-is-face 'font-lock-constant-face))
4701 (cperl-is-face 'font-lock-reference-face)) 4701 (cperl-is-face 'font-lock-reference-face))
4702 (copy-face 'font-lock-reference-face 'font-lock-constant-face)) 4702 (copy-face 'font-lock-reference-face 'font-lock-constant-face))
4703 (if (cperl-is-face 'font-lock-type-face) nil 4703 (if (cperl-is-face 'font-lock-type-face) nil
4704 (copy-face 'default 'font-lock-type-face) 4704 (copy-face 'default 'font-lock-type-face)
@@ -4775,10 +4775,10 @@ indentation and initial hashes. Behaves usually outside of comment."
4775 "Initialization of `ps-print' components for faces used in CPerl." 4775 "Initialization of `ps-print' components for faces used in CPerl."
4776 (eval-after-load "ps-print" 4776 (eval-after-load "ps-print"
4777 '(setq ps-bold-faces 4777 '(setq ps-bold-faces
4778 ;; font-lock-variable-name-face 4778 ;; font-lock-variable-name-face
4779 ;; font-lock-constant-face 4779 ;; font-lock-constant-face
4780 (append '(cperl-array-face 4780 (append '(cperl-array-face
4781 cperl-hash-face) 4781 cperl-hash-face)
4782 ps-bold-faces) 4782 ps-bold-faces)
4783 ps-italic-faces 4783 ps-italic-faces
4784 ;; font-lock-constant-face 4784 ;; font-lock-constant-face
@@ -4802,8 +4802,8 @@ to the file FILE. If FILE is nil, prompts for a file name.
4802 4802
4803Style of printout regulated by the variable `cperl-ps-print-face-properties'." 4803Style of printout regulated by the variable `cperl-ps-print-face-properties'."
4804 (interactive) 4804 (interactive)
4805 (or file 4805 (or file
4806 (setq file (read-from-minibuffer 4806 (setq file (read-from-minibuffer
4807 "Print to file (if empty - to printer): " 4807 "Print to file (if empty - to printer): "
4808 (concat (buffer-file-name) ".ps") 4808 (concat (buffer-file-name) ".ps")
4809 nil nil 'file-name-history))) 4809 nil nil 'file-name-history)))
@@ -4824,17 +4824,17 @@ Style of printout regulated by the variable `cperl-ps-print-face-properties'."
4824;;; (setq ps-bold-faces 4824;;; (setq ps-bold-faces
4825;;; (append '(font-lock-emphasized-face 4825;;; (append '(font-lock-emphasized-face
4826;;; cperl-array-face 4826;;; cperl-array-face
4827;;; font-lock-keyword-face 4827;;; font-lock-keyword-face
4828;;; font-lock-variable-name-face 4828;;; font-lock-variable-name-face
4829;;; font-lock-constant-face 4829;;; font-lock-constant-face
4830;;; font-lock-reference-face 4830;;; font-lock-reference-face
4831;;; font-lock-other-emphasized-face 4831;;; font-lock-other-emphasized-face
4832;;; cperl-hash-face) 4832;;; cperl-hash-face)
4833;;; ps-bold-faces)) 4833;;; ps-bold-faces))
4834;;; (setq ps-italic-faces 4834;;; (setq ps-italic-faces
4835;;; (append '(cperl-nonoverridable-face 4835;;; (append '(cperl-nonoverridable-face
4836;;; font-lock-constant-face 4836;;; font-lock-constant-face
4837;;; font-lock-reference-face 4837;;; font-lock-reference-face
4838;;; font-lock-other-emphasized-face 4838;;; font-lock-other-emphasized-face
4839;;; cperl-hash-face) 4839;;; cperl-hash-face)
4840;;; ps-italic-faces)) 4840;;; ps-italic-faces))
@@ -4851,8 +4851,8 @@ Style of printout regulated by the variable `cperl-ps-print-face-properties'."
4851(if (cperl-enable-font-lock) (cperl-windowed-init)) 4851(if (cperl-enable-font-lock) (cperl-windowed-init))
4852 4852
4853(defconst cperl-styles-entries 4853(defconst cperl-styles-entries
4854 '(cperl-indent-level cperl-brace-offset cperl-continued-brace-offset 4854 '(cperl-indent-level cperl-brace-offset cperl-continued-brace-offset
4855 cperl-label-offset cperl-extra-newline-before-brace 4855 cperl-label-offset cperl-extra-newline-before-brace
4856 cperl-merge-trailing-else 4856 cperl-merge-trailing-else
4857 cperl-continued-statement-offset)) 4857 cperl-continued-statement-offset))
4858 4858
@@ -4918,7 +4918,7 @@ Should be used via `cperl-set-style' or via Perl menu.")
4918(defun cperl-set-style (style) 4918(defun cperl-set-style (style)
4919 "Set CPerl-mode variables to use one of several different indentation styles. 4919 "Set CPerl-mode variables to use one of several different indentation styles.
4920The arguments are a string representing the desired style. 4920The arguments are a string representing the desired style.
4921The list of styles is in `cperl-style-alist', available styles 4921The list of styles is in `cperl-style-alist', available styles
4922are GNU, K&R, BSD, C++ and Whitesmith. 4922are GNU, K&R, BSD, C++ and Whitesmith.
4923 4923
4924The current value of style is memorized (unless there is a memorized 4924The current value of style is memorized (unless there is a memorized
@@ -4926,8 +4926,8 @@ data already), may be restored by `cperl-set-style-back'.
4926 4926
4927Chosing \"Current\" style will not change style, so this may be used for 4927Chosing \"Current\" style will not change style, so this may be used for
4928side-effect of memorizing only." 4928side-effect of memorizing only."
4929 (interactive 4929 (interactive
4930 (let ((list (mapcar (function (lambda (elt) (list (car elt)))) 4930 (let ((list (mapcar (function (lambda (elt) (list (car elt))))
4931 cperl-style-alist))) 4931 cperl-style-alist)))
4932 (list (completing-read "Enter style: " list nil 'insist)))) 4932 (list (completing-read "Enter style: " list nil 'insist))))
4933 (or cperl-old-style 4933 (or cperl-old-style
@@ -4947,7 +4947,7 @@ side-effect of memorizing only."
4947 (or cperl-old-style (error "The style was not changed")) 4947 (or cperl-old-style (error "The style was not changed"))
4948 (let (setting) 4948 (let (setting)
4949 (while cperl-old-style 4949 (while cperl-old-style
4950 (setq setting (car cperl-old-style) 4950 (setq setting (car cperl-old-style)
4951 cperl-old-style (cdr cperl-old-style)) 4951 cperl-old-style (cdr cperl-old-style))
4952 (set (car setting) (cdr setting))))) 4952 (set (car setting) (cdr setting)))))
4953 4953
@@ -5003,13 +5003,13 @@ side-effect of memorizing only."
5003If perl-info buffer is shown in some frame, uses this frame. 5003If perl-info buffer is shown in some frame, uses this frame.
5004Customized by setting variables `cperl-shrink-wrap-info-frame', 5004Customized by setting variables `cperl-shrink-wrap-info-frame',
5005`cperl-max-help-size'." 5005`cperl-max-help-size'."
5006 (interactive 5006 (interactive
5007 (let* ((default (cperl-word-at-point)) 5007 (let* ((default (cperl-word-at-point))
5008 (read (read-string 5008 (read (read-string
5009 (format "Find doc for Perl function (default %s): " 5009 (format "Find doc for Perl function (default %s): "
5010 default)))) 5010 default))))
5011 (list (if (equal read "") 5011 (list (if (equal read "")
5012 default 5012 default
5013 read)))) 5013 read))))
5014 5014
5015 (let ((buffer (current-buffer)) 5015 (let ((buffer (current-buffer))
@@ -5024,7 +5024,7 @@ Customized by setting variables `cperl-shrink-wrap-info-frame',
5024 fr1 (window-frame iniwin)) 5024 fr1 (window-frame iniwin))
5025 (set-buffer buf) 5025 (set-buffer buf)
5026 (beginning-of-buffer) 5026 (beginning-of-buffer)
5027 (or isvar 5027 (or isvar
5028 (progn (re-search-forward "^-X[ \t\n]") 5028 (progn (re-search-forward "^-X[ \t\n]")
5029 (forward-line -1))) 5029 (forward-line -1)))
5030 (if (re-search-forward cmd-desc nil t) 5030 (if (re-search-forward cmd-desc nil t)
@@ -5033,7 +5033,7 @@ Customized by setting variables `cperl-shrink-wrap-info-frame',
5033 (if (re-search-backward "^[ \t\n\f]") 5033 (if (re-search-backward "^[ \t\n\f]")
5034 (forward-line 1)) 5034 (forward-line 1))
5035 (beginning-of-line) 5035 (beginning-of-line)
5036 ;; Get some of 5036 ;; Get some of
5037 (setq pos (point) 5037 (setq pos (point)
5038 buf-list (list buf "*info-perl-var*" "*info-perl*")) 5038 buf-list (list buf "*info-perl-var*" "*info-perl*"))
5039 (while (and (not win) buf-list) 5039 (while (and (not win) buf-list)
@@ -5052,17 +5052,17 @@ Customized by setting variables `cperl-shrink-wrap-info-frame',
5052 (setq iniheight (window-height) 5052 (setq iniheight (window-height)
5053 frheight (frame-height) 5053 frheight (frame-height)
5054 not-loner (< iniheight (1- frheight))) ; Are not alone 5054 not-loner (< iniheight (1- frheight))) ; Are not alone
5055 (cond ((if not-loner cperl-max-help-size 5055 (cond ((if not-loner cperl-max-help-size
5056 cperl-shrink-wrap-info-frame) 5056 cperl-shrink-wrap-info-frame)
5057 (setq height 5057 (setq height
5058 (+ 2 5058 (+ 2
5059 (count-lines 5059 (count-lines
5060 pos 5060 pos
5061 (save-excursion 5061 (save-excursion
5062 (if (re-search-forward 5062 (if (re-search-forward
5063 "^[ \t][^\n]*\n+\\([^ \t\n\f]\\|\\'\\)" nil t) 5063 "^[ \t][^\n]*\n+\\([^ \t\n\f]\\|\\'\\)" nil t)
5064 (match-beginning 0) (point-max))))) 5064 (match-beginning 0) (point-max)))))
5065 max-height 5065 max-height
5066 (if not-loner 5066 (if not-loner
5067 (/ (* (- frheight 3) cperl-max-help-size) 100) 5067 (/ (* (- frheight 3) cperl-max-help-size) 100)
5068 (setq char-height (frame-char-height)) 5068 (setq char-height (frame-char-height))
@@ -5092,7 +5092,7 @@ Customized by setting variables `cperl-shrink-wrap-info-frame',
5092 "^\n\\([-a-zA-Z_]+\\)[ \t\n]") 5092 "^\n\\([-a-zA-Z_]+\\)[ \t\n]")
5093 (forward-line 1))) 5093 (forward-line 1)))
5094 5094
5095(defun cperl-imenu-info-imenu-name () 5095(defun cperl-imenu-info-imenu-name ()
5096 (buffer-substring 5096 (buffer-substring
5097 (match-beginning 1) (match-end 1))) 5097 (match-beginning 1) (match-end 1)))
5098 5098
@@ -5100,12 +5100,12 @@ Customized by setting variables `cperl-shrink-wrap-info-frame',
5100 (interactive) 5100 (interactive)
5101 (let* ((buffer (current-buffer)) 5101 (let* ((buffer (current-buffer))
5102 imenu-create-index-function 5102 imenu-create-index-function
5103 imenu-prev-index-position-function 5103 imenu-prev-index-position-function
5104 imenu-extract-index-name-function 5104 imenu-extract-index-name-function
5105 (index-item (save-restriction 5105 (index-item (save-restriction
5106 (save-window-excursion 5106 (save-window-excursion
5107 (set-buffer (cperl-info-buffer nil)) 5107 (set-buffer (cperl-info-buffer nil))
5108 (setq imenu-create-index-function 5108 (setq imenu-create-index-function
5109 'imenu-default-create-index-function 5109 'imenu-default-create-index-function
5110 imenu-prev-index-position-function 5110 imenu-prev-index-position-function
5111 'cperl-imenu-info-imenu-search 5111 'cperl-imenu-info-imenu-search
@@ -5132,7 +5132,7 @@ partially contained in the region are lined up at the same column.
5132 5132
5133MINSHIFT is the minimal amount of space to insert before the construction. 5133MINSHIFT is the minimal amount of space to insert before the construction.
5134STEP is the tabwidth to position constructions. 5134STEP is the tabwidth to position constructions.
5135If STEP is `nil', `cperl-lineup-step' will be used 5135If STEP is `nil', `cperl-lineup-step' will be used
5136\(or `cperl-indent-level', if `cperl-lineup-step' is `nil'). 5136\(or `cperl-indent-level', if `cperl-lineup-step' is `nil').
5137Will not move the position at the start to the left." 5137Will not move the position at the start to the left."
5138 (interactive "r") 5138 (interactive "r")
@@ -5150,8 +5150,8 @@ Will not move the position at the start to the left."
5150 (if (looking-at "[a-zA-Z0-9_]") 5150 (if (looking-at "[a-zA-Z0-9_]")
5151 (if (looking-at "\\<[a-zA-Z0-9_]+\\>") 5151 (if (looking-at "\\<[a-zA-Z0-9_]+\\>")
5152 (setq search 5152 (setq search
5153 (concat "\\<" 5153 (concat "\\<"
5154 (regexp-quote 5154 (regexp-quote
5155 (buffer-substring (match-beginning 0) 5155 (buffer-substring (match-beginning 0)
5156 (match-end 0))) "\\>")) 5156 (match-end 0))) "\\>"))
5157 (error "Cannot line up in a middle of the word")) 5157 (error "Cannot line up in a middle of the word"))
@@ -5162,7 +5162,7 @@ Will not move the position at the start to the left."
5162 (or minshift (setq minshift 1)) 5162 (or minshift (setq minshift 1))
5163 (while (progn 5163 (while (progn
5164 (beginning-of-line 2) 5164 (beginning-of-line 2)
5165 (and (< (point) end) 5165 (and (< (point) end)
5166 (re-search-forward search end t) 5166 (re-search-forward search end t)
5167 (goto-char (match-beginning 0)))) 5167 (goto-char (match-beginning 0))))
5168 (setq tcol (current-column) seen t) 5168 (setq tcol (current-column) seen t)
@@ -5172,14 +5172,14 @@ Will not move the position at the start to the left."
5172 (goto-char beg) 5172 (goto-char beg)
5173 (setq col (+ col minshift)) 5173 (setq col (+ col minshift))
5174 (if (/= (% col step) 0) (setq step (* step (1+ (/ col step))))) 5174 (if (/= (% col step) 0) (setq step (* step (1+ (/ col step)))))
5175 (while 5175 (while
5176 (progn 5176 (progn
5177 (setq e (point)) 5177 (setq e (point))
5178 (skip-chars-backward " \t") 5178 (skip-chars-backward " \t")
5179 (delete-region (point) e) 5179 (delete-region (point) e)
5180 (indent-to-column col); (make-string (- col (current-column)) ?\ )) 5180 (indent-to-column col); (make-string (- col (current-column)) ?\ ))
5181 (beginning-of-line 2) 5181 (beginning-of-line 2)
5182 (and (< (point) end) 5182 (and (< (point) end)
5183 (re-search-forward search end t) 5183 (re-search-forward search end t)
5184 (goto-char (match-beginning 0)))))))) ; No body 5184 (goto-char (match-beginning 0)))))))) ; No body
5185 5185
@@ -5196,18 +5196,18 @@ in subdirectories too."
5196 (cond 5196 (cond
5197 ((eq all 'recursive) 5197 ((eq all 'recursive)
5198 ;;(error "Not implemented: recursive") 5198 ;;(error "Not implemented: recursive")
5199 (setq args (append (list "-e" 5199 (setq args (append (list "-e"
5200 "sub wanted {push @ARGV, $File::Find::name if /\\.[pP][Llm]$/} 5200 "sub wanted {push @ARGV, $File::Find::name if /\\.[pP][Llm]$/}
5201 use File::Find; 5201 use File::Find;
5202 find(\\&wanted, '.'); 5202 find(\\&wanted, '.');
5203 exec @ARGV;" 5203 exec @ARGV;"
5204 cmd) args) 5204 cmd) args)
5205 cmd "perl")) 5205 cmd "perl"))
5206 (all 5206 (all
5207 ;;(error "Not implemented: all") 5207 ;;(error "Not implemented: all")
5208 (setq args (append (list "-e" 5208 (setq args (append (list "-e"
5209 "push @ARGV, <*.PL *.pl *.pm>; 5209 "push @ARGV, <*.PL *.pl *.pm>;
5210 exec @ARGV;" 5210 exec @ARGV;"
5211 cmd) args) 5211 cmd) args)
5212 cmd "perl")) 5212 cmd "perl"))
5213 (t 5213 (t
@@ -5220,14 +5220,14 @@ in subdirectories too."
5220 "Toggle the state of `cperl-auto-newline'." 5220 "Toggle the state of `cperl-auto-newline'."
5221 (interactive) 5221 (interactive)
5222 (setq cperl-auto-newline (not cperl-auto-newline)) 5222 (setq cperl-auto-newline (not cperl-auto-newline))
5223 (message "Newlines will %sbe auto-inserted now." 5223 (message "Newlines will %sbe auto-inserted now."
5224 (if cperl-auto-newline "" "not "))) 5224 (if cperl-auto-newline "" "not ")))
5225 5225
5226(defun cperl-toggle-abbrev () 5226(defun cperl-toggle-abbrev ()
5227 "Toggle the state of automatic keyword expansion in CPerl mode." 5227 "Toggle the state of automatic keyword expansion in CPerl mode."
5228 (interactive) 5228 (interactive)
5229 (abbrev-mode (if abbrev-mode 0 1)) 5229 (abbrev-mode (if abbrev-mode 0 1))
5230 (message "Perl control structure will %sbe auto-inserted now." 5230 (message "Perl control structure will %sbe auto-inserted now."
5231 (if abbrev-mode "" "not "))) 5231 (if abbrev-mode "" "not ")))
5232 5232
5233 5233
@@ -5235,7 +5235,7 @@ in subdirectories too."
5235 "Toggle the state of parentheses doubling in CPerl mode." 5235 "Toggle the state of parentheses doubling in CPerl mode."
5236 (interactive) 5236 (interactive)
5237 (setq cperl-electric-parens (if (cperl-val 'cperl-electric-parens) 'null t)) 5237 (setq cperl-electric-parens (if (cperl-val 'cperl-electric-parens) 'null t))
5238 (message "Parentheses will %sbe auto-doubled now." 5238 (message "Parentheses will %sbe auto-doubled now."
5239 (if (cperl-val 'cperl-electric-parens) "" "not "))) 5239 (if (cperl-val 'cperl-electric-parens) "" "not ")))
5240 5240
5241(defun cperl-toggle-autohelp () 5241(defun cperl-toggle-autohelp ()
@@ -5247,18 +5247,18 @@ See `cperl-lazy-help-time' too."
5247 (if cperl-lazy-installed 5247 (if cperl-lazy-installed
5248 (eval '(cperl-lazy-unstall)) 5248 (eval '(cperl-lazy-unstall))
5249 (cperl-lazy-install)) 5249 (cperl-lazy-install))
5250 (message "Perl help messages will %sbe automatically shown now." 5250 (message "Perl help messages will %sbe automatically shown now."
5251 (if cperl-lazy-installed "" "not "))) 5251 (if cperl-lazy-installed "" "not ")))
5252 (message "Cannot automatically show Perl help messages - run-with-idle-timer missing."))) 5252 (message "Cannot automatically show Perl help messages - run-with-idle-timer missing.")))
5253 5253
5254(defun cperl-toggle-construct-fix () 5254(defun cperl-toggle-construct-fix ()
5255 "Toggle whether `indent-region'/`indent-sexp' fix whitespace too." 5255 "Toggle whether `indent-region'/`indent-sexp' fix whitespace too."
5256 (interactive) 5256 (interactive)
5257 (setq cperl-indent-region-fix-constructs 5257 (setq cperl-indent-region-fix-constructs
5258 (if cperl-indent-region-fix-constructs 5258 (if cperl-indent-region-fix-constructs
5259 nil 5259 nil
5260 1)) 5260 1))
5261 (message "indent-region/indent-sexp will %sbe automatically fix whitespace." 5261 (message "indent-region/indent-sexp will %sbe automatically fix whitespace."
5262 (if cperl-indent-region-fix-constructs "" "not "))) 5262 (if cperl-indent-region-fix-constructs "" "not ")))
5263 5263
5264;;;; Tags file creation. 5264;;;; Tags file creation.
@@ -5278,7 +5278,7 @@ See `cperl-lazy-help-time' too."
5278 5278
5279(defun cperl-xsub-scan () 5279(defun cperl-xsub-scan ()
5280 (require 'imenu) 5280 (require 'imenu)
5281 (let ((index-alist '()) 5281 (let ((index-alist '())
5282 (prev-pos 0) index index1 name package prefix) 5282 (prev-pos 0) index index1 name package prefix)
5283 (goto-char (point-min)) 5283 (goto-char (point-min))
5284 (if noninteractive 5284 (if noninteractive
@@ -5340,18 +5340,18 @@ See `cperl-lazy-help-time' too."
5340 (setq lst (cperl-xsub-scan)) 5340 (setq lst (cperl-xsub-scan))
5341 (setq ind (cperl-imenu--create-perl-index)) 5341 (setq ind (cperl-imenu--create-perl-index))
5342 (setq lst (cdr (assoc "+Unsorted List+..." ind)))) 5342 (setq lst (cdr (assoc "+Unsorted List+..." ind))))
5343 (setq lst 5343 (setq lst
5344 (mapcar 5344 (mapcar
5345 (function 5345 (function
5346 (lambda (elt) 5346 (lambda (elt)
5347 (cond ((string-match "^[_a-zA-Z]" (car elt)) 5347 (cond ((string-match "^[_a-zA-Z]" (car elt))
5348 (goto-char (cdr elt)) 5348 (goto-char (cdr elt))
5349 (beginning-of-line) ; pos should be of the start of the line 5349 (beginning-of-line) ; pos should be of the start of the line
5350 (list (car elt) 5350 (list (car elt)
5351 (point) 5351 (point)
5352 (1+ (count-lines 1 (point))) ; 1+ since at beg-o-l 5352 (1+ (count-lines 1 (point))) ; 1+ since at beg-o-l
5353 (buffer-substring (progn 5353 (buffer-substring (progn
5354 (skip-chars-forward 5354 (skip-chars-forward
5355 ":_a-zA-Z0-9") 5355 ":_a-zA-Z0-9")
5356 (or (eolp) (forward-char 1)) 5356 (or (eolp) (forward-char 1))
5357 (point)) 5357 (point))
@@ -5364,7 +5364,7 @@ See `cperl-lazy-help-time' too."
5364 (setq elt (car lst) lst (cdr lst)) 5364 (setq elt (car lst) lst (cdr lst))
5365 (if elt 5365 (if elt
5366 (progn 5366 (progn
5367 (insert (elt elt 3) 5367 (insert (elt elt 3)
5368 127 5368 127
5369 (if (string-match "^package " (car elt)) 5369 (if (string-match "^package " (car elt))
5370 (substring (car elt) 8) 5370 (substring (car elt) 8)
@@ -5378,7 +5378,7 @@ See `cperl-lazy-help-time' too."
5378 (string-match "^sub[ \t]+\\([_a-zA-Z]+\\)[^:_a-zA-Z]" 5378 (string-match "^sub[ \t]+\\([_a-zA-Z]+\\)[^:_a-zA-Z]"
5379 (elt elt 3))) 5379 (elt elt 3)))
5380 ;; Need to insert the name without package as well 5380 ;; Need to insert the name without package as well
5381 (setq lst (cons (cons (substring (elt elt 3) 5381 (setq lst (cons (cons (substring (elt elt 3)
5382 (match-beginning 1) 5382 (match-beginning 1)
5383 (match-end 1)) 5383 (match-end 1))
5384 (cdr elt)) 5384 (cdr elt))
@@ -5401,7 +5401,7 @@ See `cperl-lazy-help-time' too."
5401 "Add to TAGS data for Perl and XSUB files in the current directory and kids. 5401 "Add to TAGS data for Perl and XSUB files in the current directory and kids.
5402Use as 5402Use as
5403 emacs -batch -q -no-site-file -l emacs/cperl-mode.el \ 5403 emacs -batch -q -no-site-file -l emacs/cperl-mode.el \
5404 -f cperl-add-tags-recurse 5404 -f cperl-add-tags-recurse
5405" 5405"
5406 (cperl-write-tags nil nil t t nil t)) 5406 (cperl-write-tags nil nil t t nil t))
5407 5407
@@ -5409,7 +5409,7 @@ Use as
5409 "Add to TAGS file data for Perl files in the current directory and kids. 5409 "Add to TAGS file data for Perl files in the current directory and kids.
5410Use as 5410Use as
5411 emacs -batch -q -no-site-file -l emacs/cperl-mode.el \ 5411 emacs -batch -q -no-site-file -l emacs/cperl-mode.el \
5412 -f cperl-add-tags-recurse 5412 -f cperl-add-tags-recurse
5413" 5413"
5414 (cperl-write-tags nil nil t t)) 5414 (cperl-write-tags nil nil t t))
5415 5415
@@ -5438,8 +5438,8 @@ Use as
5438 (erase 5438 (erase
5439 (erase-buffer) 5439 (erase-buffer)
5440 (setq erase 'ignore))) 5440 (setq erase 'ignore)))
5441 (let ((files 5441 (let ((files
5442 (directory-files file t 5442 (directory-files file t
5443 (if recurse nil cperl-scan-files-regexp) 5443 (if recurse nil cperl-scan-files-regexp)
5444 t))) 5444 t)))
5445 (mapcar (function (lambda (file) 5445 (mapcar (function (lambda (file)
@@ -5472,7 +5472,7 @@ Use as
5472 (delete-region (point) 5472 (delete-region (point)
5473 (save-excursion 5473 (save-excursion
5474 (forward-char 1) 5474 (forward-char 1)
5475 (if (search-forward "\f\n" 5475 (if (search-forward "\f\n"
5476 nil 'toend) 5476 nil 'toend)
5477 (- (point) 2) 5477 (- (point) 2)
5478 (point-max))))) 5478 (point-max)))))
@@ -5484,7 +5484,7 @@ Use as
5484 (initialize-new-tags-table)))))) 5484 (initialize-new-tags-table))))))
5485 5485
5486(defvar cperl-tags-hier-regexp-list 5486(defvar cperl-tags-hier-regexp-list
5487 (concat 5487 (concat
5488 "^\\(" 5488 "^\\("
5489 "\\(package\\)\\>" 5489 "\\(package\\)\\>"
5490 "\\|" 5490 "\\|"
@@ -5503,7 +5503,7 @@ Use as
5503 (goto-char 1) 5503 (goto-char 1)
5504 (let (type pack name pos line chunk ord cons1 file str info fileind) 5504 (let (type pack name pos line chunk ord cons1 file str info fileind)
5505 (while (re-search-forward cperl-tags-hier-regexp-list nil t) 5505 (while (re-search-forward cperl-tags-hier-regexp-list nil t)
5506 (setq pos (match-beginning 0) 5506 (setq pos (match-beginning 0)
5507 pack (match-beginning 2)) 5507 pack (match-beginning 2))
5508 (beginning-of-line) 5508 (beginning-of-line)
5509 (if (looking-at (concat 5509 (if (looking-at (concat
@@ -5533,7 +5533,7 @@ Use as
5533 (cdr cons1))) 5533 (cdr cons1)))
5534 ;; First occurrence of the name, start alist 5534 ;; First occurrence of the name, start alist
5535 (setq cons1 (cons name (list (cons fileind (vector file info))))) 5535 (setq cons1 (cons name (list (cons fileind (vector file info)))))
5536 (if pack 5536 (if pack
5537 (setcar (cdr cperl-hierarchy) 5537 (setcar (cdr cperl-hierarchy)
5538 (cons cons1 (nth 1 cperl-hierarchy))) 5538 (cons cons1 (nth 1 cperl-hierarchy)))
5539 (setcar cperl-hierarchy 5539 (setcar cperl-hierarchy
@@ -5566,7 +5566,7 @@ One may build such TAGS files from CPerl mode menu."
5566 (cperl-tags-hier-fill)) 5566 (cperl-tags-hier-fill))
5567 (or tags-table-list 5567 (or tags-table-list
5568 (call-interactively 'visit-tags-table)) 5568 (call-interactively 'visit-tags-table))
5569 (mapcar 5569 (mapcar
5570 (function 5570 (function
5571 (lambda (tagsfile) 5571 (lambda (tagsfile)
5572 (message "Updating list of classes... %s" tagsfile) 5572 (message "Updating list of classes... %s" tagsfile)
@@ -5595,7 +5595,7 @@ One may build such TAGS files from CPerl mode menu."
5595 (if (and update (listp update)) 5595 (if (and update (listp update))
5596 (progn (while (cdr update) (setq update (cdr update))) 5596 (progn (while (cdr update) (setq update (cdr update)))
5597 (setq update (car update)))) ; Get the last from the list 5597 (setq update (car update)))) ; Get the last from the list
5598 (if (vectorp update) 5598 (if (vectorp update)
5599 (progn 5599 (progn
5600 (find-file (elt update 0)) 5600 (find-file (elt update 0))
5601 (cperl-etags-goto-tag-location (elt update 1)))) 5601 (cperl-etags-goto-tag-location (elt update 1))))
@@ -5603,7 +5603,7 @@ One may build such TAGS files from CPerl mode menu."
5603 5603
5604(defun cperl-tags-treeify (to level) 5604(defun cperl-tags-treeify (to level)
5605 ;; cadr of `to' is read-write. On start it is a cons 5605 ;; cadr of `to' is read-write. On start it is a cons
5606 (let* ((regexp (concat "^\\(" (mapconcat 5606 (let* ((regexp (concat "^\\(" (mapconcat
5607 'identity 5607 'identity
5608 (make-list level "[_a-zA-Z0-9]+") 5608 (make-list level "[_a-zA-Z0-9]+")
5609 "::") 5609 "::")
@@ -5613,12 +5613,12 @@ One may build such TAGS files from CPerl mode menu."
5613 l1 head tail cons1 cons2 ord writeto packs recurse 5613 l1 head tail cons1 cons2 ord writeto packs recurse
5614 root-packages root-functions ms many_ms same_name ps 5614 root-packages root-functions ms many_ms same_name ps
5615 (move-deeper 5615 (move-deeper
5616 (function 5616 (function
5617 (lambda (elt) 5617 (lambda (elt)
5618 (cond ((and (string-match regexp (car elt)) 5618 (cond ((and (string-match regexp (car elt))
5619 (or (eq ord 1) (match-end 2))) 5619 (or (eq ord 1) (match-end 2)))
5620 (setq head (substring (car elt) 0 (match-end 1)) 5620 (setq head (substring (car elt) 0 (match-end 1))
5621 tail (if (match-end 2) (substring (car elt) 5621 tail (if (match-end 2) (substring (car elt)
5622 (match-end 2))) 5622 (match-end 2)))
5623 recurse t) 5623 recurse t)
5624 (if (setq cons1 (assoc head writeto)) nil 5624 (if (setq cons1 (assoc head writeto)) nil
@@ -5645,7 +5645,7 @@ One may build such TAGS files from CPerl mode menu."
5645 (cdr to))) 5645 (cdr to)))
5646 ;;Now clean up leaders with one child only 5646 ;;Now clean up leaders with one child only
5647 (mapcar (function (lambda (elt) 5647 (mapcar (function (lambda (elt)
5648 (if (not (and (listp (cdr elt)) 5648 (if (not (and (listp (cdr elt))
5649 (eq (length elt) 2))) nil 5649 (eq (length elt) 2))) nil
5650 (setcar elt (car (nth 1 elt))) 5650 (setcar elt (car (nth 1 elt)))
5651 (setcdr elt (cdr (nth 1 elt)))))) 5651 (setcdr elt (cdr (nth 1 elt))))))
@@ -5663,20 +5663,20 @@ One may build such TAGS files from CPerl mode menu."
5663 root-functions)) 5663 root-functions))
5664 ;; Now add back packages removed from display 5664 ;; Now add back packages removed from display
5665 (mapcar (function (lambda (elt) 5665 (mapcar (function (lambda (elt)
5666 (setcdr to (cons (cons (concat "package " (car elt)) 5666 (setcdr to (cons (cons (concat "package " (car elt))
5667 (cdr elt)) 5667 (cdr elt))
5668 (cdr to))))) 5668 (cdr to)))))
5669 (if (default-value 'imenu-sort-function) 5669 (if (default-value 'imenu-sort-function)
5670 (nreverse 5670 (nreverse
5671 (sort root-packages (default-value 'imenu-sort-function))) 5671 (sort root-packages (default-value 'imenu-sort-function)))
5672 root-packages)) 5672 root-packages))
5673 )) 5673 ))
5674 5674
5675;;;(x-popup-menu t 5675;;;(x-popup-menu t
5676;;; '(keymap "Name1" 5676;;; '(keymap "Name1"
5677;;; ("Ret1" "aa") 5677;;; ("Ret1" "aa")
5678;;; ("Head1" "ab" 5678;;; ("Head1" "ab"
5679;;; keymap "Name2" 5679;;; keymap "Name2"
5680;;; ("Tail1" "x") ("Tail2" "y")))) 5680;;; ("Tail1" "x") ("Tail2" "y"))))
5681 5681
5682(defun cperl-list-fold (list name limit) 5682(defun cperl-list-fold (list name limit)
@@ -5684,7 +5684,7 @@ One may build such TAGS files from CPerl mode menu."
5684 (if (<= (length list) limit) list 5684 (if (<= (length list) limit) list
5685 (setq list1 nil list2 nil) 5685 (setq list1 nil list2 nil)
5686 (while list 5686 (while list
5687 (setq num (1+ num) 5687 (setq num (1+ num)
5688 elt1 (car list) 5688 elt1 (car list)
5689 list (cdr list)) 5689 list (cdr list))
5690 (if (<= num imenu-max-items) 5690 (if (<= num imenu-max-items)
@@ -5700,9 +5700,9 @@ One may build such TAGS files from CPerl mode menu."
5700 5700
5701(defun cperl-menu-to-keymap (menu &optional name) 5701(defun cperl-menu-to-keymap (menu &optional name)
5702 (let (list) 5702 (let (list)
5703 (cons 'keymap 5703 (cons 'keymap
5704 (mapcar 5704 (mapcar
5705 (function 5705 (function
5706 (lambda (elt) 5706 (lambda (elt)
5707 (cond ((listp (cdr elt)) 5707 (cond ((listp (cdr elt))
5708 (setq list (cperl-list-fold 5708 (setq list (cperl-list-fold
@@ -5723,7 +5723,7 @@ One may build such TAGS files from CPerl mode menu."
5723 "\\|") 5723 "\\|")
5724 "Finds places such that insertion of a whitespace may help a lot.") 5724 "Finds places such that insertion of a whitespace may help a lot.")
5725 5725
5726(defvar cperl-not-bad-style-regexp 5726(defvar cperl-not-bad-style-regexp
5727 (mapconcat 'identity 5727 (mapconcat 'identity
5728 '("[^-\t <>=+]\\(--\\|\\+\\+\\)" ; var-- var++ 5728 '("[^-\t <>=+]\\(--\\|\\+\\+\\)" ; var-- var++
5729 "[a-zA-Z0-9_][|&][a-zA-Z0-9_$]" ; abc|def abc&def are often used. 5729 "[a-zA-Z0-9_][|&][a-zA-Z0-9_$]" ; abc|def abc&def are often used.
@@ -5764,14 +5764,14 @@ Currently it is tuned to C and Perl syntax."
5764 (map-y-or-n-p "Insert space here? " 5764 (map-y-or-n-p "Insert space here? "
5765 (function (lambda (arg) (insert " "))) 5765 (function (lambda (arg) (insert " ")))
5766 'cperl-next-bad-style 5766 'cperl-next-bad-style
5767 '("location" "locations" "insert a space into") 5767 '("location" "locations" "insert a space into")
5768 '((?\C-r (lambda (arg) 5768 '((?\C-r (lambda (arg)
5769 (let ((buffer-quit-function 5769 (let ((buffer-quit-function
5770 'exit-recursive-edit)) 5770 'exit-recursive-edit))
5771 (message "Exit with Esc Esc") 5771 (message "Exit with Esc Esc")
5772 (recursive-edit) 5772 (recursive-edit)
5773 t)) ; Consider acted upon 5773 t)) ; Consider acted upon
5774 "edit, exit with Esc Esc") 5774 "edit, exit with Esc Esc")
5775 (?e (lambda (arg) 5775 (?e (lambda (arg)
5776 (let ((buffer-quit-function 5776 (let ((buffer-quit-function
5777 'exit-recursive-edit)) 5777 'exit-recursive-edit))
@@ -5811,7 +5811,7 @@ Currently it is tuned to C and Perl syntax."
5811 5811
5812 5812
5813;;; Getting help 5813;;; Getting help
5814(defvar cperl-have-help-regexp 5814(defvar cperl-have-help-regexp
5815 ;;(concat "\\(" 5815 ;;(concat "\\("
5816 (mapconcat 5816 (mapconcat
5817 'identity 5817 'identity
@@ -5840,7 +5840,7 @@ Currently it is tuned to C and Perl syntax."
5840 ;; Does not save-excursion 5840 ;; Does not save-excursion
5841 ;; Get to the something meaningful 5841 ;; Get to the something meaningful
5842 (or (eobp) (eolp) (forward-char 1)) 5842 (or (eobp) (eolp) (forward-char 1))
5843 (re-search-backward "[-a-zA-Z0-9_:!&*+,-./<=>?\\\\^|~$%@]" 5843 (re-search-backward "[-a-zA-Z0-9_:!&*+,-./<=>?\\\\^|~$%@]"
5844 (save-excursion (beginning-of-line) (point)) 5844 (save-excursion (beginning-of-line) (point))
5845 'to-beg) 5845 'to-beg)
5846 ;; (cond 5846 ;; (cond
@@ -5851,7 +5851,7 @@ Currently it is tuned to C and Perl syntax."
5851 (cond 5851 (cond
5852 ((looking-at "[a-zA-Z0-9_:]") ; symbol 5852 ((looking-at "[a-zA-Z0-9_:]") ; symbol
5853 (skip-chars-backward "a-zA-Z0-9_:") 5853 (skip-chars-backward "a-zA-Z0-9_:")
5854 (cond 5854 (cond
5855 ((and (eq (preceding-char) ?^) ; $^I 5855 ((and (eq (preceding-char) ?^) ; $^I
5856 (eq (char-after (- (point) 2)) ?\$)) 5856 (eq (char-after (- (point) 2)) ?\$))
5857 (forward-char -2)) 5857 (forward-char -2))
@@ -5905,7 +5905,7 @@ than a line. Your contribution to update/shorten it is appreciated."
5905 nil 5905 nil
5906 (cperl-describe-perl-symbol word)) 5906 (cperl-describe-perl-symbol word))
5907 (if cperl-message-on-help-error 5907 (if cperl-message-on-help-error
5908 (message "Nothing found for %s..." 5908 (message "Nothing found for %s..."
5909 (buffer-substring (point) (min (+ 5 (point)) (point-max)))))))))) 5909 (buffer-substring (point) (min (+ 5 (point)) (point-max))))))))))
5910 5910
5911;;; Stolen from perl-descr.el by Johan Vromans: 5911;;; Stolen from perl-descr.el by Johan Vromans:
@@ -5934,9 +5934,9 @@ than a line. Your contribution to update/shorten it is appreciated."
5934 (setq val "SUPER::")) 5934 (setq val "SUPER::"))
5935 ((and (string= "<" val) (string-match "^<\\$?[a-zA-Z0-9_:]+>" val)) 5935 ((and (string= "<" val) (string-match "^<\\$?[a-zA-Z0-9_:]+>" val))
5936 (setq val "<NAME>"))) 5936 (setq val "<NAME>")))
5937 (setq regexp (concat "^" 5937 (setq regexp (concat "^"
5938 "\\([^a-zA-Z0-9_:]+[ \t]+\\)?" 5938 "\\([^a-zA-Z0-9_:]+[ \t]+\\)?"
5939 (regexp-quote val) 5939 (regexp-quote val)
5940 "\\([ \t([/]\\|$\\)")) 5940 "\\([ \t([/]\\|$\\)"))
5941 5941
5942 ;; get the buffer with the documentation text 5942 ;; get the buffer with the documentation text
@@ -5945,7 +5945,7 @@ than a line. Your contribution to update/shorten it is appreciated."
5945 ;; lookup in the doc 5945 ;; lookup in the doc
5946 (goto-char (point-min)) 5946 (goto-char (point-min))
5947 (let ((case-fold-search nil)) 5947 (let ((case-fold-search nil))
5948 (list 5948 (list
5949 (if (re-search-forward regexp (point-max) t) 5949 (if (re-search-forward regexp (point-max) t)
5950 (save-excursion 5950 (save-excursion
5951 (beginning-of-line 1) 5951 (beginning-of-line 1)
@@ -5958,7 +5958,7 @@ than a line. Your contribution to update/shorten it is appreciated."
5958(defvar cperl-short-docs "Ignore my value" 5958(defvar cperl-short-docs "Ignore my value"
5959 ;; Perl4 version was written by Johan Vromans (jvromans@squirrel.nl) 5959 ;; Perl4 version was written by Johan Vromans (jvromans@squirrel.nl)
5960 "# based on '@(#)@ perl-descr.el 1.9 - describe-perl-symbol' [Perl 5] 5960 "# based on '@(#)@ perl-descr.el 1.9 - describe-perl-symbol' [Perl 5]
5961! ... Logical negation. 5961! ... Logical negation.
5962... != ... Numeric inequality. 5962... != ... Numeric inequality.
5963... !~ ... Search pattern, substitution, or translation (negated). 5963... !~ ... Search pattern, substitution, or translation (negated).
5964$! In numeric context: errno. In a string context: error string. 5964$! In numeric context: errno. In a string context: error string.
@@ -6017,7 +6017,7 @@ $^T The time the script was started. Used by -A/-M/-C file tests.
6017$^W True if warnings are requested (perl -w flag). 6017$^W True if warnings are requested (perl -w flag).
6018$^X The name under which perl was invoked (argv[0] in C-speech). 6018$^X The name under which perl was invoked (argv[0] in C-speech).
6019$_ The default input and pattern-searching space. 6019$_ The default input and pattern-searching space.
6020$| Auto-flush after write/print on current output channel? Default 0. 6020$| Auto-flush after write/print on current output channel? Default 0.
6021$~ The name of the current report format. 6021$~ The name of the current report format.
6022... % ... Modulo division. 6022... % ... Modulo division.
6023... %= ... Modulo division assignment. 6023... %= ... Modulo division assignment.
@@ -6428,7 +6428,7 @@ prototype \&SUB Returns prototype of the function given a reference.
6428 (indent-to-column c1) 6428 (indent-to-column c1)
6429 (while (and 6429 (while (and
6430 inline 6430 inline
6431 (looking-at 6431 (looking-at
6432 (concat "\\([a-zA-Z0-9]+[^*+{?]\\)" ; 1 word 6432 (concat "\\([a-zA-Z0-9]+[^*+{?]\\)" ; 1 word
6433 "\\|" ; Embedded variable 6433 "\\|" ; Embedded variable
6434 "\\$\\([a-zA-Z0-9_]+\\([[{]\\)?\\|[^\n \t)|]\\)" ; 2 3 6434 "\\$\\([a-zA-Z0-9_]+\\([[{]\\)?\\|[^\n \t)|]\\)" ; 2 3
@@ -6565,7 +6565,7 @@ prototype \&SUB Returns prototype of the function given a reference.
6565 (if (and sub-p (eq delim (char-after (- (point) 2)))) 6565 (if (and sub-p (eq delim (char-after (- (point) 2))))
6566 (error "Possible s/blah// - do not know how to deal with")) 6566 (error "Possible s/blah// - do not know how to deal with"))
6567 (if sub-p (forward-sexp 1)) 6567 (if sub-p (forward-sexp 1))
6568 (if (looking-at "\\sw*x") 6568 (if (looking-at "\\sw*x")
6569 (setq have-x t) 6569 (setq have-x t)
6570 (insert "x")) 6570 (insert "x"))
6571 ;; Protect fragile " ", "#" 6571 ;; Protect fragile " ", "#"
@@ -6613,7 +6613,7 @@ We suppose that the regexp is scanned already."
6613 (set-marker e (1- (point))) 6613 (set-marker e (1- (point)))
6614 (goto-char b) 6614 (goto-char b)
6615 (while (re-search-forward "\\(#\\)\\|\n" e t) 6615 (while (re-search-forward "\\(#\\)\\|\n" e t)
6616 (cond 6616 (cond
6617 ((match-beginning 1) ; #-comment 6617 ((match-beginning 1) ; #-comment
6618 (or c (setq c (current-indentation))) 6618 (or c (setq c (current-indentation)))
6619 (beginning-of-line 2) ; Skip 6619 (beginning-of-line 2) ; Skip
@@ -6639,7 +6639,7 @@ We suppose that the regexp is scanned already."
6639 (set-marker e (1- (point))) 6639 (set-marker e (1- (point)))
6640 (goto-char (1+ b)) 6640 (goto-char (1+ b))
6641 (while (re-search-forward "\\(\\\\\\\\\\)\\|(" e t) 6641 (while (re-search-forward "\\(\\\\\\\\\\)\\|(" e t)
6642 (cond 6642 (cond
6643 ((match-beginning 1) ; Skip 6643 ((match-beginning 1) ; Skip
6644 nil) 6644 nil)
6645 (t ; Group 6645 (t ; Group
@@ -6700,7 +6700,7 @@ We suppose that the regexp is scanned already."
6700 (setq p (match-beginning 0) 6700 (setq p (match-beginning 0)
6701 s1 (buffer-substring p (match-end 0)) 6701 s1 (buffer-substring p (match-end 0))
6702 state (parse-partial-sexp pos4 p)) 6702 state (parse-partial-sexp pos4 p))
6703 (or (nth 3 state) 6703 (or (nth 3 state)
6704 (nth 4 state) 6704 (nth 4 state)
6705 (nth 5 state) 6705 (nth 5 state)
6706 (error "`%s' inside `%s' BLOCK" s1 s0)) 6706 (error "`%s' inside `%s' BLOCK" s1 s0))
@@ -6759,7 +6759,7 @@ We suppose that the regexp is scanned already."
6759 (error "No perldoc args given") 6759 (error "No perldoc args given")
6760 default-entry) 6760 default-entry)
6761 input)))) 6761 input))))
6762 (let* ((is-func (and 6762 (let* ((is-func (and
6763 (string-match "^[a-z]+$" word) 6763 (string-match "^[a-z]+$" word)
6764 (string-match (concat "^" word "\\>") 6764 (string-match (concat "^" word "\\>")
6765 (documentation-property 6765 (documentation-property
@@ -6831,9 +6831,9 @@ We suppose that the regexp is scanned already."
6831 (not cperl-lazy-installed)) 6831 (not cperl-lazy-installed))
6832 (progn 6832 (progn
6833 (add-hook 'post-command-hook 'cperl-lazy-hook) 6833 (add-hook 'post-command-hook 'cperl-lazy-hook)
6834 (run-with-idle-timer 6834 (run-with-idle-timer
6835 (cperl-val 'cperl-lazy-help-time 1000000 5) 6835 (cperl-val 'cperl-lazy-help-time 1000000 5)
6836 t 6836 t
6837 'cperl-get-help-defer) 6837 'cperl-get-help-defer)
6838 (setq cperl-lazy-installed t)))) 6838 (setq cperl-lazy-installed t))))
6839 6839
@@ -6868,7 +6868,7 @@ We suppose that the regexp is scanned already."
6868(defvar cperl-d-l nil) 6868(defvar cperl-d-l nil)
6869(defun cperl-fontify-syntaxically (end) 6869(defun cperl-fontify-syntaxically (end)
6870 ;; Some vars for debugging only 6870 ;; Some vars for debugging only
6871 (let (start (dbg (point)) (iend end) 6871 (let (start (dbg (point)) (iend end)
6872 (istate (car cperl-syntax-state))) 6872 (istate (car cperl-syntax-state)))
6873 (and cperl-syntaxify-unwind 6873 (and cperl-syntaxify-unwind
6874 (setq end (cperl-unwind-to-safe t end))) 6874 (setq end (cperl-unwind-to-safe t end)))
@@ -6885,17 +6885,17 @@ We suppose that the regexp is scanned already."
6885 (and (> end start) 6885 (and (> end start)
6886 (setq cperl-syntax-done-to start) ; In case what follows fails 6886 (setq cperl-syntax-done-to start) ; In case what follows fails
6887 (cperl-find-pods-heres start end t nil t)) 6887 (cperl-find-pods-heres start end t nil t))
6888 ;;(setq cperl-d-l (cons (format "Syntaxifying %s..%s from %s to %s\n" 6888 ;;(setq cperl-d-l (cons (format "Syntaxifying %s..%s from %s to %s\n"
6889 ;; dbg end start cperl-syntax-done-to) 6889 ;; dbg end start cperl-syntax-done-to)
6890 ;; cperl-d-l)) 6890 ;; cperl-d-l))
6891 ;;(let ((standard-output (get-buffer "*Messages*"))) 6891 ;;(let ((standard-output (get-buffer "*Messages*")))
6892 ;;(princ (format "Syntaxifying %s..%s from %s to %s\n" 6892 ;;(princ (format "Syntaxifying %s..%s from %s to %s\n"
6893 ;; dbg end start cperl-syntax-done-to))) 6893 ;; dbg end start cperl-syntax-done-to)))
6894 (if (eq cperl-syntaxify-by-font-lock 'message) 6894 (if (eq cperl-syntaxify-by-font-lock 'message)
6895 (message "Syntaxified %s..%s from %s to %s(%s), state %s-->%s" 6895 (message "Syntaxified %s..%s from %s to %s(%s), state %s-->%s"
6896 dbg iend 6896 dbg iend
6897 start end cperl-syntax-done-to 6897 start end cperl-syntax-done-to
6898 istate (car cperl-syntax-state))) ; For debugging 6898 istate (car cperl-syntax-state))) ; For debugging
6899 nil)) ; Do not iterate 6899 nil)) ; Do not iterate
6900 6900
6901(defun cperl-fontify-update (end) 6901(defun cperl-fontify-update (end)
@@ -6917,7 +6917,7 @@ We suppose that the regexp is scanned already."
6917 (goto-char from) 6917 (goto-char from)
6918 (cperl-fontify-syntaxically to))))) 6918 (cperl-fontify-syntaxically to)))))
6919 6919
6920(defvar cperl-version 6920(defvar cperl-version
6921 (let ((v "Revision: 4.21")) 6921 (let ((v "Revision: 4.21"))
6922 (string-match ":\\s *\\([0-9.]+\\)" v) 6922 (string-match ":\\s *\\([0-9.]+\\)" v)
6923 (substring v (match-beginning 1) (match-end 1))) 6923 (substring v (match-beginning 1) (match-end 1)))