Open Ambrevar opened 2 years ago
Agreed.
Sorry for bikesheding this topic, but are there cases when we really must use *browser*
?
There are cases when we call it, but we should define a method in the browser
class. For instance, see buffer-list
, buffers-get
, buffers-set
or buffers-delete
.
Sorry I didn't understand. Can you rephrase / give an example?
I'm saying that some calls to *browser*
are clearly not needed. For instance, look at buffer-list
. I think it should be a method of the browser
class.
If it's a method, then the problem is only moved somewhere else: buffer-list will be called with (buffer-list *browser*)
and if *browser*
is NIL, an error is raised.
In https://github.com/atlas-engineer/nyxt/pull/2666#discussion_r1031497582 we discussed the problem of having to protect against NIL
*browser*
all over the place. Then having to extract some default value, which duplicates it since it's already in the slot initforms.Suggestion: always bind
*browser*
to at least(make-instance 'browser)
.I believe this should do the right thing. Thoughts?