Re: [O] Tangle only current code block?

2012-10-08 Thread Yann Le Du
On Mon, Oct 8, 2012 at 1:39 AM, Eric Schulte eric.schu...@gmx.com wrote:

 Yann Le Du yann.ledu...@gmail.com writes:

  Hi,
 
  I have a bunch of code chunks with stuff like fun name and headers
 like
  :tangle toto.c exporting to different files in noweb style
 
  If I use C-c C-v t, it extracts all of those code chunks nicely
 
  However, sometimes I would like to put my cursor inside one of those code
  chunks and then extract only that one, not the others.
 
  Is there a simple way ?
 

 Yes, run the tangle with a prefix argument to tangle only the block
 under your cursor e.g., C-u C-c C-v t.


Very nice! Is that documented? It's not in
http://orgmode.org/manual/Extracting-source-code.html


 Best,

 
  I narly found a solution, but to make it work nicely I need to put
  org-babel-tangle inside a macro, but it fails: if I define a macro :
 
  C-x (
  M-x org-babel-tangle
  C-x )
  C-x e
 
  it fails, saying wrong type argument stringp, nul
 
  I'm lost.
 
  Yann

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



[O] Bug ? LaTeX exporter does not export subsections from included files

2012-10-08 Thread Sébastien Delafond
Hi all,

a Debian user, on 7.9.1, reports[0] the following problem :

  Since the update to org-mode 7.9.1-1, the LaTeX export does not work
  completely anymore with included files. Please try exporting the
  attached testmain.org (for example to PDF via LaTeX with C-c C-e d).
  The included file testbar.org is included at the begining, but the
  subsections (**) are not exported.

  I've tried ODF and HTML export, which work as expected.

Here is his testmain.org:

  * Foo
  Here is foo!

  * Bar
  #+INCLUDE: testbar.org

  ** Bar 3
  This appears.

  * Conclusion 

And the corresponding testbar.org:

  This is Bar.

  ** Bar 1
  This is Bar's first part.

  ** Bar 2
  And here is the second one.

Cheers

--Seb

[0] http://bugs.debian.org/689428




Re: [O] [babel] howto debug #+call lines

2012-10-08 Thread Andreas Leha
Hi Eric,


 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Hi Eric,

 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Hi all,

 I am getting different results from the evaluation of a source block and
 the evaluation of a #+call line to that block.

 Therefore, my question: Is there an equivalent to
 org-babel-expand-src-block (C-c C-v v) for #+call lines?

 Or more general:  How do I debug #+call lines?

 Regards,
 Andreas


 Can you provide a minimal example?

 You could write a code block equivalent to the call line.  E.g.,

 #+call: foo(bar=1)

 is equivalent to

 #+begin_src emacs-lisp :var results=foo(bar=1)
   results
 #+end_src

 Thanks for following this up.  I found the problem in my case:  The
 header argument ':colnames yes' was missing from the call line, such that
 the passed variables were different.  (I've fallen into that trap
 repeatedly, but do not learn, as it seems...)

 It would have been a lot easier to find this, if I had had the possibility
 to do C-c C-v v on the call line to get the chance to step through the
 (R-) code that is evaluated.  Without this, it took me some time to
 figure things out.

 So the question still stands: Is there the possibility to see what is
 actually executed with a call line, similar to C-c C-v v on a source
 block?


 There is no body to expand in a call line so C-c C-v v would have
 nothing to show.  You can however jump to the related code block and
 call C-c C-v v there.  This process could be made faster by wrapping the
 org-babel-goto-named-src-block and org-babel-expand-src-block functions
 into a single function.



 For a small example consider:

 ---
 #+name: foo
 | bar |
 | baz |
 | bam |

 #+call: testblock[:var a=foo]() :colnames yes

 #+name: testblock
 #+begin_src R :var a=foo :colnames yes
   a - a[,1]
   data.frame(x=a)
 #+end_src
 ---

 Regards,
 Andreas



Thanks for the confirmation, that there is no possibility to expand a
#+call line.

