From mboxrd@z Thu Jan 1 00:00:00 1970 From: "ZHUO QL (KDr2)" Subject: Re: Proposal: references from code to text. Date: Tue, 15 May 2018 04:49:34 +0000 (UTC) Message-ID: <385386647.1304827.1526359774932@mail.yahoo.com> References: <800808596.465327.1526131788117.ref@mail.yahoo.com> <800808596.465327.1526131788117@mail.yahoo.com> <871seebxdt.fsf@gmail.com> Reply-To: "ZHUO QL \(KDr2\)" Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1304826_1147815173.1526359774929" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIRuH-00041l-GF for emacs-orgmode@gnu.org; Tue, 15 May 2018 00:49:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIRuE-0003QH-AK for emacs-orgmode@gnu.org; Tue, 15 May 2018 00:49:49 -0400 Received: from sonic308-10.consmr.mail.gq1.yahoo.com ([98.137.68.34]:41230) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fIRuE-0003Pz-0V for emacs-orgmode@gnu.org; Tue, 15 May 2018 00:49:46 -0400 In-Reply-To: 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: John Kitchin , Emacs-org List ------=_Part_1304826_1147815173.1526359774929 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Well, it's a nice approach. But it has a few cons: 1. Putting text in a source block is not a very natural way. It may disturb= the fluidity, both for writing the Org source and reading the exported doc= ument(e.g. html);2. The bug Eric just found while putting a=C2=A0<<...>> li= nk within quotes, although, it may be easy to fix.=C2=A0 Greetings. ZHUO QL (KDr2, http://kdr2.com) =20 On Monday, May 14, 2018, 11:06:34 PM GMT+8, John Kitchin wrote:=20 =20 It seems like this is nearly all possible already (see below). It is a lit= tle wonky that you have to put text in a src txt block to achieve it, but o= therwise what is missing? * Main document See [[id:BAD97113-3561-4A4A-BA07-0CD5BF6BA35F][There is a reason we only su= pport two args]] (text to text) for notes about this function. The addition= is done in line [[(add)]] (text to code). #+NAME: DOC-OF-ADD#+BEGIN_SRC txt"We use the function add to calculate the = sum of two numbers."#+END_SRC #+NAME: ADD#+BEGIN_SRC emacs-lisp -n -r :noweb yes :tangle test.el(defun ad= d (x y)=C2=A0 <> ;; code to code=C2=A0 ;; [[id:BAD97113-3561-4A= 4A-BA07-0CD5BF6BA35F][There is a reason we only support two args]] code to = text=C2=A0 (+ x y) (ref:add)=C2=A0 )#+END_SRC #+RESULTS: ADD: add ** Notes *** There is a reason we only support two args=C2=A0 =C2=A0 :PROPERTIES:=C2= =A0 =C2=A0 :ID:=C2=A0 =C2=A0 =C2=A0 =C2=A0BAD97113-3561-4A4A-BA07-0CD5BF6BA= 35F=C2=A0 =C2=A0 :END: John ----------------------------------- Professor John Kitchin=C2=A0 Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803@johnkitchin http://kitchingroup.cheme.cmu.edu =20 ------=_Part_1304826_1147815173.1526359774929 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Well, it's a nice approach.=

But it has a few cons:

1= . Putting text in a source block is not a very natural way. It may disturb = the fluidity, both for writing the Org source and reading the exported docu= ment(e.g. html);
2. The bug Eric just found while putting a=  <<...>> link within quotes, although, it may be easy to fix. 


Greetings.
<= br>
ZHUO QL (KDr2, http://kdr2.com)



=20
=20
On Monday, May 14, 2018, 11:06:34 PM GMT+8, John K= itchin <jkitchin@andrew.cmu.edu> wrote:


It seems like this is nearly all possible already (see below). It = is a little wonky that you have to put text in a src txt block to achieve i= t, but otherwise what is missing?

* = Main document

See [[id:BAD97113-356= 1-4A4A-BA07-0CD5BF6BA35F][There is a reason we only support two args]] (tex= t to text) for notes about this function. The addition is done in line [[(a= dd)]] (text to code).

#+NAME: DOC-O= F-ADD
#+BEGIN_SRC txt
"We use the function add to calcu= late the sum of two numbers."
#+END_SRC

#+NAME: ADD
#+BEGIN_SRC emacs-lisp -n -r :noweb ye= s :tangle test.el
(defun add (x y)
  <<DOC-O= F-ADD>> ;; code to code
  ;; [[id:BAD97113-3561-4A4A-B= A07-0CD5BF6BA35F][There is a reason we only support two args]] code to text=
  (+ x y) (ref:add)
  )
#+END_SRC<= /div>

#+RESULTS: ADD
: add


** Notes<= /div>

*** There is a reason we only suppo= rt two args
    :PROPERTIES:
    :I= D:       BAD97113-3561-4A4A-BA07-0CD5BF6BA35F
    :END:


John

----------------------= -------------
Professor John Kitchin 
Doherty Hall A207F
Department of Chemical Engineering=
Carnegie Mellon University
Pittsburgh,= PA 15213
412-268-7803
------=_Part_1304826_1147815173.1526359774929--