summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2001-11-20 15:10:42 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2001-11-20 15:10:42 +0000
commited3c639167e8f4fbe193c5d912331bd15a565c3a (patch)
tree4cab32350f96c943c1d304b5e86929635936c34e /lisp/emacs-lisp/lisp-mode.el
parenta8e1e57f4ced6c635d959d8d8d30b65efbbbf8e4 (diff)
downloademacs-ed3c639167e8f4fbe193c5d912331bd15a565c3a.tar.gz
emacs-ed3c639167e8f4fbe193c5d912331bd15a565c3a.tar.bz2
emacs-ed3c639167e8f4fbe193c5d912331bd15a565c3a.zip
(lisp-fill-paragraph): Don't move back to a line without a comment.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index ceea24168ef..38d607d3b25 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1082,8 +1082,11 @@ and initial semicolons."
(narrow-to-region
;; Find the first line we should include in the region to fill.
(save-excursion
- (while (and (looking-at "[ \t]*;")
- (zerop (forward-line -1))))
+ (while (and (zerop (forward-line -1))
+ (looking-at "[ \t]*;")))
+ ;; We may have gone too far. Go forward again.
+ (or (looking-at ".*;")
+ (forward-line 1))
(point))
;; Find the beginning of the first line past the region to fill.
(save-excursion