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
6b312f0f
Commit
6b312f0f
authored
Jul 05, 2012
by
Dmitry Antipov
Browse files
* marker.c (set_marker_restricted_both): Simplify by using
clip_to_bounds.
parent
f520ef9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
src/ChangeLog
src/ChangeLog
+5
-0
src/marker.c
src/marker.c
+2
-8
No files found.
src/ChangeLog
View file @
6b312f0f
2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
* marker.c (set_marker_restricted_both): Simplify by using
clip_to_bounds.
2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
* editfns.c (region_limit): Simplify by using clip_to_bounds.
...
...
src/marker.c
View file @
6b312f0f
...
...
@@ -667,14 +667,8 @@ set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer, ptrdiff_t ch
}
}
if
(
charpos
<
BUF_BEGV
(
b
))
charpos
=
BUF_BEGV
(
b
);
if
(
charpos
>
BUF_ZV
(
b
))
charpos
=
BUF_ZV
(
b
);
if
(
bytepos
<
BUF_BEGV_BYTE
(
b
))
bytepos
=
BUF_BEGV_BYTE
(
b
);
if
(
bytepos
>
BUF_ZV_BYTE
(
b
))
bytepos
=
BUF_ZV_BYTE
(
b
);
charpos
=
clip_to_bounds
(
BUF_BEGV
(
b
),
charpos
,
BUF_ZV
(
b
));
bytepos
=
clip_to_bounds
(
BUF_BEGV_BYTE
(
b
),
bytepos
,
BUF_ZV_BYTE
(
b
));
/* In a single-byte buffer, the two positions must be equal. */
if
(
BUF_Z
(
b
)
==
BUF_Z_BYTE
(
b
)
...
...
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