Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port windowp #240

Merged
merged 1 commit into from
Jul 17, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions rust_src/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ mod crypto;
mod str2sig;
mod multibyte;
mod buffers;
mod windows;

#[cfg(all(not(test), target_os = "macos"))]
use alloc_unexecmacosx::OsxUnexecAlloc;
Expand Down Expand Up @@ -135,6 +136,7 @@ pub extern "C" fn rust_init_syms() {
unsafe {
defsubr(&*buffers::Soverlayp);
defsubr(&*buffers::Sbuffer_live_p);
defsubr(&*windows::Swindowp);
defsubr(&*lists::Satom);
defsubr(&*lists::Slistp);
defsubr(&*lists::Snlistp);
Expand Down
11 changes: 11 additions & 0 deletions rust_src/src/windows.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//! Functions operating on windows.

use lisp::LispObject;
use remacs_macros::lisp_fn;


/// Return t if OBJECT is a window and nil otherwise.
#[lisp_fn]
fn windowp(object: LispObject) -> LispObject {
LispObject::from_bool(object.is_window())
}
8 changes: 0 additions & 8 deletions src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,6 @@ wset_buffer (struct window *w, Lisp_Object val)
adjust_window_count (w, 1);
}

DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0,
doc: /* Return t if OBJECT is a window and nil otherwise. */)
(Lisp_Object object)
{
return WINDOWP (object) ? Qt : Qnil;
}

DEFUN ("window-valid-p", Fwindow_valid_p, Swindow_valid_p, 1, 1, 0,
doc: /* Return t if OBJECT is a valid window and nil otherwise.
A valid window is either a window that displays a buffer or an internal
Expand Down Expand Up @@ -7737,7 +7730,6 @@ displayed after a scrolling operation to be somewhat inaccurate. */);
defsubr (&Sselected_window);
defsubr (&Sminibuffer_window);
defsubr (&Swindow_minibuffer_p);
defsubr (&Swindowp);
defsubr (&Swindow_valid_p);
defsubr (&Swindow_live_p);
defsubr (&Swindow_frame);
Expand Down