aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2002-11-02 01:38:03 +0000
committerStefan Monnier2002-11-02 01:38:03 +0000
commit2df609391621fd9a935c3f278692fca89b55b0ec (patch)
treeb1a124a48e839d3c8715c003ab334441311918c7
parent5f812a3c6897f0b148224cc9152e3720651912a3 (diff)
downloademacs-2df609391621fd9a935c3f278692fca89b55b0ec.tar.gz
emacs-2df609391621fd9a935c3f278692fca89b55b0ec.zip
(lisp-fill-paragraph): Use match-string and line-beginning-position.
Don't bother making paragraph-start a superset of paragraph-separate.
-rw-r--r--lisp/emacs-lisp/lisp-mode.el14
1 files changed, 5 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 8b04fd6dffc..6bdb92dd284 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1079,8 +1079,7 @@ and initial semicolons."
1079 ;; A line with nothing but a comment on it? 1079 ;; A line with nothing but a comment on it?
1080 ((looking-at "[ \t]*;[; \t]*") 1080 ((looking-at "[ \t]*;[; \t]*")
1081 (setq has-comment t 1081 (setq has-comment t
1082 comment-fill-prefix (buffer-substring (match-beginning 0) 1082 comment-fill-prefix (match-string 0)))
1083 (match-end 0))))
1084 1083
1085 ;; A line with some code, followed by a comment? Remember that the 1084 ;; A line with some code, followed by a comment? Remember that the
1086 ;; semi which starts the comment shouldn't be part of a string or 1085 ;; semi which starts the comment shouldn't be part of a string or
@@ -1093,7 +1092,7 @@ and initial semicolons."
1093 (setq comment-fill-prefix 1092 (setq comment-fill-prefix
1094 (concat (make-string (/ (current-column) tab-width) ?\t) 1093 (concat (make-string (/ (current-column) tab-width) ?\t)
1095 (make-string (% (current-column) tab-width) ?\ ) 1094 (make-string (% (current-column) tab-width) ?\ )
1096 (buffer-substring (match-beginning 0) (match-end 0))))))) 1095 (match-string 0))))))
1097 1096
1098 (if (not has-comment) 1097 (if (not has-comment)
1099 ;; `paragraph-start' is set here (not in the buffer-local 1098 ;; `paragraph-start' is set here (not in the buffer-local
@@ -1131,13 +1130,11 @@ and initial semicolons."
1131 (point))) 1130 (point)))
1132 1131
1133 ;; Lines with only semicolons on them can be paragraph boundaries. 1132 ;; Lines with only semicolons on them can be paragraph boundaries.
1134 (let* ((paragraph-start (concat paragraph-start "\\|[ \t;]*$")) 1133 (let* ((paragraph-separate (concat paragraph-separate "\\|[ \t;]*$"))
1135 (paragraph-separate (concat paragraph-start "\\|[ \t;]*$"))
1136 (paragraph-ignore-fill-prefix nil) 1134 (paragraph-ignore-fill-prefix nil)
1137 (fill-prefix comment-fill-prefix) 1135 (fill-prefix comment-fill-prefix)
1138 (after-line (if has-code-and-comment 1136 (after-line (if has-code-and-comment
1139 (save-excursion 1137 (line-beginning-position 2)))
1140 (forward-line 1) (point))))
1141 (end (progn 1138 (end (progn
1142 (forward-paragraph) 1139 (forward-paragraph)
1143 (or (bolp) (newline 1)) 1140 (or (bolp) (newline 1))
@@ -1154,8 +1151,7 @@ and initial semicolons."
1154 (goto-char beg) 1151 (goto-char beg)
1155 (if (looking-at fill-prefix) 1152 (if (looking-at fill-prefix)
1156 nil 1153 nil
1157 (re-search-forward comment-start-skip) 1154 (re-search-forward comment-start-skip))))))))
1158 (point))))))))
1159 t)) 1155 t))
1160 1156
1161(defun indent-code-rigidly (start end arg &optional nochange-regexp) 1157(defun indent-code-rigidly (start end arg &optional nochange-regexp)