From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: org-export-as Date: Wed, 08 Mar 2017 11:58:57 +0100 Message-ID: <87k28011ce.fsf@nicolasgoaziou.fr> References: <20170307185019.b7tzqlssrpab7gr6@laptop> <87bmtc3c21.fsf@nicolasgoaziou.fr> <20170308101932.lc6k34o7ssllykk3@laptop> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clZJB-0003nq-JQ for emacs-orgmode@gnu.org; Wed, 08 Mar 2017 05:59:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clZJ8-0004kb-Ge for emacs-orgmode@gnu.org; Wed, 08 Mar 2017 05:59:05 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:48255) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1clZJ8-0004kN-Ae for emacs-orgmode@gnu.org; Wed, 08 Mar 2017 05:59:02 -0500 In-Reply-To: <20170308101932.lc6k34o7ssllykk3@laptop> (drymer@autistici.org's message of "Wed, 8 Mar 2017 10:19:32 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: drymer Cc: lista de correo de org-mode Hello, drymer 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