felko / neuron-mode

An emacs mode for editing Zettelkasten notes with neuron
GNU General Public License v3.0
118 stars 21 forks source link

`neuron-insert-new-zettel` should save the parent before switching to the child #50

Closed LightAndLight closed 4 years ago

LightAndLight commented 4 years ago

I don't know much about emacs plugins, so let me know if this isn't feasible.

I think this is a valid flow:

  1. In zettel A call neuron-insert-new-zettel, which creates zettel B and switches to it
  2. Fill out the zettel B's content
  3. Call neuron-edit-uplink and use it to switch back to zettel A

Currently this flow doesn't work because zettel A isn't saved after the link is inserted, so the plugin doesn't know that it links to B.

felko commented 4 years ago

Hello, for now I use previous-buffer which I have bound to an accessible key since I use it very often, that allows me to directly switch instead of calling neuron-edit-uplink which also needs me to select the parent zettel even though there is just one, and also it has to rebuild the entire zettel graph which can introduce some latency on large zettelkastens (though neuron could cache the graph in some future update).

However, saving the parent zettel would indeed make more sense, thanks for the suggestion.

Another flow could be:

  1. In zettel A, type the title of the new zettel B as if it was regular text
  2. Select the title and call neuron-create-zettel-from-selected-title
  3. Continue filling the contents of A and click on the resulting link to B to edit the new zettel.

I think they both have their uses though, at least I use both flows depending on what I'm trying to do.

LightAndLight commented 4 years ago

Another flow could be:

1. In zettel `A`, type the title of the new zettel `B` as if it was regular text

2. Select the title and call `neuron-create-zettel-from-selected-title`

3. Continue filling the contents of `A` and click on the resulting link to `B` to edit the new zettel.

That sounds good too. Is neuron-create-zettel-from-selected-title a proposed command, or does it already exist? (I can't find it in the docs)

In the meantime, I've also found myself using previous-buffer.

felko commented 4 years ago

Yeah it does exist, though it is referred as neuron-create-zettel-from-selection in the README, I'll update with the new name of the function.

Also, it's not yet available in neuron-mode but #44 will reimplement previous-buffer and next-buffer in a way that is more convenient when working with zettelkastens (namely, display the breadcrumbs that you accumulate when navigating, which could also be used to get back to the parent zettel).

felko commented 4 years ago

Should work now 👍 Thanks again for the suggestion