Hello, drymer <dry...@autistici.org> writes:
> Hi, > > Thanks for your time. Could you please retry and evaluate this: > > ,---- > | (defun test-org-export () > | (interactive) > | (save-excursion > | (org-mark-element) > | (forward-line) ;; donot export title > | (setq b (region-beginning)) > | (setq e (region-end))) > | (message (org-export-as 'html t nil t))) > `---- > > And execute `M-x test-org-export RET' on the example header: > > ,--- > | * TODO Testing :test: > | Nullam eu ante vel est convallis dignissim. Fusce suscipit, wisi nec > | facilisis facilisis, est dui fermentum leo, quis tempor ligula erat > | quis odio. Nunc porta vulputate tellus. Nunc rutrum turpis sed pede. > | Sed bibendum. Aliquam posuere. Nunc aliquet, augue nec adipiscing > | interdum, lacus tellus malesuada massa, quis varius mi purus non odio. > | Pellentesque condimentum, magna ut suscipit hendrerit, ipsum augue > | ornare nulla, non luctus diam neque sit amet urna. Curabitur > | vulputate vestibulum lorem. Fusce sagittis, libero non molestie > | mollis, magna orci ultrices dolor, at vulputate neque nulla lacinia > | eros. Sed id ligula quis est convallis tempor. Curabitur lacinia > | pulvinar nibh. Nam a sapien. > `--- > > And see if it happens? It does, but the problem is in `test-org-export'. There, `org-export-as' is called outside the `save-excursion' so region beginning is not the same as b anymore. The region then includes the headline, and "subtree export" feature is ignored since there is an active region. Regards, -- Nicolas Goaziou 0x80A93738