Skip to content

Refresh internal vars when popper-reference-buffers is customized - #83

Open
lewang wants to merge 2 commits into
karthink:masterfrom
lewang:fix/refresh-reference-vars-on-customize
Open

Refresh internal vars when popper-reference-buffers is customized#83
lewang wants to merge 2 commits into
karthink:masterfrom
lewang:fix/refresh-reference-vars-on-customize

Conversation

@lewang

@lewang lewang commented Feb 8, 2026

Copy link
Copy Markdown

Summary

  • Add :set function to popper-reference-buffers defcustom so changing it via
    customize-set-variable, setopt, or use-package :custom refreshes internal
    reference variables while popper-mode is active
  • Make popper--set-reference-vars idempotent by clearing vars at start, reuse
    it in mode teardown to eliminate duplicate reset logic
  • Update README examples to use setopt / :custom instead of setq

Problem

popper--set-reference-vars only runs when popper-mode activates. If
popper-reference-buffers is changed afterward, the internal variables
(popper--reference-names, popper--reference-modes, etc.) are never updated,
so new entries are silently ignored.

Test plan

  • Start popper-mode with default config
  • (setopt popper-reference-buffers '("\\*Messages\\*$" special-mode))
  • Verify special-mode appears in popper--reference-modes
  • Open a special-mode buffer and confirm popper recognizes it as a popup

Le Wang 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant