aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/cperl-mode.el33
1 files changed, 18 insertions, 15 deletions
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 6d4766bd6ae..f25d5c29081 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -68,6 +68,9 @@
68 68
69;;; Code: 69;;; Code:
70 70
71(defvar vc-rcs-header)
72(defvar vc-sccs-header)
73
71;; Some macros are needed for `defcustom' 74;; Some macros are needed for `defcustom'
72(eval-when-compile 75(eval-when-compile
73 (condition-case nil 76 (condition-case nil
@@ -1775,7 +1778,7 @@ char is \"{\", insert extra newline before only if
1775 (save-excursion 1778 (save-excursion
1776 (skip-chars-backward "$") 1779 (skip-chars-backward "$")
1777 (looking-at "\\(\\$\\$\\)*\\$\\([^\\$]\\|$\\)")) 1780 (looking-at "\\(\\$\\$\\)*\\$\\([^\\$]\\|$\\)"))
1778 (insert ?\ )) 1781 (insert ?\s))
1779 ;; Check whether we are in comment 1782 ;; Check whether we are in comment
1780 (if (and 1783 (if (and
1781 (save-excursion 1784 (save-excursion
@@ -1871,7 +1874,7 @@ to nil."
1871 (let ((beg (save-excursion (beginning-of-line) (point))) 1874 (let ((beg (save-excursion (beginning-of-line) (point)))
1872 (dollar (and (eq last-command-char ?$) 1875 (dollar (and (eq last-command-char ?$)
1873 (eq this-command 'self-insert-command))) 1876 (eq this-command 'self-insert-command)))
1874 (delete (and (memq last-command-char '(?\ ?\n ?\t ?\f)) 1877 (delete (and (memq last-command-char '(?\s ?\n ?\t ?\f))
1875 (memq this-command '(self-insert-command newline)))) 1878 (memq this-command '(self-insert-command newline))))
1876 my do) 1879 my do)
1877 (and (save-excursion 1880 (and (save-excursion
@@ -1946,7 +1949,7 @@ to nil."
1946 1949
1947(defun cperl-electric-pod () 1950(defun cperl-electric-pod ()
1948 "Insert a POD chunk appropriate after a =POD directive." 1951 "Insert a POD chunk appropriate after a =POD directive."
1949 (let ((delete (and (memq last-command-char '(?\ ?\n ?\t ?\f)) 1952 (let ((delete (and (memq last-command-char '(?\s ?\n ?\t ?\f))
1950 (memq this-command '(self-insert-command newline)))) 1953 (memq this-command '(self-insert-command newline))))
1951 head1 notlast name p really-delete over) 1954 head1 notlast name p really-delete over)
1952 (and (save-excursion 1955 (and (save-excursion
@@ -2224,7 +2227,7 @@ key. Will untabify if `cperl-electric-backspace-untabify' is non-nil."
2224 (memq last-command '(cperl-electric-semi 2227 (memq last-command '(cperl-electric-semi
2225 cperl-electric-terminator 2228 cperl-electric-terminator
2226 cperl-electric-lbrace)) 2229 cperl-electric-lbrace))
2227 (memq (preceding-char) '(?\ ?\t ?\n))) 2230 (memq (preceding-char) '(?\s ?\t ?\n)))
2228 (let (p) 2231 (let (p)
2229 (if (eq last-command 'cperl-electric-lbrace) 2232 (if (eq last-command 'cperl-electric-lbrace)
2230 (skip-chars-forward " \t\n")) 2233 (skip-chars-forward " \t\n"))
@@ -2236,7 +2239,7 @@ key. Will untabify if `cperl-electric-backspace-untabify' is non-nil."
2236 (setq this-command 'cperl-electric-else-really)) 2239 (setq this-command 'cperl-electric-else-really))
2237 (if (and cperl-auto-newline 2240 (if (and cperl-auto-newline
2238 (eq last-command 'cperl-electric-else-really) 2241 (eq last-command 'cperl-electric-else-really)
2239 (memq (preceding-char) '(?\ ?\t ?\n))) 2242 (memq (preceding-char) '(?\s ?\t ?\n)))
2240 (let (p) 2243 (let (p)
2241 (skip-chars-forward " \t\n") 2244 (skip-chars-forward " \t\n")
2242 (setq p (point)) 2245 (setq p (point))
@@ -3039,7 +3042,7 @@ Returns true if comment is found."
3039 (progn 3042 (progn
3040 (setq i (point) i2 i) 3043 (setq i (point) i2 i)
3041 (if ender 3044 (if ender
3042 (if (memq (following-char) '(?\ ?\t ?\n ?\f)) 3045 (if (memq (following-char) '(?\s ?\t ?\n ?\f))
3043 (progn 3046 (progn
3044 (if (looking-at "[ \t\n\f]+\\(#[^\n]*\n[ \t\n\f]*\\)+") 3047 (if (looking-at "[ \t\n\f]+\\(#[^\n]*\n[ \t\n\f]*\\)+")
3045 (goto-char (match-end 0)) 3048 (goto-char (match-end 0))
@@ -4031,7 +4034,7 @@ Returns some position at the last line."
4031 (setq p (point)) 4034 (setq p (point))
4032 (skip-chars-forward " \t\n") 4035 (skip-chars-forward " \t\n")
4033 (delete-region p (point)) 4036 (delete-region p (point))
4034 (insert (make-string cperl-indent-region-fix-constructs ?\ )) 4037 (insert (make-string cperl-indent-region-fix-constructs ?\s))
4035 (beginning-of-line))) 4038 (beginning-of-line)))
4036 ;; Looking at: 4039 ;; Looking at:
4037 ;; } else 4040 ;; } else
@@ -4039,7 +4042,7 @@ Returns some position at the last line."
4039 (progn 4042 (progn
4040 (search-forward "}") 4043 (search-forward "}")
4041 (delete-horizontal-space) 4044 (delete-horizontal-space)
4042 (insert (make-string cperl-indent-region-fix-constructs ?\ )) 4045 (insert (make-string cperl-indent-region-fix-constructs ?\s))
4043 (beginning-of-line))) 4046 (beginning-of-line)))
4044 ;; Looking at: 4047 ;; Looking at:
4045 ;; else { 4048 ;; else {
@@ -4048,7 +4051,7 @@ Returns some position at the last line."
4048 (progn 4051 (progn
4049 (forward-word 1) 4052 (forward-word 1)
4050 (delete-horizontal-space) 4053 (delete-horizontal-space)
4051 (insert (make-string cperl-indent-region-fix-constructs ?\ )) 4054 (insert (make-string cperl-indent-region-fix-constructs ?\s))
4052 (beginning-of-line))) 4055 (beginning-of-line)))
4053 ;; Looking at: 4056 ;; Looking at:
4054 ;; foreach my $var 4057 ;; foreach my $var
@@ -4057,7 +4060,7 @@ Returns some position at the last line."
4057 (progn 4060 (progn
4058 (forward-word 2) 4061 (forward-word 2)
4059 (delete-horizontal-space) 4062 (delete-horizontal-space)
4060 (insert (make-string cperl-indent-region-fix-constructs ?\ )) 4063 (insert (make-string cperl-indent-region-fix-constructs ?\s))
4061 (beginning-of-line))) 4064 (beginning-of-line)))
4062 ;; Looking at: 4065 ;; Looking at:
4063 ;; foreach my $var ( 4066 ;; foreach my $var (
@@ -4067,7 +4070,7 @@ Returns some position at the last line."
4067 (forward-sexp 3) 4070 (forward-sexp 3)
4068 (delete-horizontal-space) 4071 (delete-horizontal-space)
4069 (insert 4072 (insert
4070 (make-string cperl-indent-region-fix-constructs ?\ )) 4073 (make-string cperl-indent-region-fix-constructs ?\s))
4071 (beginning-of-line))) 4074 (beginning-of-line)))
4072 ;; Looking at: 4075 ;; Looking at:
4073 ;; } foreach my $var () { 4076 ;; } foreach my $var () {
@@ -4111,7 +4114,7 @@ Returns some position at the last line."
4111 (cperl-fix-line-spacing end parse-data) 4114 (cperl-fix-line-spacing end parse-data)
4112 (setq ret (point))))) 4115 (setq ret (point)))))
4113 (insert 4116 (insert
4114 (make-string cperl-indent-region-fix-constructs ?\ )))) 4117 (make-string cperl-indent-region-fix-constructs ?\s))))
4115 ((and (looking-at "[ \t]*\n") 4118 ((and (looking-at "[ \t]*\n")
4116 (not (if ml 4119 (not (if ml
4117 cperl-extra-newline-before-brace-multiline 4120 cperl-extra-newline-before-brace-multiline
@@ -4120,7 +4123,7 @@ Returns some position at the last line."
4120 (skip-chars-forward " \t\n") 4123 (skip-chars-forward " \t\n")
4121 (delete-region pp (point)) 4124 (delete-region pp (point))
4122 (insert 4125 (insert
4123 (make-string cperl-indent-region-fix-constructs ?\ )))) 4126 (make-string cperl-indent-region-fix-constructs ?\s))))
4124 ;; Now we are before `{' 4127 ;; Now we are before `{'
4125 (if (looking-at "[ \t\n]*{[ \t]*[^ \t\n#]") 4128 (if (looking-at "[ \t\n]*{[ \t]*[^ \t\n#]")
4126 (progn 4129 (progn
@@ -4297,7 +4300,7 @@ indentation and initial hashes. Behaves usually outside of comment."
4297 (looking-at "#+[ \t]*") 4300 (looking-at "#+[ \t]*")
4298 (setq start (point) c (current-column) 4301 (setq start (point) c (current-column)
4299 comment-fill-prefix 4302 comment-fill-prefix
4300 (concat (make-string (current-column) ?\ ) 4303 (concat (make-string (current-column) ?\s)
4301 (buffer-substring (match-beginning 0) (match-end 0))) 4304 (buffer-substring (match-beginning 0) (match-end 0)))
4302 spaces (progn (skip-chars-backward " \t") 4305 spaces (progn (skip-chars-backward " \t")
4303 (buffer-substring (point) start)) 4306 (buffer-substring (point) start))
@@ -5449,7 +5452,7 @@ Will not move the position at the start to the left."
5449 (setq e (point)) 5452 (setq e (point))
5450 (skip-chars-backward " \t") 5453 (skip-chars-backward " \t")
5451 (delete-region (point) e) 5454 (delete-region (point) e)
5452 (indent-to-column col) ;(make-string (- col (current-column)) ?\ )) 5455 (indent-to-column col) ;(make-string (- col (current-column)) ?\s))
5453 (beginning-of-line 2) 5456 (beginning-of-line 2)
5454 (and (< (point) end) 5457 (and (< (point) end)
5455 (re-search-forward search end t) 5458 (re-search-forward search end t)