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
62c48f87
Commit
62c48f87
authored
Oct 03, 1992
by
Richard M. Stallman
Browse files
(open-line): Shield undo from the hack to insert at pt-1.
parent
f28f04cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
lisp/simple.el
lisp/simple.el
+11
-1
No files found.
lisp/simple.el
View file @
62c48f87
...
...
@@ -28,7 +28,17 @@ With arg N, insert N newlines."
(
interactive
"*p"
)
(
let*
((
do-fill-prefix
(
and
fill-prefix
(
bolp
)))
(
flag
(
and
(
null
do-fill-prefix
)
(
bolp
)
(
not
(
bobp
)))))
(
if
flag
(
forward-char
-1
))
;; If this is a simple case, and we are at the beginning of a line,
;; actually insert the newline *before* the preceding newline
;; instead of after. That makes better display behavior.
(
if
flag
(
progn
;; If undo is enabled, don't let this hack be visible:
;; record the real value of point as the place to move back to
;; if we undo this insert.
(
if
(
and
buffer-undo-list
(
not
(
eq
buffer-undo-list
t
)))
(
setq
buffer-undo-list
(
cons
(
point
)
buffer-undo-list
)))
(
forward-char
-1
)))
(
while
(
>
arg
0
)
(
save-excursion
(
insert
?\n
))
...
...
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