-
Notifications
You must be signed in to change notification settings - Fork 309
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 get-buffer-window #1453
base: master
Are you sure you want to change the base?
port get-buffer-window #1453
Conversation
f8eeed1
to
dbc7b1c
Compare
@agraven done. |
/// Any other value of ALL-FRAMES means consider all windows on the | ||
/// selected frame and no others. | ||
#[lisp_fn(min = "0")] | ||
pub fn get_buffer_window(buffer_or_name: LispObject, all_frames: LispObject) -> LispObject { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a LispBufferOrName
type for this situation. You then get a buffer by doing let buffer: LispBufferRef = buffer_or_name.into()
. Option<LispBufferRef>
also works here, since it looks like that's what you need here, along with doing a match on it after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is failing this way. It seems it doesn't handle the case when buffer_or_name
is a name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's odd, it should. What's the trace of the error, if there is one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I push the changes so you can see the log. But shouldn't there by a call to get_buffer
in a method of LispBufferOrName
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably just missing something again :P
rust_src/src/windows.rs
Outdated
Fget_buffer(buffer_or_name).as_buffer() | ||
}; | ||
|
||
if let Some(b) = buffer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's preferred you do a match instead if you also have an else
block on the if let
@brotzeit wanna pick this back up? |
No description provided.