emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* d Dynamically exclude an 'org id' with org-babel-load-file?
@ 2012-03-01 16:41 Damon Haley
  2012-03-02  3:44 ` Bernt Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Damon Haley @ 2012-03-01 16:41 UTC (permalink / raw)
  To: emacs-orgmode

<#!multipart type=alternative><#!part type=text/plain>
Hi, I downloaded Bernt Hansen's wonderful GTD orgmode setup from:

git clone git://git.norang.ca/org-mode-doc.git

I am then using his customizations in my emacs config with:

(org-babel-tangle-file "~/git/src/org-mode-doc/org-mode.org")
(org-babel-load-file "~/git/src/org-mode-doc/org-mode.org")

However there is one section under Bernt's 'Agenda setup' with an org id
of 'AgendaSetup' that I don't want to evaluate in my emacs
initialization.

** Agenda Setup
:PROPERTIES:
:CUSTOM_ID: AgendaSetup
:END:

#+begin_src emacs-lisp :tangle yes :exports none
  ;; The following setting is different from the document so that you
  ;; can override the document org-agenda-files by setting your
  ;; org-agenda-files in the variable org-user-agenda-files
  ;;
  (if (boundp 'org-user-agenda-files)
      (setq org-agenda-files org-user-agenda-files)
    (setq org-agenda-files (quote ("~/git/org"
                                 "~/git/org/client1"
                                 "~/git/org/bzflag"
                                 "~/git/client2"))))
  
#+end_src

I know I could edit the file directly and change tangle to 'no'.

But is there a way to exclude this section dynamically when I start up
emacs without having to manually change Bernt's file?  This is because
I'd like to use git pull again in the future to get Bernt's latest
changes and not have to keep track of the changes I made.

There is a function in the 'emacs starter kit' called starter-kit-load
that loads org file section by id or tag, but I'm not sure if there's a
way to do the opposite and load while excluding id(s) or tag(s) using
org-babel.

Any help or suggestions would be appreciated.

Damon









<#!part type=text/html>
<p>Hi, I downloaded Bernt Hansen's wonderful GTD orgmode setup from:<br/>
</p>
<p><br/>
git clone git://git.norang.ca/org-mode-doc.git<br/>
</p>
<p><br/>
I am then using his customizations in my emacs config with:<br/>
</p>
<p><br/>
(org-babel-tangle-file "~/git/src/org-mode-doc/org-mode.org")<br/>
(org-babel-load-file "~/git/src/org-mode-doc/org-mode.org")<br/>
</p>
<p><br/>
However there is one section under Bernt's 'Agenda setup' with an org id<br/>
of 'AgendaSetup' that I don't want to evaluate in my emacs<br/>
initialization.<br/>
</p>
<p><br/>
</p>
<div id="outline-container-AgendaSetup" class="outline-3">
<h3 id="AgendaSetup"><a name="sec-1" id="sec-1"></a>Agenda Setup</h3>
<div class="outline-text-3" id="text-AgendaSetup">


<p><br/>
</p>
<p><br/>
</p>
<p><br/>
Is there a way to exclude this section.  This is because I'd<br/>
like to not have to edit his file manually so I can use git pull again<br/>
in the future to get Bernt's latest changes.<br/>
</p>
<p><br/>
There is a function in the 'emacs starter kit' called starter-kit-load<br/>
that loads by org id, but I'm not sure if there's a way to exclude by<br/>
id.<br/>
</p>
<p><br/>
Any help or suggestions would be appreciated.<br/>
</p>
<p><br/>
Damon<br/>
</p>
<p><br/>
</p>
<p><br/>
</p>
<p><br/>
</p>
<p><br/>
</p>
<p><br/>
</p>
<p><br/>
</p>
<p><br/>
</p>
<p><br/>
</p>
<p><br/>
</p></div>
</div>

<p><br/><br/>
<!-- hhmts start --> <!-- hhmts end --></p>
<#!/multipart>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: d Dynamically exclude an 'org id' with org-babel-load-file?
  2012-03-01 16:41 d Dynamically exclude an 'org id' with org-babel-load-file? Damon Haley
@ 2012-03-02  3:44 ` Bernt Hansen
  2012-03-02  3:49   ` Bernt Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Bernt Hansen @ 2012-03-02  3:44 UTC (permalink / raw)
  To: Damon Haley; +Cc: emacs-orgmode

Damon Haley <dkh@member.fsf.org> writes:

> Hi, I downloaded Bernt Hansen's wonderful GTD orgmode setup from:
>
> git clone git://git.norang.ca/org-mode-doc.git
>
> I am then using his customizations in my emacs config with:
>
> (org-babel-tangle-file "~/git/src/org-mode-doc/org-mode.org")
> (org-babel-load-file "~/git/src/org-mode-doc/org-mode.org")
>
> However there is one section under Bernt's 'Agenda setup' with an org id
> of 'AgendaSetup' that I don't want to evaluate in my emacs
> initialization.
>
> ** Agenda Setup
> :PROPERTIES:
> :CUSTOM_ID: AgendaSetup
> :END:
>
> #+begin_src emacs-lisp :tangle yes :exports none
>   ;; The following setting is different from the document so that you
>   ;; can override the document org-agenda-files by setting your
>   ;; org-agenda-files in the variable org-user-agenda-files
>   ;;
>   (if (boundp 'org-user-agenda-files)
>       (setq org-agenda-files org-user-agenda-files)
>     (setq org-agenda-files (quote ("~/git/org"
>                                  "~/git/org/client1"
>                                  "~/git/org/bzflag"
>                                  "~/git/client2"))))
>   
> #+end_src
>
> I know I could edit the file directly and change tangle to 'no'.
>
> But is there a way to exclude this section dynamically when I start up
> emacs without having to manually change Bernt's file?  This is because
> I'd like to use git pull again in the future to get Bernt's latest
> changes and not have to keep track of the changes I made.
>
> There is a function in the 'emacs starter kit' called starter-kit-load
> that loads org file section by id or tag, but I'm not sure if there's a
> way to do the opposite and load while excluding id(s) or tag(s) using
> org-babel.
>
> Any help or suggestions would be appreciated.

Hi Damon,

Thanks for the kind words!

I guess I don't understand what the problem is here.  Since you have
your own clone of the repository you can create a commit that turns off
this :tangle yes and then subsequent pulls will preserve that change.
I'm not expecting to touch that part of the document again so you
probably won't get conflicts with it in the future.

Why do you want to skip this specific part of the file?  Can't you just
override the variable with your value of org-agenda-files by doing

(setq org-user-agenda-files (quote WHATEVER-IS-APPROPRIATE))

before you load it?

Could you provide more details on what it is you are trying to 'fix'?  I
don't think I understand what it is you are trying to achieve.

Regards,
Bernt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: d Dynamically exclude an 'org id' with org-babel-load-file?
  2012-03-02  3:44 ` Bernt Hansen
@ 2012-03-02  3:49   ` Bernt Hansen
  0 siblings, 0 replies; 3+ messages in thread
From: Bernt Hansen @ 2012-03-02  3:49 UTC (permalink / raw)
  To: Damon Haley; +Cc: emacs-orgmode

Bernt Hansen <bernt@norang.ca> writes:

>
> Could you provide more details on what it is you are trying to 'fix'?  I
> don't think I understand what it is you are trying to achieve.

I just saw your followup in the other thread... so nevermind :)

Regards,
Bernt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-02  3:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-01 16:41 d Dynamically exclude an 'org id' with org-babel-load-file? Damon Haley
2012-03-02  3:44 ` Bernt Hansen
2012-03-02  3:49   ` Bernt Hansen

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).