-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Preview images inline #162
Comments
This is pretty sick! I think it could very well form a basis of another package,
|
I had similar ideas, but thought I'd start with something "easy" to see if it at all worked. I am amazed by how little I had to do to your original code to repurpose it like this. Kudos! Having slept upon the matter, I think that modifying the original |
Hm, I like that idea to unifying the subtree as a preview, that makes a lot of sense in this extended context. I haven't compared your code extensively to the "original", but maybe it would be possible to add a couple callbacks here and there which would decide based on the item type at hand what kind of preview to insert. It can then dispatch to bunch of functions. The API I invision is similar to the one of many Emacs special hooks: you have a list of functions taking the item as an argument, and you run them one by one until one returns non-nil, which means it inserted something and you should stop trying. This way it is easily extensible by adding more stuff to this list, either by us or by the end user themselves. |
in the
This was the main reason for copy-pasting the function, these checks differ from the ones in dired-subtree. With an API as suggested by you, this becomes moot.
For some reason, I did not manage to indent the image as I think you do with the inserted subtree (by running through each line and prepending two spaces). So I cheated and indented one more step with the help of the overlay.
I needed to "step outside" of the image for dired to find the beginning of the right line. ... and then the defadvice to keep me from having to directly modify dired-subtree-insert. My guess is that with a more holistic approach to all types of previews, none of these changes are significant or specific to image-inlines. |
Would you like to continue working on this? To be upfront I'm afraid I won't be available any time soon, it's quite packed in my schedule (I'm juggling three projects at work at the same time :/ unfortunate timing). I can help and answer questions / provide reviews of course. |
It would be my pleasure and an honour to take a swing at it. I can't promise any quick deliveries from my side either, however. |
Hi,
I like the way dired-subtree inserts subtrees, but I didn't like that I could only do this with directories. So I played around this morning and ended up with the following code. Since it is heavily copy-pasted from your dired-subtree code I'm hesitant to do a pull request for it. Instead, here it is, use it or throw it away as you please:
Mandatory screenshot:

The text was updated successfully, but these errors were encountered: