Refresh internal vars when popper-reference-buffers is customized - #83
Open
lewang wants to merge 2 commits into
Open
Refresh internal vars when popper-reference-buffers is customized#83lewang wants to merge 2 commits into
lewang wants to merge 2 commits into
Conversation
added 2 commits
February 8, 2026 13:26
…ized Add :set function to defcustom so changing popper-reference-buffers via customize/setopt refreshes internal reference variables. Previously, setting it after popper-mode was active left stale internal state, causing new entries to be silently ignored. Make popper--set-reference-vars idempotent by clearing vars at start, reuse it in mode teardown to avoid duplicate reset logic.
Use setopt and use-package :custom instead of setq for popper-reference-buffers, so the new :set function triggers and internal vars stay in sync when changed at runtime.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
:setfunction topopper-reference-buffersdefcustom so changing it viacustomize-set-variable,setopt, or use-package:customrefreshes internalreference variables while
popper-modeis activepopper--set-reference-varsidempotent by clearing vars at start, reuseit in mode teardown to eliminate duplicate reset logic
setopt/:custominstead ofsetqProblem
popper--set-reference-varsonly runs whenpopper-modeactivates. Ifpopper-reference-buffersis changed afterward, the internal variables(
popper--reference-names,popper--reference-modes, etc.) are never updated,so new entries are silently ignored.
Test plan
popper-modewith default config(setopt popper-reference-buffers '("\\*Messages\\*$" special-mode))special-modeappears inpopper--reference-modesspecial-modebuffer and confirm popper recognizes it as a popup