Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transient-prefix: Add display-action slot #332

Merged
merged 2 commits into from
Dec 1, 2024

Conversation

josephmturner
Copy link
Contributor

@josephmturner josephmturner commented Nov 27, 2024

This change lets each transient-prefix display according to its own display-buffer-action. Resolves this discussion:

#303

I have not thoroughly tested this code, but it seems to work.

If you think this kind of change is appropriate, I'll fixup this commit with an update to the manual and force push.

Thank you!!

@tarsius
Copy link
Member

tarsius commented Nov 29, 2024

Let's name it just display-action and place it before refresh-suffixes.

@josephmturner josephmturner force-pushed the wip/display-buffer-action branch from 3e3a76c to 9493562 Compare November 30, 2024 07:37
@josephmturner
Copy link
Contributor Author

Let's name it just display-action and place it before refresh-suffixes.

Done!

@josephmturner josephmturner changed the title transient-prefix: Add display-buffer-action slot transient-prefix: Add display-action slot Nov 30, 2024
@josephmturner
Copy link
Contributor Author

I pushed another commit which adds the :mode-line-format also.

@josephmturner josephmturner force-pushed the wip/display-buffer-action branch from f852dad to cb1e938 Compare November 30, 2024 08:15
@josephmturner
Copy link
Contributor Author

And documentation.

@josephmturner josephmturner force-pushed the wip/display-buffer-action branch from cb1e938 to f335129 Compare November 30, 2024 08:19
@josephmturner
Copy link
Contributor Author

This last force-push avoids an incorrect use of oref-default.

@josephmturner
Copy link
Contributor Author

josephmturner commented Nov 30, 2024

Should :display-action nil override transient-display-buffer-action in the same way that :mode-line-format nil overrides transient-mode-line-format?

@tarsius
Copy link
Member

tarsius commented Nov 30, 2024

:initform is set to 'undefined so that passing :mode-line-format nil
to transient-define-prefix overrides transient-mode-line-format.

Eieio already has a "no value" value -- the value of the eieio--unbound variable. Just don't set :initform and that will be used. You then have to use slot-boundp to check whether a slot is unbound. If you skip that check and the slot is unbound, oref signals an unbound-slot error.

@tarsius
Copy link
Member

tarsius commented Nov 30, 2024

Should :display-action nil override transient-display-buffer-action in the same way that :mode-line-format nil overrides transient-mode-line-format?

Probably not. Do you see a use-case for that?

@tarsius

This comment was marked as off-topic.

@josephmturner josephmturner force-pushed the wip/display-buffer-action branch from f335129 to f575c7a Compare December 1, 2024 07:37
@josephmturner
Copy link
Contributor Author

:initform is set to 'undefined so that passing :mode-line-format nil
to transient-define-prefix overrides transient-mode-line-format.

Eieio already has a "no value" value -- the value of the eieio--unbound variable. Just don't set :initform and that will be used. You then have to use slot-boundp to check whether a slot is unbound. If you skip that check and the slot is unbound, oref signals an unbound-slot error.

Thanks, I had searched the eieio docs for "svar", but came up empty-handed. Force-pushed.

@josephmturner
Copy link
Contributor Author

Should :display-action nil override transient-display-buffer-action in the same way that :mode-line-format nil overrides transient-mode-line-format?

Probably not. Do you see a use-case for that?

Nope, just checking.

@josephmturner josephmturner force-pushed the wip/display-buffer-action branch from f575c7a to b744cda Compare December 1, 2024 08:14
@josephmturner

This comment was marked as off-topic.

@josephmturner

This comment was marked as off-topic.

@josephmturner

This comment was marked as off-topic.

@tarsius tarsius force-pushed the wip/display-buffer-action branch from b744cda to e516683 Compare December 1, 2024 13:16
This change lets each transient-prefix display according to its own
display-buffer-action.

Closes magit#303.
@tarsius tarsius force-pushed the wip/display-buffer-action branch from e516683 to 23cb5b1 Compare December 1, 2024 13:45
@tarsius tarsius merged commit 23cb5b1 into magit:main Dec 1, 2024
14 checks passed
@tarsius
Copy link
Member

tarsius commented Dec 1, 2024

Thanks! I've rebased and squashed some minor rearrangements.

@josephmturner josephmturner deleted the wip/display-buffer-action branch December 1, 2024 20:57
@josephmturner
Copy link
Contributor Author

Thanks! I've rebased and squashed some minor rearrangements.

Thank you!!!

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.

2 participants