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

First stab at register support #272

Merged
merged 13 commits into from
Oct 4, 2022
Merged

First stab at register support #272

merged 13 commits into from
Oct 4, 2022

Conversation

matsl
Copy link
Collaborator

@matsl matsl commented Aug 20, 2022

What

First stab at register support

Why

Sharing the first stab at implementing register support of buttons for ideas and comments.

@matsl matsl force-pushed the add-register-support branch 2 times, most recently from d8965dd to 61b4aa3 Compare August 20, 2022 21:52
@matsl matsl requested a review from rswgnu August 20, 2022 21:54
@matsl
Copy link
Collaborator Author

matsl commented Aug 27, 2022

@rswgnu Added support for link-to-ibut

@matsl
Copy link
Collaborator Author

matsl commented Sep 11, 2022

@rswgnu Added test cases to the PR. The test hypb-register-test--register-val-insert fails due to what it seems a problem with link-to-ibut. The setup is in the test. I will try to debug it further but maybe you can have a look?

ChangeLog Outdated Show resolved Hide resolved
hypb-register.el Outdated Show resolved Hide resolved
hypb-register.el Outdated
(hypb:error "Point must be at a Hyperbole button"))
(make-hypb-register-but
:label label
:file (buffer-file-name)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there are explicit and implicit buttons where the button source buffer does not have an attached file, so you'll need to handle those appropriately, i.e. links to them work only within the current Emacs session, which may be okay for use with registers which typically are not stored across sessions either.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not link-to-ebut require a file name?

How should we support the case for origin buffer with no filename? Shall we jump to button source and execute the action key instead of using link-to-ebut?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, jump to the button source buffer and move point to the button text (label) and activate the button there. If the source buffer is no longer live, then raise an error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since insert-register inserts an ebut that the user acts on would we not need a new action type then for that behavior or let link-to-ebut and link-to-ibut also handle the buffer only case?

hypb-register.el Outdated Show resolved Hide resolved
test/hypb-register-tests.el Outdated Show resolved Hide resolved
test/hypb-register-tests.el Outdated Show resolved Hide resolved
Comment out hui-register-test--register-val-insert-ibut for now.
@matsl
Copy link
Collaborator Author

matsl commented Oct 2, 2022

Added a test case for inserting an ebut and commented out the similar test case for ibut. The later test case looks like it breaks due to problem with link-to-ibut and having a red build seems contra productive at this stage.

@matsl matsl marked this pull request as ready for review October 3, 2022 17:10
@matsl matsl merged commit caa137f into master Oct 4, 2022
@matsl matsl deleted the add-register-support branch October 4, 2022 21:37
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.

None yet

2 participants