From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [patch, ox] #+INCLUDE resolves links Date: Tue, 30 Sep 2014 12:18:22 +0200 Message-ID: <87mw9hcsy9.fsf@gmx.us> References: <87k34x6bjd.fsf@gmx.us> <87lhpdurfh.fsf@gmx.us> <87bnq984hd.fsf@nicolasgoaziou.fr> <87bnq5zzp7.fsf@gmx.us> <87oau4ems5.fsf@nicolasgoaziou.fr> <87d2af1qyv.fsf@gmx.us> <87tx3po7kj.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYuWC-0006Ca-J9 for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 06:18:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYuW4-0003tV-Uv for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 06:18:52 -0400 Received: from plane.gmane.org ([80.91.229.3]:42877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYuW4-0003rS-P6 for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 06:18:44 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XYuVx-0005Yu-Q6 for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 12:18:37 +0200 Received: from 109.201.154.200 ([109.201.154.200]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Sep 2014 12:18:37 +0200 Received: from rasmus by 109.201.154.200 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Sep 2014 12:18:37 +0200 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Nicolas Goaziou writes: >> Just out of curiosity, what is an example of a element that can be >> named and does not have a :contents-begin? > > #+name: empty-drawer > :DRAWER: > :END: Thanks. >> Okay, there's a lot of improvements in that suggestion. However, it >> misses this case which created using only "official" shortcuts >> >> * head >> SCHEDULED: <2014-09-28 sun> >> :LOGBOOK: >> - Note taken on [2014-09-28 sat 12:21] \\ >> a drawer >> :END: >> :PROPERTIES: >> :CUSTOM_ID: h >> :END: > > This was done on purpose, anticipating a patch I'm working on. Anyway, > it doesn't matter much. I'll revert it once my work is ready. Okay. If you discussed on the list I missed it. >> +elements.}. If the @code{:only-contents} property is non-nil, only the >> +contents of the requested element will be included, omitting any >> +property-drawers, planning-lines, attributes, captions etc. The > > properties (or property) drawer, planning line. > > Do you think it's worth specifying that captions and attributes will be > ignored? It seems pretty obvious to me as they do not belong to contents > (unlike to planning and properties drawers). It's two extra words and maybe it's helpful to make the concept clear to people unfamilar with org-element. The statement "contents of the requested element", while technically clear, is only barely comprehensible for the uninvited. However, it's only tweo extra words, so I'm happy to remove them if you have strong feeling about this. >> + (only-contents >> + (and (string-match ":only-contents +\\([^: \r\t\n]\\S-*\\)" value) >> + (prog1 (org-not-nil (match-string 1 value)) >> + (setq value (replace-match "" nil nil value))))) > > Why do you need to remove match from VALUE? AFAICT, the only match that > needs to be removed is the file name. Others are regular. I don't know what you mean with regular. Anyway, my reasoning is that this INCLUDE-command #+INCLUDE: "/tmp/test0.org" :my-random-prop "foo" Will give me something like: \#+\textsc{begin}\(_{\text{my}}\)-random-prop \section{test0} \label{sec-2} 1 \#+\textsc{end}\(_{\text{my}}\)-random-prop In casual testing similar stuff happened when I did not remove the match. It could have been it was a bit too casual and that I misspelling the property. I will test this properly later. > Mind the 80th column in your tests, and full stop at end of comments. OK, I'll fix it. > Besides the minor issues above, it looks good. Feel free to push it > whenever you want. Don't have push. —Rasmus -- Lasciate ogni speranza o voi che entrate: siete nella mani di'machellaio