Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Incorrect ARCHIVE_CATEGORY when archiving second-level headline #882

Closed
iordanisg opened this issue Feb 1, 2025 · 0 comments
Closed

Incorrect ARCHIVE_CATEGORY when archiving second-level headline #882

iordanisg opened this issue Feb 1, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@iordanisg
Copy link

Describe the bug

When archiving a second-level headline that inherits its category from the parent headline, the ARCHIVE_CATEGORY is wrong, if the second-level headline is the last entry before another first-level headline with a different category.

Steps to reproduce

  1. Create an org file with the following contents:
* Project goal goes here
:PROPERTIES:
:CATEGORY: categoryA
:END:
** TODO This is a project task
* This is another project goal
:PROPERTIES:
:CATEGORY: categoryB
:END:
** TODO This is another project task
  1. Archive task This is a project task
  2. Check ARCHIVE_CATEGORY in the archive file and notice that it's categoryB, instead of categoryA

Expected behavior

ARCHIVE_CATEGORY should be the parent task category, i.e. categoryA in this case.

Emacs functionality

No response

Minimal init.lua

local tmp_dir = vim.env.TMPDIR or vim.env.TMP or vim.env.TEMP or '/tmp'
local nvim_root = tmp_dir .. '/nvim_orgmode'
local lazy_root = nvim_root .. '/lazy'
local lazypath = lazy_root .. '/lazy.nvim'

for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = nvim_root .. "/" .. name
end

-- Install lazy.nvim if not already installed
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    'git',
    'clone',
    '--filter=blob:none',
    'https://github.com/folke/lazy.nvim.git',
    '--branch=stable', -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require('lazy').setup({
  {
    'nvim-orgmode/orgmode',
    event = 'VeryLazy',
    ft = { 'org' },
    config = function()
      require('orgmode').setup()
    end,
  },
}, {
  root = lazy_root,
  lockfile = nvim_root .. '/lazy.json',
  install = {
    missing = false,
  },
})

require('lazy').sync({
  wait = true,
  show = false,
})

Screenshots and recordings

No response

OS / Distro

macOS 15.2

Neovim version/commit

0.10.4

Additional context

No response

@iordanisg iordanisg added the bug Something isn't working label Feb 1, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant