From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: Re: limitation for macro expansion Date: Tue, 07 Mar 2017 15:18:29 +0900 Message-ID: <87pohtvccq.wl@dns1.atmark-techno.com> References: <87shmt7495.wl@dns1.atmark-techno.com> <87tw786lcs.fsf@nicolasgoaziou.fr> <87pohvqiai.wl@dns1.atmark-techno.com> <87shmq4xx0.fsf@nicolasgoaziou.fr> <87k2824atd.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cl8SO-0002N2-O4 for emacs-orgmode@gnu.org; Tue, 07 Mar 2017 01:18:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cl8SI-0000Oi-CY for emacs-orgmode@gnu.org; Tue, 07 Mar 2017 01:18:48 -0500 Received: from p654789.hkidff01.ap.so-net.ne.jp ([121.101.71.137]:55558 helo=gw.atmark-techno.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cl8SH-0000N3-To for emacs-orgmode@gnu.org; Tue, 07 Mar 2017 01:18:42 -0500 Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by gw.atmark-techno.com (Postfix) with ESMTPS id 3AF28202A7 for ; Tue, 7 Mar 2017 15:18:38 +0900 (JST) Received: by mail-pf0-f197.google.com with SMTP id j5so224476829pfb.3 for ; Mon, 06 Mar 2017 22:18:37 -0800 (PST) In-Reply-To: <87k2824atd.fsf@nicolasgoaziou.fr> 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: mail@nicolasgoaziou.fr Cc: emacs-orgmode@gnu.org Hi Nicolas, Thank you for your time. I really appreciate it. On Tue, 07 Mar 2017 01:41:34 +0900, Nicolas Goaziou wrote: > > Yasushi SHOJI writes: > > > I assume that the key phrase is "anywhere Org markup is recognized". > > Link format doesn't allow Org markup, right? > > Not in the first part indeed. You can, however, use a macro in the > description part of the link. OK. > > # I use file_name_with_underscore.txt more than subscripts > > # I'd be nice, at least for me, to have '\sub' and '\super' special keywords > > # but leave the underscores alone. > > I don't understand where you need this. At the export level, you can use > `org-export-with-sub-superscripts' to `{}'. At display level, you can do > the same with `org-use-sub-superscripts'. I hate to waste your precious time because of my ignorant and I can live with '\under' but I'm totally lost. Are you saying that it's possible to generate "a_20170307.txt" from "a_{{{timestamp}}}.txt" if I set those variables mentioned above correctly? without using '\under'? I know you said it's ambiguous. So let me clarify what I said. What I said above was to change the syntax (or lex / parser's behavior) when some variable, let's say 'org-do-not-parse-sub-superscripts', is set to nil. So that a) org leaves '_' in "a_{{{somemacro}}}" as-is and the macro parser will pickup the "{{{somemacro}}}, b) when I want to use subscript, I can write "a\sub{someword or two}" to make a subscript. People like me don't use subscript much (to be honest, I've never wanted to use subscript since I started use Org, seven years?), but use '_' many times in a doc. Hence, (setq org-use-sub-superscripts nil) in my init.el. But for someone wanting to use subscripts in rare occasion, '\sub' would serve. I can understand if you say it's not good idea to change the _syntax_ by a variable. > > hmm. just checked the source. org-use-sub-superscripts is only for display. > > org-export-with-sub-superscripts is just for exports. > > See above. > > > I was gonna just by-pass or disable subscript parser all together when > > org-use-sub-superscripts is nil but it doesn't seems to be a good > > idea, does it? > > This is exactly what a nil `org-export-with-sub-superscripts' does. If that's the case, why doesn't macro parser pickup the "{{{timestamp}}}" in "a_{{{timestamp}}}"? Maybe this is my confusing point? The component resposible defining the org "syntax" is different from the parser? Even if sub/super parser is by-passed, because the "syntax" is subscript, the macro parser won't be called on this substring? Is the syntax defined in org-element--object-regexp and org-element--object-lex? Thanks, -- yashi