Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
fc357930
Commit
fc357930
authored
Oct 01, 1994
by
Richard M. Stallman
Browse files
(fill-region, fill-region-as-paragraph):
If specified region ends before a newline, include that newline.
parent
a94c7fcc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
lisp/textmodes/fill.el
lisp/textmodes/fill.el
+21
-11
No files found.
lisp/textmodes/fill.el
View file @
fc357930
...
@@ -97,7 +97,12 @@ From program, pass args FROM, TO and JUSTIFY-FLAG."
...
@@ -97,7 +97,12 @@ From program, pass args FROM, TO and JUSTIFY-FLAG."
)))
)))
(
save-restriction
(
save-restriction
(
narrow-to-region
from
to
)
(
goto-char
(
max
from
to
))
;; If specified region ends before a newline,
;; include that newline.
(
if
(
and
(
eolp
)
(
not
(
eobp
)))
(
forward-char
1
))
(
narrow-to-region
(
min
from
to
)
(
point
))
(
goto-char
(
point-min
))
(
goto-char
(
point-min
))
(
skip-chars-forward
"\n"
)
(
skip-chars-forward
"\n"
)
(
narrow-to-region
(
point
)
(
point-max
))
(
narrow-to-region
(
point
)
(
point-max
))
...
@@ -256,16 +261,21 @@ If `sentence-end-double-space' is non-nil, then period followed by one
...
@@ -256,16 +261,21 @@ If `sentence-end-double-space' is non-nil, then period followed by one
space does not end a sentence, so don't break a line there."
space does not end a sentence, so don't break a line there."
(
interactive
"r\nP"
)
(
interactive
"r\nP"
)
(
save-restriction
(
save-restriction
(
narrow-to-region
from
to
)
(
goto-char
(
max
from
to
))
(
goto-char
(
point-min
))
;; If specified region ends before a newline,
(
while
(
not
(
eobp
))
;; include that newline.
(
let
((
initial
(
point
))
(
if
(
and
(
eolp
)
(
not
(
eobp
)))
(
end
(
progn
(
forward-char
1
))
(
forward-paragraph
1
)
(
point
))))
(
narrow-to-region
(
min
from
to
)
(
point
))
(
forward-paragraph
-1
)
(
goto-char
(
point-min
))
(
if
(
>=
(
point
)
initial
)
(
while
(
not
(
eobp
))
(
fill-region-as-paragraph
(
point
)
end
justify-flag
)
(
let
((
initial
(
point
))
(
goto-char
end
))))))
(
end
(
progn
(
forward-paragraph
1
)
(
point
))))
(
forward-paragraph
-1
)
(
if
(
>=
(
point
)
initial
)
(
fill-region-as-paragraph
(
point
)
end
justify-flag
)
(
goto-char
end
))))))
(
defun
justify-current-line
()
(
defun
justify-current-line
()
"Add spaces to line point is in, so it ends at `fill-column'."
"Add spaces to line point is in, so it ends at `fill-column'."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment