Allow elpher-go to work without an Elpher ebuffer
authorAlex Schroeder <alex@gnu.org>
Tue, 6 Jul 2021 17:31:32 +0000 (19:31 +0200)
committerAlex Schroeder <alex@gnu.org>
Tue, 6 Jul 2021 17:31:32 +0000 (19:31 +0200)
If elpher-go is the first thing you do, and no *elpher* buffer exists,
you run into an error. Wrapping elpher-visit-page in
elpher-with-clean-buffer fixes this, as this sets up the *elpher*
buffer, and sets elpher-mode.

Alternatively, we could also just set elpher-mode. The key is that we
must do it before elpher-visit-page is called, otherwise this is what
happens: elpher-go → elpher-visit-page → elpher-render-gemini via
elpher-type-map → elpher-render-gemini-map → elpher-with-clean-buffer
which now calls elpher-mode, wiping all the local variables. If,
however, we make sure elpher-mode is active before all of this,
elpher-with-clean-buffer when called from elpher-render-gemini-map
will not call elpher-mode and the local variables remain set.


No differences found