Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rust_src/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ pub extern "C" fn rust_init_syms() {
defsubr(&*windows::Sselected_window);
defsubr(&*windows::Swindow_buffer);
defsubr(&*windows::Swindow_valid_p);
defsubr(&*windows::Swindow_start);
defsubr(&*process::Sget_process);
defsubr(&*process::Sprocessp);
defsubr(&*lists::Satom);
Expand Down
18 changes: 18 additions & 0 deletions rust_src/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ impl LispWindowRef {
pub fn contents(self) -> LispObject {
LispObject::from_raw(self.contents)
}

#[inline]
pub fn start_marker(self) -> LispObject {
LispObject::from_raw(self.start)
}
}

/// Return t if OBJECT is a window and nil otherwise.
Expand Down Expand Up @@ -98,3 +103,16 @@ pub fn window_valid_p(object: LispObject) -> LispObject {
|win| win.contents().is_not_nil(),
))
}

/// Return position at which display currently starts in WINDOW.
/// WINDOW must be a live window and defaults to the selected one.
/// This is updated by redisplay or by calling `set-window-start'.
#[lisp_fn(min = "0")]
pub fn window_start(window: LispObject) -> LispObject {
let win = if window.is_nil() {
selected_window()
} else {
window
};
marker_position(win.as_live_window_or_error().start_marker())
}
10 changes: 0 additions & 10 deletions src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,15 +1506,6 @@ WINDOW must be a live window and defaults to the selected one. */)
return Fmarker_position (decode_live_window (window)->old_pointm);
}

DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0,
doc: /* Return position at which display currently starts in WINDOW.
WINDOW must be a live window and defaults to the selected one.
This is updated by redisplay or by calling `set-window-start'. */)
(Lisp_Object window)
{
return Fmarker_position (decode_live_window (window)->start);
}

/* This is text temporarily removed from the doc string below.

This function returns nil if the position is not currently known.
Expand Down Expand Up @@ -7720,7 +7711,6 @@ displayed after a scrolling operation to be somewhat inaccurate. */);
defsubr (&Scoordinates_in_window_p);
defsubr (&Swindow_at);
defsubr (&Swindow_old_point);
defsubr (&Swindow_start);
defsubr (&Swindow_end);
defsubr (&Sset_window_point);
defsubr (&Sset_window_start);
Expand Down