<feed xmlns='http://www.w3.org/2005/Atom'>
<title>org-drill/tests/test-org-drill-display-restore.el, branch main</title>
<subtitle>Spaced-repetition flashcards for Org Mode
</subtitle>
<id>https://git.cjennings.net/org-drill/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/org-drill/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/org-drill/'/>
<updated>2026-05-05T10:21:28+00:00</updated>
<entry>
<title>fix: restore display state in the buffer setup ran in</title>
<updated>2026-05-05T10:21:28+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-05T10:21:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/org-drill/commit/?id=6afd53b644c9b1fe0592892464c2d7fb37fa29e7'/>
<id>urn:sha1:6afd53b644c9b1fe0592892464c2d7fb37fa29e7</id>
<content type='text'>
org-drill--setup-display saved buffer-local state (mode-line,
variable-pitch-mode) into global defvars and called setq-local on
the current buffer.  org-drill--restore-display read those globals
and ran setq-local against whatever buffer happened to be current
at restore time.

If the user switched buffers mid-session, the restore wrote to the
wrong buffer — leaving the original drill buffer's mode-line still
hidden and trampling the destination buffer's mode-line with
whatever was saved from elsewhere.

Captured the buffer at setup in org-drill--saved-display-buffer.
Restore now wraps mode-line and variable-pitch restoration in
with-current-buffer against that saved buffer.  Text-scale stays
global (the underlying face attribute is process-wide).
</content>
</entry>
</feed>
