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

Implement inline image feature #128

Merged
merged 2 commits into from
Apr 4, 2016
Merged

Implement inline image feature #128

merged 2 commits into from
Apr 4, 2016

Conversation

syohex
Copy link
Collaborator

@syohex syohex commented Apr 2, 2016

This is related to #122.
CC: @ihodes

Should we add key bindings for those commands by default ?

See

@jrblevin
Copy link
Owner

jrblevin commented Apr 2, 2016

Wow, only 40 lines. I thought this would be a much larger undertaking! Nice work. I won't be able to actually test it out for a day or two, but I looked at the patch and it looks good to me.

I think keybindings are a good idea. Image insertion is under C-c C-i, so maybe C-c C-i C-t for toggling?

@ihodes
Copy link
Contributor

ihodes commented Apr 2, 2016

That's awesome, thank you! I was also assuming it'd be a lot more code to get that to work.

(error "Cannot show images."))
(save-excursion
(save-restriction
(widen)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to widen here?

My question's context: I'm thinking for my use-case I'll probably narrow to region of the day I'm writing in, and only want the pictures toggles for that day (toggling them for all days could make things slow, particularly because I intend to hook into this code & use ImageMagik to make the photos no wider than the buffer size).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I took most of code from org-mode and org inline image commands uses widen. Commands which I add works same as org-mode commands(org-toggle-inline-images etc).

@syohex
Copy link
Collaborator Author

syohex commented Apr 4, 2016

I think keybindings are a good idea. Image insertion is under C-c C-i, so maybe C-c C-i C-t for toggling?

@jrblevin Thanks for suggestion. I'll add bindings later.

@syohex
Copy link
Collaborator Author

syohex commented Apr 4, 2016

I have set toggle command to C-c C-i C-t.

@jrblevin jrblevin merged commit 78bb68a into master Apr 4, 2016
@syohex syohex deleted the inline-image branch April 4, 2016 22:00
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.

3 participants