I know, that I can jump to the code block and expand that one (quite
fast with C-c C-v g RET C-c C-v v), but that is exactly *not* what I was
looking for.  Because then, the header arguments to the source code
block will apply instead of the header arguments to the #+call line.

I was hoping for a C-c C-v v on #+call lines, which would spare me from
modifying the source block's header arguments.  But it is not a pressing
issue, just my laziness (and bad coding perhaps).

Regards,
Andreas





Re: [O] Publishing using the new exporter

2012-10-08 Thread Nicolas Goaziou
Hello,

Robert Klein klein...@mpip-mainz.mpg.de writes:

 There is still a small issue, though.  I tried org-e-publish to pdf
 with one small difference:

 1. I'm in a buffer, the visited file is in the base-directory.  M-x 
 org-e-publish... Publishing works Ok.

 2. I'm in a buffer, visiting a buffer /not/ in the base-directory.
 M-x 
 org-e-publish... The pdf's don't have their images included.

 I suspect, pdflatex is called using a working directory which is not
 the base-directory but the default-directory of the buffer from which
 I M-x 
 org-e-publish.

I pushed a patch to solve this. May you confirm it is fine now?

Important note : I moved publishing functions to their respective
back-end, renaming them in the process. For example
`org-e-publish-org-to-pdf' becomes `org-e-latex-publish-to-pdf'.


Regards,

-- 
Nicolas Goaziou



[O] Problem with hourly repeater

2012-10-08 Thread Memnon Anon
Hi, 

I am trying the hourly repeaters and see a problem.

Steps to reproduce:
* emacs -Q
* load minimal setup:

--8---cut here---start-8---
;;; adjust path as needed!
(setq load-path (cons ~/org-mode/lisp load-path))
(setq load-path (cons ~/org-mode/contrib/lisp load-path))
(setq load-path (cons ~/org-mode/contrib/babel/lisp load-path))
(require 'org)
(setq org-clock-persist t)
(org-clock-persistence-insinuate)
(setq org-clock-history-length 50
  org-clock-in-switch-to-state STRT
  org-clock-idle-time 5
  org-log-done 'time
  org-log-reschedule 'time
  org-log-into-drawer LOGBOOK)

(setq org-agenda-files (quote (~/agenda.org)))
(setq debug-on-error t)
--8---cut here---end---8---

* Minimal agenda file ~/agenda.org:

--8---cut here---start-8---
#+SEQ_TODO: TODO STRT | DONE DEFD CNCL

* TODO Test
  Scheduled: 2012-10-08 Mo 18:00 +6h
--8---cut here---end---8---

* M-x org-agenda a -
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p
nil)
[...]

This is with
Org-mode version 7.9.2 (release_7.9.2-424-g0ccf65 @ 
and 
GNU Emacs 24.2.50.1 (i486-pc-linux-gnu, GTK+ Version 3.4.2) of
2012-10-04 on dex, modified by Debian

Anyone else see this?

Memnon




[O] C-c ^ for plain lists? Why not?

2012-10-08 Thread James Harkins
I've started to like checklists because they are a good way to keep account of 
things that have to be done, without the individual items being entered into 
the agenda (and thus transferred to MobileOrg).

But I'm running into the limitation that plain lists can't be sorted *by their 
checklist status*. You can sort alphabetically, numerically or by time or 
function. So, I guess I have to write a lisp function to do it... but I don't 
have time to do that right now, but I need to sort the list now...

Valid feature request?

hjh


--
James Harkins /// dewdrop world
jamshar...@dewdrop-world.net
http://www.dewdrop-world.net

Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal.  -- Whitman

blog: http://www.dewdrop-world.net/words
audio clips: http://www.dewdrop-world.net/audio
more audio: http://soundcloud.com/dewdrop_world/tracks



[O] Problems with habit sorting

2012-10-08 Thread Renger van Nieuwkoop
Hi
I have an agenda-view where I can see all my habits. They have priorities but 
are not sorted.
Any idea how to sort them according to priority.

My view looks like this

Monday  8 October 2012 W41
   8:30.. 
  10:00.. 
  12:00.. 
  13:00.. 
  15:00.. 
  17:00.. 
  17:27.. now - - - - - - - - - - - - - - - - - - - - - - - - -
  refile: In   3 d.:  TODO [#A] Sullivan Chapter
 :REFILE::
  refile: In   5 d.:  TODO [#A] Blog
 :REFILE::
  refile: In   3 d.:  TODO [#B] Exercise 1  
 :REFILE::
  Diary:  Shemini Atzeret
  Diary:  Columbus Day
  habits: TODO [#B] habit1 
*!:HABIT::
  habits: TODO [#A] habit2  
!:HABIT::
  habits: TODO [#B] habit3  
!:HABIT::
  habits: TODO [#B] habit4  
!:HABIT::
  habits: TODO [#A] habit5  
!:HABIT::


Thanks

Renger

___

Renger van Nieuwkoop
Goldiwilstrasse 16 F / 3600 Thun
Tel +41 33 221 53 05 / +41 79 818 53 73
mailto: ren...@vannieuwkoop.ch





Re: [O] Publishing using the new exporter

2012-10-08 Thread Robert Klein

On 10/08/2012 02:55 PM, Nicolas Goaziou wrote:

Hello,

Robert Klein klein...@mpip-mainz.mpg.de writes:


There is still a small issue, though.  I tried org-e-publish to pdf
with one small difference:

1. I'm in a buffer, the visited file is in the base-directory.  M-x
org-e-publish... Publishing works Ok.

2. I'm in a buffer, visiting a buffer /not/ in the base-directory.
M-x
org-e-publish... The pdf's don't have their images included.

I suspect, pdflatex is called using a working directory which is not
the base-directory but the default-directory of the buffer from which
I M-x
org-e-publish.


I pushed a patch to solve this. May you confirm it is fine now?

Important note : I moved publishing functions to their respective
back-end, renaming them in the process. For example
`org-e-publish-org-to-pdf' becomes `org-e-latex-publish-to-pdf'.


Regards,



Hello,

umm, no, it doesn't work. I even have more issues now.

1. At first, when calling org-e-publish I got an error message void 
function org-e-html-publish-to-html


I go rid of the message by this patch (which most probably is the wrong 
thing to do):

diff -ur org-mode/lisp/org-e-html.el org-mode-b/lisp/org-e-html.el
--- org-mode/lisp/org-e-html.el 2012-10-08 15:43:34.723502697 +0200
+++ org-mode-b/lisp/org-e-html.el   2012-10-08 17:24:26.147115603 +0200
@@ -36,7 +36,6 @@
 ;;; Dependencies

 (require 'org-export)
-(require 'org-e-publish)
 (require 'format-spec)
 (eval-when-compile (require 'cl) (require 'table))

diff -ur org-mode/lisp/org-e-publish.el org-mode-b/lisp/org-e-publish.el
--- org-mode/lisp/org-e-publish.el  2012-10-08 15:43:34.727502681 +0200
+++ org-mode-b/lisp/org-e-publish.el2012-10-08 17:24:48.848019275 +0200
@@ -41,6 +41,7 @@
 (eval-when-compile (require 'cl))
 (require 'format-spec)
 (require 'org-export)
+(require 'org-e-html)

 (declare-function org-e-latex-compile org-e-latex (texfile))


2. When calling org-e-publish from a buffer visiting a file outside of 
the base-directory i still get empty images.


3. When calling org-e-pblish from a buffer visiting a file in the 
base-directory the intermediate tex file doesn't even have the 
includegraphics commands.  (I checked this twice, as I didn't believe 
it at first).  Do the my changes in 1. above bork the exporter totally?


Best regards
Robert




Re: [O] Problems with habit sorting

2012-10-08 Thread François Allisson
Le lundi 08 oct 2012 à 15:32:27 (+), Renger van Nieuwkoop a écrit :
 Hi
 I have an agenda-view where I can see all my habits. They have priorities but
 are not sorted.
 Any idea how to sort them according to priority.

Hi Renger,

You should probably customise the variable org-agenda-sorting-strategy,
with the symbol priority-down, i.e. by adding this line to the
definition of your custom agenda-view:

  (org-agenda-sorting-strategy '(priority-down todo-state-up tag-up))

You can then fine-tuning inside priorities, according to your needs
(here, todo-state-up and tag-up for an example). See the docstring for
org-agenda-sorting-strategy:

***
* org-agenda-sorting-strategy is a variable defined in `org-agenda.el'.
* Its value is ((agenda habit-down time-up priority-down category-keep)
*  (todo priority-down category-keep)
*  (tags priority-down category-keep)
*  (search category-keep))
* 
* 
* Documentation:
* Sorting structure for the agenda items of a single day.
* This is a list of symbols which will be used in sequence to determine
* if an entry should be listed before another entry.  The following
* symbols are recognized:
* 
* time-upPut entries with time-of-day indications first, early first
* time-down  Put entries with time-of-day indications first, late first
* category-keep  Keep the default order of categories, corresponding to the
*  sequence in `org-agenda-files'.
* category-upSort alphabetically by category, A-Z.
* category-down  Sort alphabetically by category, Z-A.
* tag-up Sort alphabetically by last tag, A-Z.
* tag-down   Sort alphabetically by last tag, Z-A.
* priority-upSort numerically by priority, high priority last.
* priority-down  Sort numerically by priority, high priority first.
* todo-state-up  Sort by todo state, tasks that are done last.
* todo-state-downSort by todo state, tasks that are done first.
* effort-up  Sort numerically by estimated effort, high effort last.
* effort-downSort numerically by estimated effort, high effort first.
* user-defined-upSort according to `org-agenda-cmp-user-defined', high last.
* user-defined-down  Sort according to `org-agenda-cmp-user-defined', high 
first.
* habit-up   Put entries that are habits first
* habit-down Put entries that are habits last
* alpha-up   Sort headlines alphabetically
* alpha-down Sort headlines alphabetically, reversed
* 
* The different possibilities will be tried in sequence, and testing stops
* if one comparison returns a not-equal.  For example, the default
* '(time-up category-keep priority-down)
* means: Pull out all entries having a specified time of day and sort them,
* in order to make a time schedule for the current day the first thing in the
* agenda listing for the day.  Of the entries without a time indication, keep
* the grouped in categories, don't sort the categories, but keep them in
* the sequence given in `org-agenda-files'.  Within each category sort by
* priority.
* 
* Leaving out `category-keep' would mean that items will be sorted across
* categories by priority.
* 
* Instead of a single list, this can also be a set of list for specific
* contents, with a context symbol in the car of the list, any of
* `agenda', `todo', `tags', `search' for the corresponding agenda views.
* 
* Custom commands can bind this variable in the options section.
* 
* You can customize this variable.
**

HTH,

François.



Re: [O] Publishing using the new exporter

2012-10-08 Thread Nicolas Goaziou
Hello,

Robert Klein klein...@mpip-mainz.mpg.de writes:

 umm, no, it doesn't work. I even have more issues now.

 1. At first, when calling org-e-publish I got an error message void
 function org-e-html-publish-to-html

 I go rid of the message by this patch (which most probably is the
 wrong thing to do):

Just (require 'org-e-html) instead.

 2. When calling org-e-publish from a buffer visiting a file outside of
 the base-directory i still get empty images.

 3. When calling org-e-pblish from a buffer visiting a file in the
 base-directory the intermediate tex file doesn't even have the
 includegraphics commands.  (I checked this twice, as I didn't
 believe it at first).  Do the my changes in 1. above bork the exporter
 totally?

I don't think so, but I cannot reproduce your problem. Could you try
again in a fresh emacs, once back-ends you need have been required?


Thanks,

-- 
Nicolas Goaziou



Re: [O] Problem orgmode, beamer and macport

2012-10-08 Thread cberry
Nick Dokos nicholas.do...@hp.com writes:

 Nick Dokos nicholas.do...@hp.com wrote:

 Steve Prud'Homme sprud...@gmail.com wrote:
 
  
  ! LaTeX Error: File `wrapfig.sty' not found.
  
  Type X to quit or RETURN to proceed,
  or enter new name. (Default extension: sty)
  
  Enter file name:
  ! Emergency stop.
  read *
  
  l.43 \usepackage
      {soul}^^M
  !  == Fatal error occurred, no output PDF file produced!
  Transcript written on /Users/sprudhom/Dropbox/STEVE/Projet/PROJET C2000 
  INFOGR
  APHIE MODULE 3/Ressource/Notes de cours//C3notes.log.
  
 
 What OS are you on?

 NM - I see you are on a Mac.  Maybe a Mac user can help
 with the proper instructions here.

He is using macports I think. 

so maybe 

   sudo port install texlive-latex-extra

will do it.

Chuck


 Nick








Re: [O] Publishing using the new exporter

2012-10-08 Thread Robert Klein

Hallo,

On 10/08/2012 06:49 PM, Nicolas Goaziou wrote:

Hello,

Robert Klein klein...@mpip-mainz.mpg.de writes:


umm, no, it doesn't work. I even have more issues now.

1. At first, when calling org-e-publish I got an error message void
function org-e-html-publish-to-html

I go rid of the message by this patch (which most probably is the
wrong thing to do):


Just (require 'org-e-html) instead.


2. When calling org-e-publish from a buffer visiting a file outside of
the base-directory i still get empty images.

3. When calling org-e-pblish from a buffer visiting a file in the
base-directory the intermediate tex file doesn't even have the
includegraphics commands.  (I checked this twice, as I didn't
believe it at first).  Do the my changes in 1. above bork the exporter
totally?


I don't think so, but I cannot reproduce your problem. Could you try
again in a fresh emacs, once back-ends you need have been required?



I re-installed the git-version of org-mode, required 'org-e-html and 
'org-e-latex and exported from a fresh emacs.  Issue 1 and 3 above are 
gone, but I still get empty images when calling org-e-publish from a 
buffer visiting a file outside the base-directory.


I appended both a minimal .emacs and org file I used for the tests.

Best regards
Robert

(setq load-path (cons ~/.emacs.d/org-mode/lisp load-path))
(require 'org)
(require 'org-e-html)
(require 'org-e-latex)

;; org-babel
(setq org-plantuml-jar-path ~/.emacs.d/plantuml.jar)
(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (python . t)
   (sql . t)
   (sh . t)
   (dot . t)
   (plantuml . t)
   (latex . t)
   (ditaa . t)))

(setq org-e-publish-project-alist nil)
(add-to-list 'org-e-publish-project-alist
 '(example-org
   :base-directory ~/Documents/org/example
   :base-extension org
   :publishing-directory ~/public_html/example.com
   :publishing-function  org-e-html-publish-to-html
   ))
(add-to-list 'org-e-publish-project-alist
 '(example-pdf
   :base-directory ~/Documents/org/example
   :base-extension org
   :publishing-directory ~/puglic_html/example.com
   :publishing-function  org-e-latex-publish-to-pdf
   ))
(add-to-list 'org-e-publish-project-alist
 '(example-extra
   :base-directory ~/Documents/org/example
   :base-extension css\\|pdf\\|png\\|jpg\\|gif\\|ksh\\|sh\\|py
   :publishing-directory ~/public_html/example.com
   :publishing-function org-e-publish-attachment
   :recursive t
   ))
(add-to-list 'org-e-publish-project-alist
 '(example
   :components (example-org example-pdf example-extra)
   ))
# -*- fill-column:75; coding: utf-8-unix; -*-
#+TITLE: example.com

* Introduction
Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor
incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi
consequat. Quis aute iure reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

* plantuml diagram
#+begin_src plantuml :file example.png :exports results
@startuml
title Todo for something

(*) -- Count slowly to ten
-- Count slowly backwards to zero
-- Relax
-- (*)
#+end_src


Re: [O] Publishing using the new exporter

2012-10-08 Thread Suvayu Ali
On Mon, Oct 08, 2012 at 07:36:43PM +0200, Robert Klein wrote:

[...]

 
 I appended both a minimal .emacs and org file I used for the tests.
 

[...]

 (add-to-list 'org-e-publish-project-alist
'(example-pdf
  :base-directory ~/Documents/org/example
  :base-extension org
  :publishing-directory ~/puglic_html/example.com
  :publishing-function  org-e-latex-publish-to-pdf
  ))

Is the typo above (puglic - public) present in the original test file?

-- 
Suvayu

Open source is the future. It sets us free.



[O] upgraded emacs, now org-mode is broken in os x lion terminal

2012-10-08 Thread Harumph Frog
Hello!

I upgraded my emacs recently to 24.2 cocoa using homebrew, and now org-mode
is pretty much useless in the terminal. The problem is more irritating than
it would be if it didn't work at all, which would give me a clue as to how
to fix it. When I'm editing a list (using the asterisk), and contract or
expand the elements of the list (using tab), all kinds of weirdness occurs.
Some list items will suddenly duplicate. Some list items will disappear
completely. Items will be pushed way down the page, and then jump back up.
This is all happening as I'm pushing nothing but tab.

I've uninstalled, reinstalled emacs using brew. I installed the latest
version of org-mode (and confirmed that emacs was using it) without any
change, so I switched back to the version that came with the latest release
of emacs. I've done a lot of googling but can't find anyone who has had
this problem with org-mode. Anyone have any ideas?

Mac OS X Lion 10.7.5 Emacs 24.2 org-version 7.8.11


Re: [O] upgraded emacs, now org-mode is broken in os x lion terminal

2012-10-08 Thread Nicolas Goaziou
Hello,

Harumph Frog harumph.f...@gmail.com writes:

 I upgraded my emacs recently to 24.2 cocoa using homebrew, and now org-mode
 is pretty much useless in the terminal. The problem is more irritating than
 it would be if it didn't work at all, which would give me a clue as to how
 to fix it. When I'm editing a list (using the asterisk), and contract or
 expand the elements of the list (using tab), all kinds of weirdness occurs.
 Some list items will suddenly duplicate. Some list items will disappear
 completely. Items will be pushed way down the page, and then jump back up.
 This is all happening as I'm pushing nothing but tab.

Did you try with emacs -Q? If so, is the result the same?

 I've uninstalled, reinstalled emacs using brew. I installed the latest
 version of org-mode (and confirmed that emacs was using it) without any
 change, so I switched back to the version that came with the latest release
 of emacs. I've done a lot of googling but can't find anyone who has had
 this problem with org-mode. Anyone have any ideas?

 Mac OS X Lion 10.7.5 Emacs 24.2 org-version 7.8.11

Regards,

-- 
Nicolas Goaziou



[O] Show more text in Follow mode or Tabbing after search?

2012-10-08 Thread Nathan Neff
Currently, I do an Agenda search, then I get a list of result headlines back.

I know there's a Show Context feature but this is rather noisy.

I like the Follow mode feature, but is there a way to show more context around
the text that's shown in the Follow mode?

For example, I have window 1 and window 2 after doing a search

Search baz
 Search Results
* foo --cursor here
* bar
* baz
 Window Opened in F ollow mode or pressing Tab
-
* foo
* bar
* baz

Is there a way to show more context in the search results? Possibly
highlighting the
search term?  I know I can press Tab, then press Tab again to open the
headline that was found, but this is many keypresses just to try to
find the text that you searched
for in the first place.

Thanks,
--Nate



Re: [O] Agenda priority setting bad feature

2012-10-08 Thread Michael Brand
Hi Bastien

On Fri, Sep 28, 2012 at 8:32 AM, Bastien b...@altern.org wrote:
 You can now use both `,' and `C-c ,' in agenda to set the priority.

 You can also use `C-u ,' and `C-u C-c ,' to see the see the priority.
 Note that the priority displayed is a number, not the priority cookie.
 Also this number for the same headline will differ in agendas and in
 Org buffers, as the priority is dynamically computed in agenda.

 There is also a new speedy command , to set the priority when point
 is at the beginning of a headline.

With the related commit release_7.9.1-93-ge8b45bb the agenda view
priority of all entries in the agenda view becomes -1000. Before, most
of all the scheduled and deadline were different for different target
dates.

Only as an idea for an improvement at the same time: Instead of, or
additional to showing the agenda view priority of just the current
entry in the minibuffer it could be helpful to toggle preceding each
agenda view line with the agenda view priority for understanding
purposes. Similar to C-c } (org-table-toggle-coordinate-overlays) on a
table.

Michael



Re: [O] Tangle only current code block?

2012-10-08 Thread Bill White
On Sun Oct 07 2012 at 18:39, Eric Schulte eric.schu...@gmx.com wrote:

 Yann Le Du yann.ledu...@gmail.com writes:

 Hi,

 I have a bunch of code chunks with stuff like fun name and headers like
 :tangle toto.c exporting to different files in noweb style

 If I use C-c C-v t, it extracts all of those code chunks nicely

 However, sometimes I would like to put my cursor inside one of those code
 chunks and then extract only that one, not the others.

 Is there a simple way ?


 Yes, run the tangle with a prefix argument to tangle only the block
 under your cursor e.g., C-u C-c C-v t.

And you can tangle a consecutive subset of code blocks by narrowing your
org buffer to only those blocks before tangling.  It happens to me so
often I wrote a bit of code to avoid it.  From my emacs.org:

#+begin_src emacs-lisp :tangle yes
(defadvice org-babel-tangle (before widen-before-tangling)
  Widen a buffer before calling org-babel-tangle.
  (widen))

(ad-activate 'org-babel-tangle)
#+end_src

Cheers -

bw
-- 
Bill White . bi...@wolfram.com
No ma'am, we're musicians.




Re: [O] C-c ^ for plain lists? Why not?

2012-10-08 Thread James Harkins
On Oct 9, 2012 2:29 AM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 There are four states: checked box, unchecked box, transitory box and no
 box at all. I can't see an order that should be prevalent over others.

Fair enough, thanks. I'll check the org manual later to see if the format
of the function is documented anywhere. (I might have time to try my hand
at the function, but I wouldn't have time to guess the expected output and
inputs.)

hjh


Re: [O] Tangle only current code block?

2012-10-08 Thread Eric Schulte
Yann Le Du yann.ledu...@gmail.com writes:

 On Mon, Oct 8, 2012 at 1:39 AM, Eric Schulte eric.schu...@gmx.com wrote:

 Yann Le Du yann.ledu...@gmail.com writes:

  Hi,
 
  I have a bunch of code chunks with stuff like fun name and headers
 like
  :tangle toto.c exporting to different files in noweb style
 
  If I use C-c C-v t, it extracts all of those code chunks nicely
 
  However, sometimes I would like to put my cursor inside one of those code
  chunks and then extract only that one, not the others.
 
  Is there a simple way ?
 

 Yes, run the tangle with a prefix argument to tangle only the block
 under your cursor e.g., C-u C-c C-v t.


 Very nice! Is that documented? It's not in
 http://orgmode.org/manual/Extracting-source-code.html


This is now mentioned in the documentation.  Cheers,



 Best,

 
  I narly found a solution, but to make it work nicely I need to put
  org-babel-tangle inside a macro, but it fails: if I define a macro :
 
  C-x (
  M-x org-babel-tangle
  C-x )
  C-x e
 
  it fails, saying wrong type argument stringp, nul
 
  I'm lost.
 
  Yann

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


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



Re: [O] [babel] howto debug #+call lines

2012-10-08 Thread Eric Schulte
Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Hi Eric,


 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Hi Eric,

 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Hi all,

 I am getting different results from the evaluation of a source block and
 the evaluation of a #+call line to that block.

 Therefore, my question: Is there an equivalent to
 org-babel-expand-src-block (C-c C-v v) for #+call lines?

 Or more general:  How do I debug #+call lines?

 Regards,
 Andreas


 Can you provide a minimal example?

 You could write a code block equivalent to the call line.  E.g.,

 #+call: foo(bar=1)

 is equivalent to

 #+begin_src emacs-lisp :var results=foo(bar=1)
   results
 #+end_src

 Thanks for following this up.  I found the problem in my case:  The
 header argument ':colnames yes' was missing from the call line, such that
 the passed variables were different.  (I've fallen into that trap
 repeatedly, but do not learn, as it seems...)

 It would have been a lot easier to find this, if I had had the possibility
 to do C-c C-v v on the call line to get the chance to step through the
 (R-) code that is evaluated.  Without this, it took me some time to
 figure things out.

 So the question still stands: Is there the possibility to see what is
 actually executed with a call line, similar to C-c C-v v on a source
 block?


 There is no body to expand in a call line so C-c C-v v would have
 nothing to show.  You can however jump to the related code block and
 call C-c C-v v there.  This process could be made faster by wrapping the
 org-babel-goto-named-src-block and org-babel-expand-src-block functions
 into a single function.



 For a small example consider:

 ---
 #+name: foo
 | bar |
 | baz |
 | bam |

 #+call: testblock[:var a=foo]() :colnames yes

 #+name: testblock
 #+begin_src R :var a=foo :colnames yes
   a - a[,1]
   data.frame(x=a)
 #+end_src
 ---

 Regards,
 Andreas



 Thanks for the confirmation, that there is no possibility to expand a
 #+call line.

 I know, that I can jump to the code block and expand that one (quite
 fast with C-c C-v g RET C-c C-v v), but that is exactly *not* what I was
 looking for.  Because then, the header arguments to the source code
 block will apply instead of the header arguments to the #+call line.

 I was hoping for a C-c C-v v on #+call lines, which would spare me from
 modifying the source block's header arguments.  But it is not a pressing
 issue, just my laziness (and bad coding perhaps).


Patches are always welcome. :)

The call line is evaluated by first expanding itself into a full code
block, so perhaps you could add functionality to C-c C-v v so that it
will expand this ephemeral code block.  Additionally it may be easy to
update C-c C-v I so that it works on call lines, which may provide the
information you're after.

Best,


 Regards,
 Andreas




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



[O] Setting tangle defaults for a file?

2012-10-08 Thread Avdi Grimm
When I try to set tangling defaults for an org file, like so:

#+BABEL: :tangle yes :comments org

...it has no effect. Any particular reason for this?


Re: [O] Setting tangle defaults for a file?

2012-10-08 Thread Nick Dokos
Avdi Grimm gro...@inbox.avdi.org wrote:

 When I try to set tangling defaults for an org file, like so:
 
 #+BABEL: :tangle yes :comments org
 
 ...it has no effect. Any particular reason for this?
 
 

#+BABEL: has been deprecated for a while. See

   (info (org) Header arguments in Org mode properties)

NB. No colons before the property name.

Nick



Re: [O] Publishing using the new exporter

2012-10-08 Thread Robert Klein

On 10/08/2012 07:46 PM, Suvayu Ali wrote:

On Mon, Oct 08, 2012 at 07:36:43PM +0200, Robert Klein wrote:

[...]



I appended both a minimal .emacs and org file I used for the tests.



[...]


(add-to-list 'org-e-publish-project-alist
 '(example-pdf
   :base-directory ~/Documents/org/example
   :base-extension org
   :publishing-directory ~/puglic_html/example.com
   :publishing-function  org-e-latex-publish-to-pdf
   ))


Is the typo above (puglic - public) present in the original test file?



Currently this /is/ my original test file. Yes, the typpo is present, 
but it doesn't change the results.  I just get two sets of pdfs, one 
from the example-latex project in puplic_html and one from the 
example-extra project via org-e-publish-attachment in public_html...


I know about it and used it to watch both directories during publishing 
yesterday.  Just forgot to change it :(


Thanks for catching it.

Best regards
Robert