Skip to content

Bug: Pasted text loses org-indent-mode indentation when org-transclusion-mode is enabled #309

Description

@YasserKa

Summary

When both org-indent-mode and org-transclusion-mode are enabled in an Org
buffer, pasting text under a heading does not get the virtual indentation
(line-prefix/wrap-prefix text properties) that org-indent-mode normally
applies. The pasted text stays flush-left until any subsequent edit is made
to the buffer, at which point it snaps into correctly indented position.

Disabling org-transclusion-mode fully resolves the issue. The bug
reproduces with no active transclusions in the buffer. Simply having
org-transclusion-mode turned on is sufficient to trigger it.

Steps to reproduce

  1. emacs -Q -l repro.el (see minimal init below)
  2. Open/create an Org file with at least one heading and org-indent-mode
    active
  3. Enable org-transclusion-mode in the buffer
  4. Copy any line of text (M-w or select + M-w)
  5. Paste it under the heading (C-y / M-x yank)

Expected: Pasted text is immediately displayed with the same virtual
indentation as other text under that heading.

Actual: Pasted text appears flush-left (column 0), with no
line-prefix/wrap-prefix property set. Typing any character anywhere in
the buffer afterward causes the pasted text to snap into the correct
indentation.

Minimal repro config

;; repro.el
(require 'package)
(package-initialize)
;; adjust to however you install packages
(unless (package-installed-p 'org-transclusion)
  (package-refresh-contents)
  (package-install 'org-transclusion))
 
(add-hook 'org-mode-hook #'org-indent-mode)
(add-hook 'org-mode-hook #'org-transclusion-mode)

Environment

  • Emacs version: GNU Emacs 31.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.52, cairo version 1.18.4)
  • Org version: <fill in — M-: Org mode version 10.0-pre (release_9.8.7-346-g437fd1 @$HOME/.config/emacs/straight/build/org/)>
  • org-transclusion version: 1.4.0
  • OS: 7.2.2-arch1-1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions