emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Rainer M Krug <Rainer@krugs.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: refine org-babel-tangle-jump-to-org?
Date: Fri, 07 Jun 2013 09:24:43 -0600	[thread overview]
Message-ID: <87bo7iueo4.fsf@gmail.com> (raw)
In-Reply-To: <8738suhzos.fsf@krugs.de> (Rainer M. Krug's message of "Fri, 07 Jun 2013 14:29:07 +0200")

Rainer M Krug <Rainer@krugs.de> writes:

> Rainer M Krug <Rainer@krugs.de> writes:
>
>> Eric Schulte <schulte.eric@gmail.com> writes:
>>
> [snip (46 lines)]
>
>>> For now I think both padlines and link comments are required for the
>>> jumping functionality to work.  I've updated the documentation to
>>> reflect this.
>>>
>>
>> Thanks - I will change it accordingly.
>
> I just discovered, that I have a problem with the setting of
> org-src-preserve-indentation, as I am using org to write a package, and
> I have put DESCRIPTION into the org file (as fundamental). If I have
> org-src-preserve-indentation set to t, the lines start with two spaces
> ("  ") which causes an error in reading the files.
>

Couldn't you just not indent these code blocks.  E.g., change

#+begin_src R
  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
  hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam
  nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis
  natoque penatibus et magnis dis parturient montes, nascetur ridiculus
  mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non
  turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam vestibulum
  accumsan nisl.
#+end_src

to

#+begin_src R
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam
nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis
natoque penatibus et magnis dis parturient montes, nascetur ridiculus
mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non
turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam vestibulum
accumsan nisl.
#+end_src

>
> I can disable padlines for these source blocks, which is no problem, but
> I think I can't change the setting for 
> org-src-preserve-indentation for a single block.
>

This is tricky because the indentation is separate from and predates
Babel, so there is no obvious straightforward way to coerce this into a
header argument.

>
> Would it be possible to have this option as a header argument, so that I
> can change it for certain blocks?
>
> The same problem is for the local file arguments: they must not be in
> the DESCRIPTION and NAMESPACE file. 
>

Alright, I think you've convinced me that it could be worthwhile to add
header arguments to support file local variables and read modes in
tangled files.  I don't have the time to implement and document these
new header arguments, but the code should not be too difficult if anyone
else wants to take a shot at it.

In the mean time I'd adjust your hook to wrap the addition of the file
local variable in something like

    ;; -*- emacs-lisp -*-
    (unless (or (string= (buffer-file-name) "DESCRIPTION")
                (string= (buffer-file-name) "NAMESPACE"))
      ;; file local var code goes here
      )

>
> I could use sed or similar to adjust these files, but I would rather
> prefer to
> a) be able to have org-src-preserve-indentation for tangling as a header
> argument
> b) a variable in which I can specify in which tangled files should have
> the local variables included.
>
> By the way, the post-tangle-hook approach works, but it has the
> disadvantage, that each file needs to be written twice - in the mini
> buffer, each tangled file is shown twice. As one org file contains
> several (>10) tangles output files, this adds to the time needed for
> tangling.
>

Agreed, for file modes and maybe local vars special header arguments
would be nice, maybe called tangle-mode and tangle-file-vars or
something.

Best,

>
> Cheers,
>
> Rainer
>  
>
>>
>> Rainer
>>
>> [snip (16 lines)]
>>
>> <#secure method=pgpmime mode=sign>
>>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

  reply	other threads:[~2013-06-07 15:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 14:54 refine org-babel-tangle-jump-to-org? Rainer M. Krug
2013-05-30 22:05 ` Eric Schulte
2013-05-31  7:35   ` Rainer M. Krug
2013-05-31 13:16     ` Eric Schulte
2013-06-03  9:32       ` Rainer M Krug
2013-06-03 13:34         ` Other question concerning org-babel-tangle-jump-to-org Rainer M Krug
2013-06-04  8:33           ` Julian M. Burgos
2013-06-04  8:39             ` Rainer M Krug
2013-06-05 16:10               ` Julian M. Burgos
2013-06-06 15:13           ` Eric Schulte
2013-06-07  7:27             ` Rainer M Krug
2013-06-06 15:06         ` refine org-babel-tangle-jump-to-org? Eric Schulte
2013-06-07  8:26           ` Rainer M Krug
2013-06-07 12:29             ` Rainer M Krug
2013-06-07 15:24               ` Eric Schulte [this message]
2013-06-07 15:38                 ` Rainer M Krug

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bo7iueo4.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=Rainer@krugs.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).