nvim-orgmode / nvim-orgmode/orgmode

Create headline if it doesn't already exist in target

Open
#957 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Lua
Stars
3.9k
Forks
190
Avg merge
2d 13h
Merged PRs (30d)
7

Description

Does this feature exist in Emacs orgmode core?

No

Orgmode link

I'm not sure if this is the current behavior in emacs, but I think it would be pretty cool if the capture window offered to create a headline that doesn't yet exist in the target file.
An example:

						f = {
							description = "repo heading",
							template = "* %?",
							headline = vim.fn.fnamemodify(vim.fn.getcwd(), ":t"),
							target = org_agenda_path("repos.org"),
						},

on a new repo, currently won't let me confirm the capture since the repo headline doesn't exist in the file.

The relevant section in the code that I found was here.

Feature value

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lua/orgmode/capture/init.lua around line 584 and reproduce the capture configuration shown against a target file without the requested headline. Determine the existing confirmation behavior, then consider the work complete when a capture can create the missing headline and proceed successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.