Re: [O] Variable in file name for babel output?

2013-06-28 Thread Loris Bennett
Hi Andreas,

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

 Hi Loris,

 Loris Bennett loris.benn...@fu-berlin.de writes:

 Hi,

 Is it possible to pass a variable to a source block such that the
 variable can be used as part of the name of the output file?

 Currently I have

 #+HEADER: :var data=timelimit-elapsed-data year=2011 :colnames yes
 #+HEADER: :session *r* :file (org-babel-temp-file time-elapsed- .pdf)

 which gets me a different name for each value of 'year', but ideally I
 would like the files to be called

 time-elapsed-2011.pdf
 time-elapsed-2012.pdf
 time-elapsed-2013.pdf

 etc.

 Can this be done? 


 Maybe not what you are looking for, but you could handle the assembly of
 the filename within your code block.

 Something like:

 #+HEADER: :var year=2011 :session *r* :results file
 #+begin_src R
   filename - paste0(time-elapsed-, year, .pdf)
   
   pdf(filename)
 ## your code
   dev.off()
   
   filename
 #+end_src

 Regards,
 Andreas

Thanks, that is in fact exactly what I need.  Looking at the
documentation again, I see that it says:

Some languages including R, gnuplot, dot, and ditaa provide special
handling of the :file header argument automatically wrapping the code
block body in the boilerplate code required to save output to the
specified file. This is often useful for saving graphical output of a
code block to the specified file.

I just didn't understand this at first.  Maybe the following sentence
should/could be added:

... the specified file.  This means that the argument of the :file
header can be omitted and the file name can be generated within the
source block.

Cheers,

Loris

-- 
This signature is currently under construction.




Re: [O] [PATCH] Add a flat clocktable formatter useful for tables whose CSV export can be imported into accounting/invoiving tools such as Zoho Invoicing.

2013-06-28 Thread Bastien
Hi Ross,

thanks for the patch.  Do you mind filling the copyright
assignment so we can accept the patch ?

  http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt

Also, please have a look at this page with guidance on how
to submit a patch with a ChangeLog etc.

  http://orgmode.org/worg/org-contribute.html#sec-4-2

Thanks again,

-- 
 Bastien



Re: [O] [RFC] Replace some HTML related keywords with OPTIONS items

2013-06-28 Thread Bastien
Hi Nicolas,

Nicolas Goaziou n.goaz...@gmail.com writes:

 I tend to think it's more a developer information. By looking at the
 manual, there's no confusion possible for a user.

