changeset 36601:2a84d5417fbd

(cperl-mode): Set major-mode to cperl-mode so that C-h m shows the correct information. Use make-local-variable rather than make-variable-buffer-local. (cperl-info-buffer, cperl-setup-tmp-buf): Use make-local-variable rather than make-variable-buffer-local. Updated to author version 4.23. (cperl-electric-pod): SYNOPSIS was misspelled. (cperl-find-pods-heres): @if ? a : b was considered a REx. (cperl-after-expr-p): Make true after __END__.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 06 Mar 2001 21:47:33 +0000
parents 8bca7ba48fd4
children 4bcc2745d610
files lisp/progmodes/cperl-mode.el
diffstat 1 files changed, 33 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/cperl-mode.el	Tue Mar 06 19:50:42 2001 +0000
+++ b/lisp/progmodes/cperl-mode.el	Tue Mar 06 21:47:33 2001 +0000
@@ -189,7 +189,7 @@
 
 (defcustom cperl-lineup-step nil
   "*`cperl-lineup' will always lineup at multiple of this number.
-If `nil', the value of `cperl-indent-level' will be used."
+If nil, the value of `cperl-indent-level' will be used."
   :type '(choice (const nil) integer)
   :group 'cperl-indentation-details)
 
@@ -248,13 +248,13 @@
   :group 'cperl-indentation-details)
 
 (defcustom cperl-font-lock nil
-  "*Non-nil (and non-null) means CPerl buffers will use font-lock-mode.
+  "*Non-nil (and non-null) means CPerl buffers will use `font-lock-mode'.
 Can be overwritten by `cperl-hairy' if nil."
   :type '(choice (const null) boolean)
   :group 'cperl-affected-by-hairy)
 
 (defcustom cperl-electric-lbrace-space nil
-  "*Non-nil (and non-null) means { after $ in CPerl buffers should be preceded by ` '.
+  "*Non-nil (and non-null) means { after $ should be preceded by ` '.
 Can be overwritten by `cperl-hairy' if nil."
   :type '(choice (const null) boolean)
   :group 'cperl-affected-by-hairy)
@@ -431,7 +431,7 @@
 
 (defcustom cperl-regexp-indent-step nil
   "*Indentation used when beautifying regexps.
-If `nil', the value of `cperl-indent-level' will be used."
+If nil, the value of `cperl-indent-level' will be used."
   :type '(choice integer (const nil))
   :group 'cperl-indentation-details)
 
@@ -600,7 +600,7 @@
 Tools/Tags submenu in Perl menu.
 
 If some class structure is too complicated, use Tools/Hierarchy-view
-from Perl menu, or hierarchic view of imenu. The second one uses the
+from Perl menu, or hierarchic view of imenu.  The second one uses the
 current buffer only, the first one requires generation of TAGS from
 Perl/Tools/Tags menu beforehand.
 
@@ -611,12 +611,12 @@
 Though with contemporary Emaxen CPerl mode should maintain the correct
 parsing of Perl even when editing, sometimes it may be lost.  Fix this by
 
-  M-x norm RET
+  \\[normal-mode]
 
 In cases of more severe confusion sometimes it is helpful to do
 
-  M-x load-l RET cperl-mode RET
-  M-x norm RET
+  \\[load-library] cperl-mode RET
+  \\[normal-mode]
 
 Before reporting (non-)problems look in the problem section of online
 micro-docs on what I know about CPerl problems.")
@@ -719,7 +719,7 @@
 `imenu-add-to-menubar' in 20.2 is broken.
 
 A lot of things on XEmacs may be broken too, judging by bug reports I
-recieve.  Note that some releases of XEmacs are better than the others
+receive.  Note that some releases of XEmacs are better than the others
 as far as bugs reports I see are concerned.")
 
 (defvar cperl-praise 'please-ignore-this-line
@@ -800,6 +800,9 @@
 
 9) When doing indentation of control constructs, may correct
 line-breaks/spacing between elements of the construct.
+
+10) Uses a linear-time algorith for indentation of regions (on Emaxen with
+capable syntax engines).
 ")
 
 (defvar cperl-speed 'please-ignore-this-line
@@ -898,7 +901,7 @@
 (defvar cperl-del-back-ch
   (car (append (where-is-internal 'delete-backward-char)
 	       (where-is-internal 'backward-delete-char-untabify)))
-  "Character generated by key bound to delete-backward-char.")
+  "Character generated by key bound to `delete-backward-char'.")
 
 (and (vectorp cperl-del-back-ch) (= (length cperl-del-back-ch) 1)
      (setq cperl-del-back-ch (aref cperl-del-back-ch 0)))
@@ -1414,7 +1417,7 @@
 	(cperl-define-key "\C-hf" 'cperl-info-on-current-command [(control h) f])
 	(cperl-define-key "\C-c\C-hf" 'cperl-info-on-command
 			  [(control c) (control h) f])))
-  (setq major-mode 'perl-mode)
+  (setq major-mode 'cperl-mode)
   (setq mode-name "CPerl")
   (if (not cperl-mode-abbrev-table)
       (let ((prev-a-c abbrevs-changed))
@@ -1489,22 +1492,22 @@
   (make-local-variable 'cperl-syntax-state)
   (if cperl-use-syntax-table-text-property
       (progn
-	(make-variable-buffer-local 'parse-sexp-lookup-properties)
+	(make-local-variable 'parse-sexp-lookup-properties)
 	;; Do not introduce variable if not needed, we check it!
 	(set 'parse-sexp-lookup-properties t)
 	;; Fix broken font-lock:
 	(or (boundp 'font-lock-unfontify-region-function)
 	    (set 'font-lock-unfontify-region-function
 		  'font-lock-default-unfontify-region))
-	(make-variable-buffer-local 'font-lock-unfontify-region-function)
+	(make-local-variable 'font-lock-unfontify-region-function)
 	(set 'font-lock-unfontify-region-function
 	      'cperl-font-lock-unfontify-region-function)
-	(make-variable-buffer-local 'cperl-syntax-done-to)
+	(make-local-variable 'cperl-syntax-done-to)
 	;; Another bug: unless font-lock-syntactic-keywords, font-lock
 	;;  ignores syntax-table text-property.  (t) is a hack
 	;;  to make font-lock think that font-lock-syntactic-keywords
 	;;  are defined
-	(make-variable-buffer-local 'font-lock-syntactic-keywords)
+	(make-local-variable 'font-lock-syntactic-keywords)
 	(setq font-lock-syntactic-keywords
 	      (if cperl-syntaxify-by-font-lock
 		  '(t (cperl-fontify-syntaxically))
@@ -1942,7 +1945,7 @@
 				   (file-name-nondirectory (buffer-file-name)))
 			     p (point))
 		       (insert " NAME\n\n" name
-			       " - \n\n=head1 SYNOPSYS\n\n\n\n"
+			       " - \n\n=head1 SYNOPSIS\n\n\n\n"
 			       "=head1 DESCRIPTION")
 		       (cperl-ensure-newlines 4)
 		       (goto-char p)
@@ -2818,7 +2821,7 @@
 
 
 (defun cperl-to-comment-or-eol ()
-  "Goes to position before comment on the current line, or to end of line.
+  "Go to position before comment on the current line, or to end of line.
 Returns true if comment is found."
   (let (state stop-in cpoint (lim (progn (end-of-line) (point))))
       (beginning-of-line)
@@ -3390,8 +3393,11 @@
 					     (if (eq (preceding-char) ?-)
 						 ;; -d ?foo? is a RE
 						 (looking-at "[a-zA-Z]\\>")
-					     (looking-at
-						"\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\)\\>"))))
+					       (and
+						(not (memq (preceding-char)
+							   '(?$ ?@ ?& ?%)))
+						(looking-at
+						 "\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\)\\>")))))
 				      (and (eq (preceding-char) ?.)
 					   (eq (char-after (- (point) 2)) ?.))
 				      (bobp))
@@ -3630,7 +3636,7 @@
       (error nil))))
 
 (defun cperl-after-expr-p (&optional lim chars test)
-  "Returns true if the position is good for start of expression.
+  "Return true if the position is good for start of expression.
 TEST is the expression to evaluate at the found position.  If absent,
 CHARS is a string that contains good characters to have before us (however,
 `}' is treated \"smartly\" if it is not in the list)."
@@ -3657,6 +3663,7 @@
 	    (setq stop t))))
       (or (bobp)			; ???? Needed
 	  (eq (point) lim)
+	  (looking-at "[ \t]*__\\(END\\|DATA\\)__") ; After this anything goes
 	  (progn
 	    (if test (eval test)
 	      (or (memq (preceding-char) (append (or chars "{;") nil))
@@ -4981,7 +4988,7 @@
 	       (set-buffer "*info-perl-tmp*")
 	       (rename-buffer "*info*")
 	       (set-buffer bname)))
-	(make-variable-buffer-local 'window-min-height)
+	(make-local-variable 'window-min-height)
 	(setq window-min-height 2)
 	(current-buffer)))))
 
@@ -5000,7 +5007,7 @@
 		       'find-tag-default))))))
 
 (defun cperl-info-on-command (command)
-  "Shows documentation for Perl command in other window.
+  "Show documentation for Perl command in other window.
 If perl-info buffer is shown in some frame, uses this frame.
 Customized by setting variables `cperl-shrink-wrap-info-frame',
 `cperl-max-help-size'."
@@ -5083,7 +5090,7 @@
     (select-window iniwin)))
 
 (defun cperl-info-on-current-command ()
-  "Shows documentation for Perl command at point in other window."
+  "Show documentation for Perl command at point in other window."
   (interactive)
   (cperl-info-on-command (cperl-word-at-point)))
 
@@ -5133,7 +5140,7 @@
 
 MINSHIFT is the minimal amount of space to insert before the construction.
 STEP is the tabwidth to position constructions.
-If STEP is `nil', `cperl-lineup-step' will be used
+If STEP is nil, `cperl-lineup-step' will be used
 \(or `cperl-indent-level', if `cperl-lineup-step' is `nil').
 Will not move the position at the start to the left."
   (interactive "r")
@@ -5273,7 +5280,7 @@
   (auto-fill-mode 0)
   (if cperl-use-syntax-table-text-property-for-tags
       (progn
-	(make-variable-buffer-local 'parse-sexp-lookup-properties)
+	(make-local-variable 'parse-sexp-lookup-properties)
 	;; Do not introduce variable if not needed, we check it!
 	(set 'parse-sexp-lookup-properties t))))
 
@@ -6919,7 +6926,7 @@
 	  (cperl-fontify-syntaxically to)))))
 
 (defvar cperl-version
-  (let ((v  "Revision: 4.21"))
+  (let ((v  "Revision: 4.23"))
     (string-match ":\\s *\\([0-9.]+\\)" v)
     (substring v (match-beginning 1) (match-end 1)))
   "Version of IZ-supported CPerl package this file is based on.")