org2blog / org2blog

Blog from Org mode to WordPress.

Home Page:https://github.com/org2blog/org2blog/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upload note for image no longer placed with post

higham opened this issue · comments

The documentation says that when an image is uploaded, org2blog

"Make a note in the Org2Blog entry so that it remembers that it
already uploaded the image file to your blog."

There has been a change in behaviour. The upload note used to go
in the post entry but (in org2blog-20200317.2136 and probably other
recent versions) the note is now being put at the end of the Org
file. I have multiple posts per file and narrow down to the post
in question when working on it. The upload note is therefore
invisible.

Can the previous behaviour be reinstated? It's more logical and
easier to work with. Also, making changes outside a narrowed
region is not good practice.

Hi @higham

First sorry for the inconvenience. That is definitely an unpleasant experience. It will get resolved soon.

The behavior your describe makes sense to me. I need to investigate why widen is being used during posting and figure out how to move forward. Then I will get back to you.

How you are using Org2Blog with multiple buffer-entries in a single file where you are simply narrowing to them: it surprises me! I don't know of it ever being used in that way before. As far as I knew people used subtree-entries to store multiple posts in one file. Once I know more I will add it to the documentation as an approach.

How you are using Org2Blog with multiple buffer-entries in a single file where you are simply narrowing to them: it surprises me!

Yes my "blog.org" looks like

  • Post 1
  • Post 2
    ...

I've got used to narrowing (and forget if org2blog works without it) since exporting more generally with the whole buffer active will export the whole buffer by default. I often print a draft blog post by exporting to LaTeX to get a nicely formatted PDF file.

Thanks for explaining that.

Right now my attention is going to personal logistics tasks given world-events.

As soon as they are addressed I'm going to return to this task.

Be well.

@higham Thanks for your patience here: I will be working on this ASAP.

@higham What you do narrowing to a post is a really nice idea. It isn't something I'd considered before. Since I began maintaining Org2Blog it's idea about blogging was first that there was a single post per file. Later on the idea of multiple posts in a single file was implemented in the form of a single post per subtree. As you say the user interface and documentation are all built around these two core concepts. Despite that as you already know narrowing to a single post in a multi post file had worked fine though. That is before I changed it.

I made that change after assuming that users unfamiliar with narrow would get confused when they tried posting a narrowed "buffer post". Although, to your point

making changes outside a narrowed region is not good practice.

it didn't even occur to me then that narrowing a buffer post could be useful in the way that you used it. In an attempt to avoid future problems I figured it would be a good idea to widen before Org2Blog does the work of posting. Like you ran into though that is unexpected. Now I am looking at resolving this and am curious what you think.

There is a story I am telling myself that very few Org2Blog users will ever narrow a buffer post and that by default Org2Blog should widen before posting: it isn't good practice for normal modes but in the case of Org2Blog, Org2Blog is more like an application than a mode. Another part of the story is that some advanced users such as yourself should be able to narrow as you wish, and that Org2Blog will not widen before before posting. In this story the simplest possible way to do it would be to make a configuration option maybe called can-post-narrowed-buffers that defaults to false. Then in your case you would set it to true. Finally I would update the documentation with a note in the "buffer post" section, a subtree "Advanced buffer-posting with narrow". The reason for all of this story telling is that at this point Org2Blog is more of an application than a mode. That is one story I'm telling myself.

Another is to simply remove the widens. Have you already done that locally? I assumed that you had in order to move forward.

I'm not one to over-architect an application but I am one to try to ensure that everything "Just works as expected" for the majority of people. Right now I am "the one" to support the app so I also have my vested interests tool.

Thanks for your time and patience on this. All of your feedback is appreciated. I'll figure out how to move forward now it is the only issue I'm working on.

@higham Just committed the fix. My apologies for the delay implementing this. At the time of writing this comment the world was still under quarantine from COVID-19 and it certainly affected a lot of people in a lot of ways! Please let me know how the fix works for you.

Many thanks, Grant. What did you implement in the end?

After you explained this

Can the previous behaviour be reinstated? It's more logical and
easier to work with. Also, making changes outside a narrowed
region is not good practice.

it made sense to me and that is the change that I made.

You are welcome and thanks for investing your time in this: it is feedback like yours that is critical to shaping Org2Blog into what it can and should be :).

For reference this is how Narrowing works with Org2Blog:

https://github.com/org2blog/org2blog#using-narrowing