A footnote would not hurt, if only as a way to answer future
questions?

 Maybe it should go in `org-export-options-alist' docstring instead.

Indeed.

-- 
 Bastien



Re: [O] bug with LaTeX exporter

2013-06-28 Thread Dennis van Dok
On 28-06-13 04:26, Nick Dokos wrote:
 Rasmus ras...@gmx.us writes:
 
 The old latex exporter was much more finicky about such structure
 violations: I tried 7.7 (and 7.9.4 to see if it was ever changed) and it
 does indeed eat the subsubsection.
 
 To solve your problem: 
  1. see if it works as expected with emacs -q.
  2. upgrade to the current release.

 
 2. is the only option.

I'm going to upgrade now. Thanks for the quick responses!

 
 Thanks for making such an awesome product,

 Org ain't a commodity.

 
 Indeed: it's a state of mind :-)

Thanks for making such an awesome state of mind!

;-)

Dennis




[O] How do I create an agenda block for entries with a specific tag?

2013-06-28 Thread Alan Schmitt
Hello,

I'm trying to find a way to create an agenda bloc (of type agenda) that
is restricted to a set of tags. I tried using a skip function but (as I
explained in another mail) I cannot get it to work. If someone has done
it before, I'd gladly have a look at how to do it.

Thanks,

Alan



Re: [O] How do I create an agenda block for entries with a specific tag?

2013-06-28 Thread Noorul Islam K M
Alan Schmitt alan.schm...@polytechnique.org writes:

 Hello,

 I'm trying to find a way to create an agenda bloc (of type agenda) that
 is restricted to a set of tags. I tried using a skip function but (as I
 explained in another mail) I cannot get it to work. If someone has done
 it before, I'd gladly have a look at how to do it.



From the classic document http://doc.norang.ca/org-mode.html

(r Tasks to Refile tags REFILE
   ((org-agenda-overriding-header Tasks to Refile)
(org-tags-match-list-sublevels nil)))

Is this what you are looking for?

Thanks and Regards
Noorul



Re: [O] How do I create an agenda block for entries with a specific tag?

2013-06-28 Thread Alan Schmitt
Hi Noorul,

noo...@noorul.com writes:

 Alan Schmitt alan.schm...@polytechnique.org writes:

 Hello,

 I'm trying to find a way to create an agenda bloc (of type agenda) that
 is restricted to a set of tags. I tried using a skip function but (as I
 explained in another mail) I cannot get it to work. If someone has done
 it before, I'd gladly have a look at how to do it.



 From the classic document http://doc.norang.ca/org-mode.html

 (r Tasks to Refile tags REFILE
((org-agenda-overriding-header Tasks to Refile)
 (org-tags-match-list-sublevels nil)))

 Is this what you are looking for?

Unfortunately this is a tags block. What I'm looking for is the same
thing, but for an agenda block.

Thanks,

Alan



Re: [O] how to change appearance of org-mode files on Github?

2013-06-28 Thread Karl Voit
* Peter Salazar cycleofs...@gmail.com wrote:

 Github supports org-mode files, and has a renderer that parses .org files
 and converts them to HTML form. Headings appear in larger font, org tables
 are converted to graphical HTML tables, etc.

If you want to know, what features are supported by github, take a
look at [1] where I summarized, what works and what not.

  1. https://github.com/novoid/github-orgmode-tests
-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
get Memacs from https://github.com/novoid/Memacs 

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] Process diagrams with dot and some glue using Org-mode

2013-06-28 Thread Karl Voit
* Rick Frankel r...@rickster.com wrote:

 And here's a simplier version which uses a graph table in the
 following format:
[...]

I tried to use your solution with the #+call: method.

Unfortunately, it fails and due to my limited ELISP knowledge, I can
not debug this issue. I've got the feeling that you might be able to
spot my error right away. 

I should add, that this is my first usage of call:. So there might
be a misunderstanding on my side on how to use it properly:

#+name: graph-from-table
#+HEADER: :var nodes=foobar-node-table graph=foobar-graph
#+BEGIN_SRC emacs-lisp :file ~/tmp/2del/foovar-example-simple.png :colnames yes 
:exports results
  (org-babel-execute:dot
   (concat
digraph {\n
(mapconcat
 (lambda (x)
   (format %s [label=\%s\ shape=%s fillcolor=%s]
   (car x) (nth 1 x)
   (if (string=  (nth 2 x)) box (nth 2 x))
   (if (string=  (nth 3 x)) none (nth 3 x nodes 
\n)
\n
(mapconcat
 (lambda (x)
   (format %s - %s [taillabel=\%s\]
   (car x) (nth 1 x) (nth 2 x))) graph \n)
}\n) params)
#+END_SRC

#+name: example-node-table
| *node* | *label*| *shape* | *fillcolor* |
|++-+-|
| S_start| example start  | ellipse | green   |
| S_fill | example fill form  | | |
| S_send | example send form  | | |
| S_complete | example form complete? | diamond | yellow  |
| S_do   | example do task| | red |
| S_end  | example end| ellipse | |

#+name: example-graph
| from   | to | label |
|++---|
| S_start| S_fill |   |
| S_fill | S_send |   |
| S_send | S_complete |   |
| S_complete | S_fill | N |
| S_complete | S_do   | Y |
| S_do   | S_end  |   |

#+call: graph-from-table(nodes=example-node-table,graph=example-graph)

- this results in format: Wrong type argument: listp, hline



Note: I got the following additional parameters in my pipeline (want
to make them work) as well:

 :exports results :resname example-result :file ~/tmp/2del/example-simple.png


-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
get Memacs from https://github.com/novoid/Memacs 

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] Add figure/table numbers to HTML captions

2013-06-28 Thread Nicolas Goaziou
Hello,

Yoshinari Nomura n...@quickhack.net writes:

 Thanks, you encouraged me. Also, while I made this patch, I was in
 the mood for consolidating some exporter-local functions around the
 captions. Especially, ox-odt and ox-ascii seem to have rich functions to
 add ordinal numbers to captions. It might be over-killing, though.

ox-odt caption handling is more complex because it handles more elements
(e.g., links to ODF files). ox-ascii provides the bare minimum wrt
caption numbering. This is what your patch provides.

 I'm afraid I made some misunderstand, but without this hunk,
 Tables/Figures without captions are mistakenly counted as a part of
 numbered staffs. As shown below, Figure[[fig:manual]] makes Figure3
 instead of Figure2.

Of course, you're right. I realized that just after sending the message.
Though, in the following snippet,

  (setq caption-predicate
(if (org-element-property :caption destination)
 (lambda (elem optional info)
   (org-element-property :caption elem))
  (lambda (elem optional info)
   (not (org-element-property :caption elem)

I suggest to drop the else part. If destination hasn't got any
caption, numbering doesn't make much sense anyway. You can re-use
`org-html--has-caption-p'.

 - (es :default Figura))
 + (es :default Figura)
 + (ja :html #22259; :utf-8 図))
 +(Figure %d:
 + (de :default Abbildung %d:)
 + (es :default Figura %d:)
 + (ja :html #22259;%d: :utf-8 図%d:))
 
 Maybe you should also provide a :default value, otherwise it will use
 Figure %d: for latex, texinfo, ascii...

 Let me confirm, do you mean I should have add :default value to the ``ja''
 entry like: (ja :default 図 :html #22259; :utf-8 図)? In this
 case, is the `:utf-8' meaning-less? Also, can I put UTF-8 word in
 `:default'?

:utf-8 will be used for ODT export and UTF-8 export. LaTeX export will
try to use, in this order, :latex, :default and Figure %d:. Plain
ASCII will use, in this order, :ascii, :default and Figure %d:.

I suggest to use a simple entry for :default, maybe romanji, if it makes
sense. You can also use UTF-8 encoding as :default, and provide some
meaningful translation for :ascii.

 I'll revise my patch in this weekend. thanks.

Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] Help with beamer environments + org-special-blocks!

2013-06-28 Thread Sebastien Vauban
Hello Nicolas,

Nicolas Goaziou wrote:
 What do you call a recent Org?  I'm blocked on commit 26a9b02, from May 27th,
 as long as the #+SETUPFILE: bug is not fixed (fontification is broken).

 So, is that one (4 weeks old) a recent Org?

 No. I fixed it ten days ago (dffdc49).

Though I'm now on Org-mode version 8.0.3 (release_8.0.3-295-g91a4c8), pulled
this morning, I don't see it fixed.

Here an ECM:

--8---cut here---start-8---
#+TITLE: ECM Arguments for environments
#+Time-stamp: 2013-06-28 Fri 11:42

* Tables

** Via Options attribute -- OK

#+TBLNAME: table1
#+ATTR_LaTeX: :options {-2.5cm}{0cm}
#+begin_mychangemargin
| a | very | very | ... | very | wide | table |
#+end_mychangemargin

** On the environment opening, with no space -- Invalid LaTeX

#+TBLNAME: table2
#+begin_mychangemargin{-2.5cm}{0cm}
| a | very | very | ... | very | wide | table |
#+end_mychangemargin

** On the environment opening, with a space separator -- Argument ignored

#+TBLNAME: table3
#+begin_mychangemargin {-2.5cm}{0cm}
| a | very | very | ... | very | wide | table |
#+end_mychangemargin
--8---cut here---end---8---

The resulting LaTeX:

--8---cut here---start-8---
% ...
\section{Tables}
\label{sec-1}

\subsection{Via Options attribute -- OK}
\label{sec-1-1}

\begin{mychangemargin}{-2.5cm}{0cm}
\label{table1}
\begin{center}
\begin{tabular}{lll}
a  very  very  \ldots{}  very  wide  table\\
\end{tabular}
\end{center}
\end{mychangemargin}
\subsection{On the environment opening, with no space -- Invalid \LaTeX{}}
\label{sec-1-2}

\#+begin\_mychangemargin\{-2.5cm\}\{0cm\}
\begin{center}
\begin{tabular}{lll}
a  very  very  \ldots{}  very  wide  table\\
\end{tabular}
\end{center}
\#+end\_mychangemargin
\subsection{On the environment opening, with a space separator -- Argument 
ignored}
\label{sec-1-3}

\begin{mychangemargin}
\label{table3}
\begin{center}
\begin{tabular}{lll}
a  very  very  \ldots{}  very  wide  table\\
\end{tabular}
\end{center}
\end{mychangemargin}
% Emacs 24.3.50.1 (Org mode 8.0.3)
\end{document}
--8---cut here---end---8---

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Elpa twice in load-path

2013-06-28 Thread Rene
Bastien bzg at gnu.org writes:

  The way elpa works, it automatically adds packages to `load-path'.  There is
  therefore no need to have such a line
 
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
 
  in the `package-autoloads.el file.
 
 Where is this file?

Line 4 of `org-autoloads.el in org/elpa package.

--
Rene






Re: [O] Elpa twice in load-path

2013-06-28 Thread Achim Gratz
Rene writes:
  The way elpa works, it automatically adds packages to `load-path'.  There 
  is
  therefore no need to have such a line
 
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
 
  in the `package-autoloads.el file.
 
 Where is this file?

 Line 4 of `org-autoloads.el in org/elpa package.

Since this file is created by package manager this is probably how it
adds Org to the load path, don't you think?


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] default face org-column

2013-06-28 Thread Carsten Dominik
Hi Xiao-Yong,

I have applied this patch, thank you.

- Carsten

On 28.6.2013, at 06:55, Xiao-Yong Jin jinxiaoy...@gmail.com wrote:

 On Jun 1, 2013, at 3:17 PM, Carsten Dominik carsten.domi...@gmail.com wrote:
 
 Hi Xiao,
 
 I remember that I struggled with the problem that I had to make sure that 
 column view used a fixed-width face - and this was the solution that worked 
 - not a particular pretty one, admittedly.
 
 Do you have an idea on how to change this code that it will always work?  
 I'd be very happy to accept a good patch.
 
 - Carsten
 
 Hi Carsten,
 
 I wasn't sure what you were talking about until I tried out the theme, 
 leuven... and that was really fanciful and totally screwed the column-view 
 without your fixed-width face fix.
 
 In order to make it more flexible, instead of just set it once when 
 org-faces.el is loaded, I think enforcing it every time when column-view is 
 called is a better choice.  Thus came the following little patch.
 
 diff --git a/lisp/org-colview.el b/lisp/org-colview.el
 index a98deec..f3b8e42 100644
 --- a/lisp/org-colview.el
 +++ b/lisp/org-colview.el
 @@ -169,8 +169,10 @@ This is the compiled version of the format.)
 (get-text-property (point-at-bol) 'face))
'default))
  (color (list :foreground (face-attribute ref-face :foreground)))
 -(face (list color 'org-column ref-face))
 -(face1 (list color 'org-agenda-column-dateline ref-face))
 +(font (list :height (face-attribute 'default :height)
 +:family (face-attribute 'default :family)))
 +(face (list color font 'org-column ref-face))
 +(face1 (list color font 'org-agenda-column-dateline ref-face))
  (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
  pom property ass width f string ov column val modval s2 title calc)
  ;; Check if the entry is in another buffer.
 diff --git a/lisp/org-faces.el b/lisp/org-faces.el
 index 5472964..e968657 100644
 --- a/lisp/org-faces.el
 +++ b/lisp/org-faces.el
 @@ -217,12 +217,6 @@ column view defines special faces for each outline 
 level.  See the file
Face for column display of entry properties.
:group 'org-faces)
  
 -(when (fboundp 'set-face-attribute)
 -  ;; Make sure that a fixed-width face is used when we have a column table.
 -  (set-face-attribute 'org-column nil
 - :height (face-attribute 'default :height)
 - :family (face-attribute 'default :family)))
 -
  (defface org-agenda-column-dateline
(org-compatible-face 'org-column
  '((t nil)))
 
 In this way, the column-view face will not be bound only to the font family 
 and size at the time of loading org-faces.el, but anytime column-view is 
 called.  I'm not sure if I covered all the cases, but it seems to work well 
 for me.  I hope the patch is not broken by the mail app, but I guess it is 
 simple enough to read it in one sip of coffee, though I tracked the issue and 
 wrote the patch with one cup.
 
 Best,
 Xiao-Yong
 
 PS. I realized it was almost a month-old email.  Org-mode is really good at 
 remembering it for me.



Re: [O] Right-to-left text in org mode

2013-06-28 Thread Dov Grobgeld
You are right, I forgot about that. I also have (setq
bidi-paragraph-direction nil) in my org-mode-hook.

Regadrs,
Dov


On Wed, Jun 26, 2013 at 4:49 AM, Manuel GJT valh...@gmail.com wrote:
 It turns out that org mode does force directionality in its buffers. I found
 in org.el the line

 5308  (setq bidi-paragraph-direction 'left-to-right)

 However, bidi-paragraph-direction is always buffer local when set. That
 explains why switching to other mode does not help.

 The solution is to set bidi-paragraph-direction to nil in org buffers with
 mixed LTR and RTL texts. This, however, might change the alignment of some
 headings to right-aligned. But the bidi markers now work just fine, so it's
 just a matter of placing them wisely.

 I appreciate the time you took for this little discussion. It helped me get
 a clearer picture of the inner workings of bidi and emacs.


 Kind regards,

 Manuel GJT


 On Tue, Jun 25, 2013 at 2:03 AM, Dov Grobgeld dov.grobg...@gmail.com
 wrote:

 A work around seems to be to provide an empty line between the LTR and
 the RTL paragraph. I.e. instead of

 * this is ltr
 * THIS IS RTL

 do:

 * this is ltr

 * THIS IS RTL

 But you are correct that the wrapping of LTR paragraphs with RTL text
 is buggy. This bug seems to have nothing to do with org mode, but
 happens e.g. in text mode and fundamental mode as well. You should
 raise this issue on the emacs-list or file a bug with emacs.

 On Tue, Jun 25, 2013 at 7:27 AM, Manuel GJT valh...@gmail.com wrote:
  Specifically what additional information should I provide? This happens
  to
  me even without my .emacs loaded. I'm running Ubuntu 12.04 with
  m17n-(db/contrib), libm17n-(0/dev) installed.
 
  It seems that in org mode is forcing LTR in mixed-directionality texts
  since, for example, a heading with RTL text will not change the stars to
  be
  right-aligned, and the cursor's behavior in org mode is different than
  in a
  clean buffer.
 
  Perhaps you could show me how to ignore any previous paragraph settings
  other than with R-T-L MARK?
 
 
  Kind regards,
 
  Manuel GJT
 
 
  On Mon, Jun 24, 2013 at 12:49 PM, Dov Grobgeld dov.grobg...@gmail.com
  wrote:
 
  I was able to reproduce this behavior only with by forcing the
  paragraph direction to LTR or equivilantly by having a first strong
  LTR character in the beginning of the paragraph. Please provide more
  information about your environment, and someone might be able to help
  you.
 
  Regards,
  Dov
 
 
  On Mon, Jun 24, 2013 at 8:22 PM, Manuel GJT valh...@gmail.com wrote:
   Hello everyone,
  
   I need to work in an org buffer with both left-to-right and
   right-to-left
   text. Although the character directionality and composition works
   fine,
   when
   writing paragraphs with visual-line-mode on the lines get inverted,
   i.e.,
   the line
  
   ZYX CBA
  
   appears as
  
   ZYX
   CBA
  
   instead of
  
   CBA
   ZYX
  
   The section 22.20 Bidirectional Editing of the Emacs manual
   suggests
   forcing the directionality of the paragraph with RIGHT-TO-LEFT MARK,
   but
   this does not seem to work: even with such a character beginning the
   line,
   (current-bidi-paragraph-direction) returns left-to-right.
  
   The RTL MARK seems to work just fine in tables.
  
   When written in a clean text-mode buffer the same text appears with
   proper
   directionality. However switching from org-mode to text-mode does not
   correct directionality in said paragraphs. The issue persists even
   when
   visiting the file with emacs -Q.
  
   org-version 8.0.3, same issue with v. 7.9.4
  
   Your help is much appreciated.
  
   --
   Manuel GJT
 
 
 
 
  --
  Manuel GJT




 --
 Manuel GJT



Re: [O] Add figure/table numbers to HTML captions

2013-06-28 Thread Yoshinari Nomura
Hi Nicolas,

On Fri, 28 Jun 2013 11:23:41 +0200,
Nicolas Goaziou n.goaz...@gmail.com said:

   (setq caption-predicate
 (if (org-element-property :caption destination)
(lambda (elem optional info)
  (org-element-property :caption elem))
   (lambda (elem optional info)
(not (org-element-property :caption elem)
 
 I suggest to drop the else part. If destination hasn't got any
 caption, numbering doesn't make much sense anyway. You can re-use
 `org-html--has-caption-p'.

Ah, you are right. I was a little bit paranoia. My intention was: if a
destination of link hasn't got any destination, the link should express
the *nth* non-caption figure.

 Let me confirm, do you mean I should have add :default value to the ``ja''
 entry like: (ja :default 図 :html #22259; :utf-8 図)? In this
 case, is the `:utf-8' meaning-less? Also, can I put UTF-8 word in
 `:default'?
 
 :utf-8 will be used for ODT export and UTF-8 export. LaTeX export will
 try to use, in this order, :latex, :default and Figure %d:. Plain
 ASCII will use, in this order, :ascii, :default and Figure %d:.
 
 I suggest to use a simple entry for :default, maybe romanji, if it makes
 sense. You can also use UTF-8 encoding as :default, and provide some
 meaningful translation for :ascii.

Thanks for your clear explanation. For many Japanese, :default value
should be Figure: %d:, even though we are not good at English :)
I want this left blank.

Regards,
--
Yoshinari Nomura
https://github.com/yoshinari-nomura



Re: [O] Elpa twice in load-path

2013-06-28 Thread Rene
Achim Gratz Stromeko at nexgo.de writes:

  Line 4 of `org-autoloads.el in org/elpa package.
 
 Since this file is created by package manager this is probably how it
 adds Org to the load path, don't you think?

What I notice is that for elpa packages that don't hold such a line in their
`package-autoloads.el', the package path only appears once in `load-path',
which is the right behavior.

--
Rene






Re: [O] Relation between todo-mode.el and Org-mode?

2013-06-28 Thread Stephen Berman
On Thu, 27 Jun 2013 17:32:17 +0200 Bastien b...@gnu.org wrote:

 Just one question: do you get feedback from todo-mode.el users?
 Do you know if there are some/many out there?  Just curious to
 see other's people use.

Since I became the maintainer more than four years ago there haven't
been any bug reports or feature requests, and there were few prior to
that.  The ones there were, years before, were what got me interested in
Todo mode in the first place.  I don't know of any users of the old
version.  I think it had a nice UI but limited functionality, so I'd
guess most people who want to manage todo lists in Emacs already use Org
mode.  I guess I'm an exception, because I had already started adding
functionality to Todo mode before Org mode existed and that kept me
sticking with it.

Steve Berman



Re: [O] Process diagrams with dot and some glue using Org-mode

2013-06-28 Thread Rick Frankel

On 2013-06-28 05:20, Karl Voit wrote:

* Rick Frankel r...@rickster.com wrote:

And here's a simplier version which uses a graph table in the
following format:
[...]

I tried to use your solution with the #+call: method.

Unfortunately, it fails and due to my limited ELISP knowledge, I can
not debug this issue. I've got the feeling that you might be able to
spot my error right away.

#+call: graph-from-table(nodes=example-node-table,graph=example-graph)

- this results in format: Wrong type argument: listp, hline


This is because of what seems to be a bug in babel -- :colnames
options are not being respected in/for call lines. You always get the
above error when trying to process a table in elisp and the header is
not removed.

The solution is to specify the range on the call:

#+call: 
graph-from-table(nodes=example-node-table[2:-1],graph=example-graph[2:-1])



 Note: I got the following additional parameters in my pipeline (want
to make them work) as well:

:exports results :resname example-result :file 
~/tmp/2del/example-simple.png


You will also need to specify results :file; and the filename as a
parameter to the called block not the call. `Call's always export the
results i believe (you can add :exports results to the orginal source 
block).


#+call: graph-from-file[:file out.png](...) :results file

I don't think there is a :resname option. There was a #+RESNAME:
keyword, but it has been replaced w/ #+NAME:, which is currently not
functional for call lines (but is a hot topic in another thread on the
list.)

rick





Re: [O] Hide empty custom agenda sections

2013-06-28 Thread Ken Mankoff
So I tried adding a (nil) in the custom agenda section. If this were
allowed (presumably ignored), I could write a function that returns nil
unless there were items tagged REFILE, in which case it would return

  (tags REFILE ((org-agenda-overriding-header REFILE)))

But having (nil) caused an error. I guess I could make the entire My
Custom Agenda section be the output of a function, but that seems overly
complex.

  -k.


On Thu, Jun 27, 2013 at 11:18 AM, Ken Mankoff mank...@gmail.com wrote:

 Hi Bastien,

 Here is my custom agenda section. I'd like to have the DEADLINE and the
 REFILE only show up if items exist in those sections, not when they are
 empty. Actually, I guess I'd like this for all sections.

 (setq org-agenda-custom-commands
   '((c My Custom Agenda
  (
   (tags REFILE ((org-agenda-overriding-header REFILE)))
   (tags-todo +DEADLINE=\+3d\
  (
   (org-agenda-overriding-header Deadline = 3 Days)
   ))
   (tags-todo +SCHEDULED\tomorrow\
  (
   (org-agenda-overriding-header Scheduled Today)
   ))
   (todo INPROGRESS ((org-agenda-overriding-header In
 Progress)))
   (todo WAITING|VERIFY ((org-agenda-overriding-header Waiting
 or Verify)))
   (agenda  (
   (org-agenda-overriding-header Scheduled)
   (org-deadline-warning-days 0)
   ))
   (todo SOMEDAY ((org-agenda-overriding-header Someday)))
   (tags REFILE ((org-agenda-overriding-header REFILE)))
   ) nil (org.txt org.html org.ics



 On Thu, Jun 27, 2013 at 10:44 AM, Bastien b...@gnu.org wrote:

 Hi Ken,

 Ken Mankoff mank...@gmail.com writes:

  Right now I have this at the bottom of my custom agenda, and it is
  therefore often off-screen. I would like to have it at the top, but
  only appear when there are items under this section. Most of the time
  it is there and three lines are wasting space (header separator 
  =, header REFILE, and a blank line).

 So you are using agenda blocks, right?

 Please post the skeleton of your custom agendas so that we can better
 understand.

 Thanks,

 --
  Bastien





[O] Bug: Export is crashing [8.0.3 (release_8.0.3-295-g91a4c8.dirty @ ~/org-mode-8/lisp/)]

2013-06-28 Thread Rustom Mody
export as html is crashing with this (from *Messages* buffer)

org-export-preprocess-string: Wrong number of arguments: (then all sorts of
unprintable chars)


---
(setq
 org-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tab-first-hook '(org-hide-block-toggle-maybe
  org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-mode-hook '(#[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook org-show-block-all
append local]
   5]
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook
org-babel-show-result-all append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
  org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-occur-hook '(org-first-headline-recenter)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 )


Re: [O] Bug: Export is crashing [8.0.3 (release_8.0.3-295-g91a4c8.dirty @ ~/org-mode-8/lisp/)]

2013-06-28 Thread Rustom Mody
On Fri, Jun 28, 2013 at 10:42 PM, Rustom Mody rustompm...@gmail.com wrote:

 export as html is crashing with this (from *Messages* buffer)

 org-export-preprocess-string: Wrong number of arguments: (then all sorts
 of unprintable chars)



I should have added this information

The file I am exporting is just these 2 lines:

--
* head
some text
--

I am starting emacs with -Q, then just doing this
(add-to-list 'load-path (expand-file-name ~/pdsw/org-mode-8/lisp))

then exporting


[O] [BUG] :colnames not applied to #+call input

2013-06-28 Thread Rick Frankel
it seems that the :colnames header is not being respected on parsing the 
input
to a `#+call:' line containing arguments, but is being applied to the 
output!


For example:

#+BEGIN_SRC org
* Identity
#+name: table
| a | b | c |
|---+---+---|
| 1 | 2 | 3 |

#+name: identity
#+BEGIN_SRC emacs-lisp :var table=table :colnames yes
(mapcar 'identity table)
#+END_SRC

#+RESULTS: identity
| a | b | c |
|---+---+---|
| 1 | 2 | 3 |


#+call: identity()

#+RESULTS: identity()
| a | b | c |
|---+---+---|
| 1 | 2 | 3 |

#+call: identity(table=table)

#+RESULTS: identity(table=table)
| a | b | c |
|---+---+---|
| a | b | c |
|---+---+---|
| 1 | 2 | 3 |

* Mapping
#+name: map
#+BEGIN_SRC emacs-lisp :var table=table :colnames yes
(mapcar (lambda (row) (mapcar 'identity row)) table)
#+END_SRC

#+RESULTS: map
| a | b | c |
|---+---+---|
| 1 | 2 | 3 |

#+call: map()

#+RESULTS: map()
| a | b | c |
|---+---+---|
| 1 | 2 | 3 |

All the following generate the error:

 /Wrong type argument: sequencep, hline/

because the header and hline are not stripped from the input.

#+call: map(table=table)

#+call: map(table=table) :colnames yes

#+call: map[:colnames yes](table=table) :colnames yes

#+END_SRC



Re: [O] Bug: Export is crashing [8.0.3 (release_8.0.3-295-g91a4c8.dirty @ ~/org-mode-8/lisp/)]

2013-06-28 Thread Nick Dokos
Rustom Mody rustompm...@gmail.com writes:

 On Fri, Jun 28, 2013 at 10:42 PM, Rustom Mody rustompm...@gmail.com wrote:

 export as html is crashing with this (from *Messages* buffer)

 org-export-preprocess-string: Wrong number of arguments: (then all sorts 
 of unprintable chars)

 I should have added this information

 The file I am exporting is just these 2 lines:

 --
 * head
 some text
 --

 I am starting emacs with -Q, then just doing this
 (add-to-list 'load-path (expand-file-name ~/pdsw/org-mode-8/lisp))

 then exporting


emacs version? org version? backtrace? 

I cannot reproduce with

GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of
2013-06-17 on pierrot

Org-mode version 8.0.3 (release_8.0.3-293-g911c5d @
/home/nick/elisp/org-mode/lisp/)

or (just pulled)

Org-mode version 8.0.3 (release_8.0.3-295-g91a4c8 @
/home/nick/elisp/org-mode/lisp/)

-- 
Nick




[O] Modifying the Beamer Exporter

2013-06-28 Thread Josiah Schwab
Hi All,

I am just starting to dig into using the new exporter for generating
beamer presentations.

I want to include my collaborators in the header of each org file just
as I would authors, that is by including a line like

#+COLLABORATORS: Alice  Bob

I've found some limited documentation on modifying the exporter (manual
section 12.3) and taken a look at ox.el, ox-latex.el, ox-beamer.el, etc.

What I did was:
  + Create a new backend derived from the beamer one
+ add COLLABORATORS to its options-alist
+ set the template (in translate-alist) to one handling collaborators

This works, but before I continued on making other modifications (in a
similar vein), I wanted to check in with people with a higher level
understanding.

Does this sound like a reasonable approach?

Any suggestions or pointers to existing documentation/examples would be
appreciated.

Thanks,
Josiah



[O] Circular lists/shared structures in org-element parse-tree

2013-06-28 Thread Thorsten Jolitz

Hi List, 

I wonder how I can find out in a (elisp) program the points in the parse
tree (returned by org-element-parse-buffer) where shared structures are
used. 

In the read-syntax, its easy to see (especially with `print-circle' set
to non-nil):

#+begin_src emacs-lisp
  #2=(org-data nil #1=(headline (:raw-value header 1
   [...] :parent #2#) [...]  
#+end_src

but when processing the parse tree as a list in elisp, how can I detect the
fact that 

,
| :parent #2#
`

refers to 

,-
| #2=(org-data nil
`-

i.e. points back to an already existing structure?

-- 
cheers,
Thorsten




Re: [O] Modifying the Beamer Exporter

2013-06-28 Thread Eric S Fraga
Josiah Schwab jsch...@gmail.com writes:

 Hi All,

 I am just starting to dig into using the new exporter for generating
 beamer presentations.

 I want to include my collaborators in the header of each org file just
 as I would authors, that is by including a line like

 #+COLLABORATORS: Alice  Bob

 I've found some limited documentation on modifying the exporter (manual
 section 12.3) and taken a look at ox.el, ox-latex.el, ox-beamer.el, etc.

 What I did was:
   + Create a new backend derived from the beamer one
 + add COLLABORATORS to its options-alist
 + set the template (in translate-alist) to one handling collaborators

 This works, but before I continued on making other modifications (in a
 similar vein), I wanted to check in with people with a higher level
 understanding.

 Does this sound like a reasonable approach?

Maybe, maybe not.  Difficult to say unless you give us a better idea of
what kind of changes you plan on making.

In general, I find it sufficient to add a little bit of LaTeX code to my
org files for most customisations or beamer specific commands.  The
great thing about org is that it is easy to write LaTeX directly when
you need it.  It's only if you wish to address different export targets
that things become more complicated, but that's not what you are doing.

Maybe gives us some idea of what it is you cannot do with ox-beamer and
we can suggest whether what you intend to do is reasonable or not.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.0.3-239-gd316ec




Re: [O] Circular lists/shared structures in org-element parse-tree

2013-06-28 Thread Daimrod
Thorsten Jolitz tjol...@gmail.com writes:

 Hi List, 

 I wonder how I can find out in a (elisp) program the points in the parse
 tree (returned by org-element-parse-buffer) where shared structures are
 used. 

 In the read-syntax, its easy to see (especially with `print-circle' set
 to non-nil):

 #+begin_src emacs-lisp
   #2=(org-data nil #1=(headline (:raw-value header 1
[...] :parent #2#) [...]  
 #+end_src

 but when processing the parse tree as a list in elisp, how can I detect the
 fact that 

 ,
 | :parent #2#
 `

 refers to 

 ,-
 | #2=(org-data nil
 `-

 i.e. points back to an already existing structure?

AFAIK you have to track all pointers inspected to see if one has already
be seen.

For example, I've implemented a version of equal[1] to compare this kind
of lists (to add tests to org-sync).

[1] https://github.com/daimrod/Emacs-config/blob/master/elisp/dmd-utils.el#L25

-- 
Daimrod/Greg


signature.asc
Description: PGP signature


Re: [O] Modifying the Beamer Exporter

2013-06-28 Thread Josiah Schwab
 Maybe, maybe not.  Difficult to say unless you give us a better idea of
 what kind of changes you plan on making.

I'm a little hazy, partially because my ideas seem to change quickly as
I learn more.

One of the more ambitious things that I'd like to do is to be able to
associate BibTeX references with a headlines in a way such that they are
collected at the level of the frame-headline and then rendered uniformly
in the page footers.

 In general, I find it sufficient to add a little bit of LaTeX code to my
 org files for most customisations or beamer specific commands.  The
 great thing about org is that it is easy to write LaTeX directly when
 you need it.  It's only if you wish to address different export targets
 that things become more complicated, but that's not what you are doing.

 Maybe gives us some idea of what it is you cannot do with ox-beamer and
 we can suggest whether what you intend to do is reasonable or not.

At least so far, it's no so much a question of can't, as a matter of
style.

#+AUTHOR: Josiah \\ \small with Alice  Bob

vs

#+AUTHOR: Josiah
#+COLLABORATORS: Alice  Bob

Another example would be the use of a subtitle.

#+LATEX_HEADER: \subtitle{An Illustrative Example}

vs

#+SUBTITLE: An Illustrative Example

I have a preference for the cleaner version and wanted to implement it
in a way that it likely to age well as org development progresses.

Best,
Josiah



Re: [O] Refiling list items

2013-06-28 Thread Samuel Wales
I confirm the following bug in git master.

P.S.  One possibility for the OP's question would be to allow a
special prefix arg to select the list item and its children as a
region then call refile region.

On 1/17/12, Jeff Horn jrhorn...@gmail.com wrote:
 On Wed, Aug 17, 2011 at 05:32, Bastien b...@altern.org wrote:
 I pushed three small changes to the org-refile interface:

 1. before prompting the user for a refile target, put the point at the
   beginning of the region/subtree to refile.  This will make sure
   everyone understands we are refiling headlines, not text.

 2. Improve the prompt itself, explicitely saying whether we are refiling
   a subtree or a region (containing subtree(s)).

 3. Add a new option `org-refile-active-region-within-subtree' which,
   when turned on, allows the user to refile the active region, turning
   the first line into a headline using `org-toggle-heading'.

 I think these are improvements going in the right direction -- let me
 know what you think.  On the overall, I'm with Nicolas in thinking that
 we need to be extra careful when we try to extend a functionality to
 heterogeneous elements.

 I've just come across an instance when this functionality was useful
 again. I like the solution you've implemented, Bastien. There's just a
 small problem I see right now, which pops up in particular with the
 example outline from my OP.

 ,[ Sample Outline ]
 | * Headline 1
 | - List level 1
 |   - List level 2
 | * Headline 2
 | Some text.
 `

 Selecting the region with the second line and third line, inclusive
 (the plain list under Heading 1), refiling with
 `org-refile-active-region-within-subtree' toggled on produces the
 following outline:

 ,[ Results ]
 | * Headline 1
 | 2
 | * Headline 2
 | Some text.
 | ** List level 1
 |   - List level
 `

 As you can see, the digit at the end of the list gets orphaned.

 --
 Jeffrey Horn
 http://www.failuretorefrain.com/jeff/




-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] Open Document Exporter

2013-06-28 Thread Georg Lehner

Hello!

Here comes another (tiny) patch which fixes generation of external links 
to relative file paths.


Apparently =./Media/logo.png= has to be inserted as 
=href=../Media/logo.png=.


At least on LibreOffice 3 and 4 anything else fails.  LibreOffice always 
shows and uses the
absolute path and prefixes the stored relative path with the path to the 
=.odt= file

*including the filename itself*!

So the =../= removes the filename and the link gets calculated correctly.

Best Regards,

Georg Lehner

- - -

--- /home/jorge/progs/org-mode/lisp/ox-odt.el
+++ /home/jorge/emacs/lib/org-mode/lisp/ox-odt.el
@@ -2763,7 +2780,7 @@
 ((string= type file)
  (if (file-name-absolute-p raw-path)
  (concat file:// (expand-file-name raw-path))
-   (concat file:// raw-path)))
+   (concat file: ../ raw-path)))
 (t raw-path)))
  ;; Convert  to amp; for correct XML representation
  (path (replace-regexp-in-string  amp; path))




Re: [O] Circular lists/shared structures in org-element parse-tree

2013-06-28 Thread Thorsten Jolitz
Daimrod daim...@gmail.com writes:

 Thorsten Jolitz tjol...@gmail.com writes:

[...]

 but when processing the parse tree as a list in elisp, how can I
 detect the fact that

 ,
 | :parent #2#
 `

 refers to 

 ,-
 | #2=(org-data nil
 `-

 i.e. points back to an already existing structure?

 AFAIK you have to track all pointers inspected to see if one has already
 be seen.

 For example, I've implemented a version of equal[1] to compare this kind
 of lists (to add tests to org-sync).

 [1]
 https://github.com/daimrod/Emacs-config/blob/master/elisp/dmd-utils.el#L25

Oh my ... I knew this would complicate my life a bit ...

Thanks for the link, this example function is indeed very helpful. 

-- 
cheers,
Thorsten




[O] HTML export and info: links

2013-06-28 Thread Sebastian Wiesner
Hello,

how can I customize info: links in HTML output?

I'd like replace info: links with HTML links to the corresponding
upstream manuals, such as
http://www.gnu.org/software/emacs/manual/html_node/emacs/Commands.html#Commands
for an info link info:emacs#Commands, just like in Texinfo HTML
output. However, I cannot find a way to achieve this.

I'm trying to port the Texinfo manual of a project of mine to Org,
which worked quite well so far, but now I am stuck.  Proper info:
link handling is really important to me.  I don't have many info:
links, but each of these is important and must be rendered properly in
both, Texinfo and HTML output.

Greetings,
Sebastian Wiesner



Re: [O] Help with beamer environments + org-special-blocks!

2013-06-28 Thread Nicolas Goaziou


Hello,

Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 No. I fixed it ten days ago (dffdc49).

 Though I'm now on Org-mode version 8.0.3 (release_8.0.3-295-g91a4c8), pulled
 this morning, I don't see it fixed.

I realize that the patch won't fix it. This patch was introduced to
allow something like:

 #+begin_figure*
 ...
 #+end_figure*

again. But it still expects the same string after the begin_ and the
end_. In this case strings are different because of the arguments to
the environment.

Therefore, the correct way to set this is using the #+attr_latex line,
as in your first case.

I hope it is less confusing now.


Regards,

-- 
Nicolas Goaziou




[O] [need help] How to add a caption to table with #+attr_latex :caption \bicaption{...}{...}

2013-06-28 Thread feng shu
HI:

In my thesie, I need add a caption to table or figure with
\bicaption{中文标题}{English title}

I can't find the easy way to do this in org-mode ,so  I add :caption  to
#+attr_latex:

for example:

#+attr_latex:  :caption \bicaption{...}{}


But the below function doesn't work as expected, someone can help me?
thanks!

#+begin_src emacs-lisp
(defun org-latex--caption/label-string (element info)
  Return caption and label LaTeX string for ELEMENT.

INFO is a plist holding contextual information.  If there's no
caption nor label, return the empty string.

For non-floats, see `org-latex--wrap-label'.
  (let* ((label (org-element-property :name element))
 (label-str (if (not (org-string-nw-p label)) 
  (format \\label{%s}
  (org-export-solidify-link-text label
 (main (org-export-get-caption element))
 (short (org-export-get-caption element t))
 (caption-from-latex-attr (plist-get (org-export-read-attribute
:attr_latex element) :caption)))
(cond
 ((and (not main) (equal label-str )) (format %s
caption-from-latex-attr))
 ((not main) (concat label-str \n (format %s
caption-from-latex-attr)))
 ;; Option caption format with short name.
 (short (format \\caption[%s]{%s%s}\n
(org-export-data short info)
label-str
(org-export-data main info)))
 ;; Standard caption format.
 (t (format \\caption{%s%s}\n label-str (org-export-data main
info))

#+end_src


Re: [O] [PATCH] Add a flat clocktable formatter useful for tables whose CSV export can be imported into accounting/invoiving tools such as Zoho Invoicing.

2013-06-28 Thread Ross Patterson
Bastien b...@gnu.org writes:

 thanks for the patch.  Do you mind filling the copyright
 assignment so we can accept the patch ?

I already have an FSF Emacs Assignment from 2008-12-22, RT 393650.  Is
there something else I need to do?

   http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt

 Also, please have a look at this page with guidance on how
 to submit a patch with a ChangeLog etc.

   http://orgmode.org/worg/org-contribute.html#sec-4-2

I did a search for such docs on orgmode.org but only found a pointer to
the list.  Perhaps someone should make these links more obvious.

Thanks,
Ross




Re: [O] [PATCH] Use geiser for babel scheme evaluation.

2013-06-28 Thread Greg Minshall
hi, Bastien,

 hi.  what happened to this patch?  i don't see it anywhere.  cheers!

 Can you give a pointer to this patch?

here is the thread:
http://comments.gmane.org/gmane.emacs.orgmode/64229

cheers, Greg



Re: [O] Bug: Export is crashing [8.0.3 (release_8.0.3-295-g91a4c8.dirty @ ~/org-mode-8/lisp/)]

2013-06-28 Thread Rustom Mody
Nick Dokos wrote:

 emacs version? org version? backtrace?
 I cannot reproduce with ...


 Ok I thought the org-submit-bug takes care of all this. Find it is partly
true -- dont see emacs version in my report. So

GNU Emacs 23.4.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.12) of 2012-09-22
on allspice, modified by Debian

Org-mode version 8.0.3 (release_8.0.3-295-g91a4c8.dirty @
~/pdsw/org-mode-8/lisp/)

$ git pull
Already up-to-date.

$ make autoloads
$ make all done

Now I find the crash occurs between
org-export-preprocess-string and org-footnote-normalize
edebug messages attached

However the 'dirty' in may subject line (created by org-submit-bug) makes
me suspicious
Saving file /home/rusi/courses/vertis/withdebug.txt...
Wrote /home/rusi/courses/vertis/withdebug.txt
Quit
Making completion list... [3 times]
Quit
Type C-x 1 to delete the help window.
org-export-preprocess-string
help-follow: No cross-reference here
call-interactively: Command attempted to use minibuffer while in minibuffer [3 
times]
Quit
org-footnote-normalize
Exporting...
progn: Wrong number of arguments: (lambda (optional sort-only) Collect the 
footnotes in various formats and normalize them.

This finds the different sorts of footnotes allowed in Org, and
normalizes them to the usual [N] format.

When SORT-ONLY is set, only sort the footnote definitions into the
referenced sequence. (let* ((limit-level (and (boundp (quote 
org-inlinetask-min-level)) org-inlinetask-min-level (1- 
org-inlinetask-min-level))) (nstars (and limit-level (if org-odd-levels-only 
(1- (* limit-level 2)) limit-level))) (org-outline-regexp (concat \\* (if 
nstars (format \\{1,%d\\}  nstars) + ))) (count 0) ins-point ref ref-table) 
(save-excursion (goto-char (point-min)) (while (setq ref 
(org-footnote-get-next-reference)) (let* ((lbl (car ref)) (pos (nth 1 ref)) (a 
(and lbl (assoc lbl ref-table))) (marker (or (nth 1 a) (incf count))) (inlinep 
(or (stringp (nth 3 ref)) (nth 3 a (if sort-only (goto-char (nth 2 ref)) 
(delete-region (nth 1 ref) (nth 2 ref)) (goto-char (nth 1 ref)) (insert (format 
[%d] marker)) (and inlinep org-footnote-fill-after-inline-note-extraction 
(org-fill-paragraph))) (unless a (let ((def (or ... ...))) (push (list lbl 
marker def inlinep (copy-marker pos)) ref-table) (cond ((and 
org-footnote-section (derived-mode-p (quote org-mode))) (goto-char (point-min)) 
(if (re-search-forward (concat ^\\*[]+ (regexp-quote 
org-footnote-section) [  ]*$) nil t) (delete-region (match-beginning 0) 
(org-end-of-subtree t t))) (goto-char (point-max)) (skip-chars-backward  

) (forward-line) (unless (bolp) (newline))) ((derived-mode-p (quote 
org-mode))) (t (when org-footnote-tag-for-non-org-mode-files (let ((tag (concat 
^ ... [ ]*$))) (goto-char (point-min)) (while (re-search-forward 
tag nil t) (replace-match ) (delete-region (point) (progn ... ...) (if 
(and (derived-mode-p (quote message-mode)) (goto-char (point-max)) 
(re-search-backward message-signature-separator nil t)) (beginning-of-line) 
(goto-char (point-max) (setq ins-point (point-marker)) (setq ref-table 
(delq nil (mapcar (lambda (x) (cond ((and sort-only ...) (set-marker ... nil) 
nil) ((not ...) (append ... ...)) (t x))) ref-table))) (setq ref-table 
(nreverse ref-table)) (mapc (lambda (x) (unless (nth 3 x) 
(org-footnote-delete-definitions (car x ref-table) (goto-char ins-point) 
(cond ((not ref-table)) ((or (not (derived-mode-p (quote org-mode))) 
org-footnote-section) (if (not (derived-mode-p (quote org-mode))) (progn 
(skip-chars-backward

) (delete-region (point) ins-point) (unless (bolp) (newline)) (when 
org-footnote-tag-for-non-org-mode-files (insert 
 org-footnote-tag-for-non-org-mode-files 
))) (when (and (cdr (assq ... org-blank-before-new-entry)) (zerop 
(save-excursion ...))) (insert 
)) (insert *  org-footnote-section 
)) (set-marker ins-point nil) (insert (mapconcat (lambda (x) (set-marker (nth 
4 x) nil) (format 
[%s] %s (nth ... x) (nth 2 x))) ref-table 
)) (unless (eobp) (insert 

))) (t (mapc (lambda (x) (let ((pos ...)) (goto-char pos) (set-marker pos 
nil)) (org-footnote-goto-local-insertion-point) (insert (format 
[%s] %s
 (if sort-only ... ...) (nth 2 x ref-table)), 2
Mark set