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

Fix: exiting org-present presentation always removes inline images #13205

Closed
wants to merge 1 commit into from

Conversation

Kazark
Copy link
Contributor

@Kazark Kazark commented Jan 24, 2020

Spacemacs configures org-present to inline images while presenting. That much
makes sense. But it has a hook to turn them off unconditionally when exiting
presentation mode. This causes a problem if you just want images to show in and
out of presentation mode.

Steps to Reproduce

  1. Create an Org file
  2. Add a link to a file
  3. Set #+STARTUP: inlineimages
  4. M-x org-present
  5. Exit presentation mode

Expected

Because of #+STARTUP: inlineimages images are still inlined.

Actual

The inline images have been removed upon exiting the presentation mode.

Fix

Check org-startup-with-inline-images on exiting presentation mode and only
remove the inline images if it is false.

Testing

To ensure that this did not introduce a regression of the converse behavior, I
also tested with #+STARTUP: noinlineimages, and it still turned off the images
when exiting the presentation.

Spacemacs configures `org-present` to inline images while presenting. That much
makes sense. But it has a hook to turn them off unconditionally when exiting
presentation mode. This causes a problem if you just want images to show in and
out of presentation mode.

STEPS TO REPRODUCE
1. Create an Org file
2. Add a link to a file
3. Set `#+STARTUP: inlineimages`
4. `M-x org-present`
5. Exit presentation mode

EXPECTED
Because of `#+STARTUP: inlineimages` images are still inlined.

ACTUAL
The inline images have been removed upon exiting the presentation mode.

FIX
Check `org-startup-with-inline-images` on exiting presentation mode and only
remove the inline images if it is false.

TESTING
To ensure that this did not introduce a regression of the converse behavior, I
also tested with `#+STARTUP: noinlineimages`, and it still turned off the images
when exiting the presentation.
@Kazark
Copy link
Contributor Author

Kazark commented Jan 24, 2020

I see there is a check for CHANGELOG changes. Should I update the changelog for this?

@duianto
Copy link
Collaborator

duianto commented Jan 26, 2020

Thank you for contributing to Spacemacs. It's safe to delete your branch.
The changes have been applied to the develop branch.
Commit(s): 4ae7be5

The test for a changelog entry is marked as optional, but it can be helpful if the PR authors also add a changelog entry.

I added it for this commit.

In this case the changed file: layers/+emacs/org/packages.el
is in the org layer, therefore the changelog entry was added to the section:

*** Layer changes and fixes
**** Org

Some layers have one or more of these sub sections:
Packages, Key bindings, Improvements, Fixed and Other
Then the changelog entry can be added to the relevant sub section.

But in this case the org section only has a Packages and Key bindings section near the top, therefore this was added to the end, on the line before the next layer: Osx

If it's unclear where it should be added, then it's fine to add it to the end of the changelog.develop file and mention in the PR that it wasn't clear where it should be added and a maintainer will move it.

@duianto duianto closed this Jan 26, 2020
@Kazark
Copy link
Contributor Author

Kazark commented Jan 27, 2020

@duianto Thanks for your explanation of the changelog, and for merging.

@Kazark Kazark deleted the org-present-inline-images branch January 27, 2020 13:46
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