[O] [BUG] babel call lines broken

2012-07-04 Thread Andreas Leha
Hi all,

there seems to be a bug in evaluating #+call lines.

To reproduce, consider this file:
,
| * Some Headline
| #+name: parameters
| #+BEGIN_SRC R
|   ttt <- 1
| #+END_SRC
| 
| * Some Other Headline
| #+call: parameters() :results silent :exports none
`
and do C-c C-c on the #+call: line.

For me that results in:
,
| Debugger entered--Lisp error: (wrong-type-argument stringp nil)
|   replace-match(nil nil nil nil 3)
|   org-babel-set-current-result-hash(nil)
|   org-babel-lob-execute(("parameters()" ":results silent :exports none" 0))
|   org-babel-lob-execute-maybe()
|   org-babel-execute-maybe()
|   org-babel-execute-safely-maybe()
|   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
|   org-ctrl-c-ctrl-c(nil)
|   call-interactively(org-ctrl-c-ctrl-c nil nil)
`

Regards,
Andreas

PS: I am on emacs24.2.50.1




Re: [O] Bug in org-insert-todo-subheading?

2012-07-04 Thread Thorsten Jolitz
Thorsten Jolitz  writes:


> #+begin_src org
> *** TODO 
> ** TODO 
> * TODO
> #+end_src
>
> Is that a bug - or am I using the function wrongly?
> I would want the subheadings below the top-level
> heading. 

Answering my own question (by experimentation): 
When point is on the *, the subheading goes on top, when point is behind
the *, the subheading goes below the current heading. 

Not necesarily what I would have expected, but knowing it, it works.  

-- 
cheers,
Thorsten




[O] Bug in org-insert-todo-subheading?

2012-07-04 Thread Thorsten Jolitz

Hi List, 

when I try out the function 

,-
| (org-insert-todo-subheading ARG)
`-

with point at beginning-of-line of

,---
| * TODO
`---

and then 

,---
| ** TODO
`---

no matter if I use 1, -1 or e.g. 'todo for ARG, I get this:

#+begin_src org
*** TODO 
** TODO 
* TODO
#+end_src

Is that a bug - or am I using the function wrongly?
I would want the subheadings below the top-level
heading. 

-- 
cheers,
Thorsten





Re: [O] new exporter drops :parameters ?

2012-07-04 Thread cberry
Nicolas Goaziou  writes:

> Hello,
>
> Charles Berry  writes:
>
>> I am trying to put together a derived backend that makes use of Src Block
>> :parameters attribute.
>>
[deleted]
>>
>> AFAICS :parameters is nowhere to be found when using
>> org-export-to-buffer.
>
> This is because src blocks are executed before buffer is parsed. You can
> try to call `org-export-blocks-preprocess' on the following buffer
> (associated to a file):

Thanks! I get it.

It turns out I can piggyback extra info needed on the ':name' element
and use that in lieu of  ':parameters'.

BTW, "#+name: aname" and "#+NAME: aname" are handled differently in e-latex. The
former gets placed in the latex output as "\#+name: aname". Bug?

Chuck

>
>
> --8<---cut here---start->8---
>   #+name: bblock
>   #+BEGIN_SRC R :exports code :et-cetera
>   rnorm(2)+1
>   #+END_SRC
> --8<---cut here---end--->8---
>
> and see what is really parsed: the removal happens on the Babel side.
>
[snip]

-- 
Charles C. BerryDept of Family/Preventive Medicine
cberry at ucsd edu  UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901




Re: [O] mlorg : yet another parser for org-mode (Written in OCaml)

2012-07-04 Thread Simon Castellan
Hello again,

Four months have passed and a lot of progress have been made.  First I
suppressed the literate programming layer as it was getting too much in
the way.

Second, the support for the syntax has been greatly improved and
supports almost all constructions mentioned in org-element.el. Fore most
documents, it should be ok I guess -- but I don't know what org features
are the most used.

To debug, and to help mlorg to talk with other languages, I coded an XML
backend which dumps the structure of the file as a XML tree.





What is more interesting to me — and that's why I started mlorg in the
first place — is the quote backend. This backend allows you to pick out
a code block in your file (OCaml only for now) and feed it the whole
document as a tree. Thus this code can extract the particuliar
information you want. For instance, I have at the end of my contacts.org
this little snippet that exports the contacts as mutt aliases

(F stands for filter, D for document and |- is the composition of
function as the code is written in point-free style -- the argument
isn't explicitely mentionned)

#+name:export
#+begin_src ocaml
let replace = Str.global_replace (Str.regexp " ") "_" in
F.run (F.has_property (F.s "EMAIL")) |-
List.map (fun d -> sprintf "alias %s %s\n" (D.name d |> replace) (D.prop_val_ 
"EMAIL" d)) |-
String.concat "" |-
write
#+end_src

With this, I just need to do

  $ mlorg --filename contacts.org --backend quote

to have my mutt aliases. With this quote feature I plan to let the user
override the html/latex exporters through the means of inheritance. For
instance, suppose the user has blocks like that in his document:

#+begin_lemma
Some lemma.
#+end_lemma

He wants to export it in a specific way in html, he can put at the end of his 
document:

#+name export
#+begin_src ocaml
let exporter = object(self)
  inherit htmlExporter as super
  method block = function
   | Custom ("lemma", name, contents) ->
 Xml.block "div" ~attr:["class", "lemma"]
   (Xml.data (name ^ " — ") ::
self#blocks contents
   | block -> super#block block
end
in exporter#document
#+end_src

(It doesn't work yet but soon will)

---

I wrote a short README available here:

  http://kiwi.iuwt.fr/~asmanur/projets/mlorg/

(This shows that the html backend is pretty basic)

This comments briefly every construction of the syntax I support.


Performance-wise, it is not optimized at all and as such quite slow. To
process this file http://doc.norang.ca/org-mode.org, on my computer the
bytecode version is as fast as org-mode and the native version is about
5-6x faster. (tested quickly)

--

What I plan to do next:
- complete the syntax as much as possible
- improve the html & latex backend
- try to be a little faster
- have a agenda backend as well.
- implements other languages ?


Simon.



[O] Suggested Modification to fix Org-Mobile.el (can someone submit fix or suggest better way to do this)

2012-07-04 Thread Jeffrey Spencer
The issue arises with org-agenda-redo. When running this command it selects
the last file that was used to make an agenda buffer. Since the previous
file used to do that was *SUMO* it tries to rebuild using that if currently
an *Org Agenda* buffer was open because this is the only time
(org-agenda-redo) is run.

If you put (org-agenda-list) or anything that modifies the agenda buffer in
place >>>Insert here (probably something better to do than this but with my
limited knowledge of org and recent uptaking not sure. Read 2 below). This
forces so *Org Agenda* is set again. The command works fine and
(org-agenda-redo) updates and places you in the buffer.

1) Not entirely sure why you need to run (org-agenda-redo) at all?? Just
seems non-essential unless something was saved that would now be in the
agenda view and wasn't before. Not opposed just curious why it was put
there.

2) I would say implementation suggested above is fine but there is probably
a lot better way to implement it. Like possibly setting whatever remembers
*SUMO* in org-agenda to the a-buffer file before running (org-agenda-redo).

Any help would be great because want to set autosave for mobileorg when
idle but always messes with the agenda buffer which is annoying.

Pasted org-mobile-push from current development pulled today:

(defun org-mobile-push ()
  "Push the current state of Org affairs to the WebDAV directory.
This will create the index file, copy all agenda files there, and also
create all custom agenda views, for upload to the mobile phone."
  (interactive)
  (let ((a-buffer (get-buffer org-agenda-buffer-name)))
(let ((org-agenda-buffer-name "*SUMO*")
  (org-agenda-tag-filter org-agenda-tag-filter)
  (org-agenda-redo-command org-agenda-redo-command))
  (save-excursion
(save-window-excursion
  (run-hooks 'org-mobile-pre-push-hook)
  (org-mobile-check-setup)
  (org-mobile-prepare-file-lists)
  (message "Creating agendas...")
  (let ((inhibit-redisplay t)) (org-mobile-create-sumo-agenda))
  (message "Creating agendas...done")
  (org-save-all-org-buffers) ; to save any IDs created by this process
  (message "Copying files...")
  (org-mobile-copy-agenda-files)
  (message "Writing index file...")
  (org-mobile-create-index-file)
  (message "Writing checksums...")
  (org-mobile-write-checksums)
  (run-hooks 'org-mobile-post-push-hook)))
  )
>>> Insert Here
(redraw-display)
(when (and a-buffer (buffer-live-p a-buffer))
  (if (not (get-buffer-window a-buffer))
  (kill-buffer a-buffer)
 (let ((cw (selected-window)))
  (select-window (get-buffer-window a-buffer))
  (org-agenda-redo)
  (select-window cw)
  (message "Files for mobile viewer staged"))



Cheers,
Jeff


Re: [O] org-element-drag-* broken

2012-07-04 Thread suvayu ali
Hi Nicolas,

On Wed, Jul 4, 2012 at 6:22 PM, Nicolas Goaziou  wrote:
> It means that if point is at the very beginning of the list, it will try
> to move the whole list. Since there is nothing after the list, it
> returns an error.
>
> In order to drag the first item, you have to move one character forward,
> or use `org-element-down' in order to "enter" the list.

Ah! A very subtle effect; I have to apologise I hadn't gone through
the docs, sorry.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] [ANN] Beamer back-end for org-export in contrib/

2012-07-04 Thread suvayu ali
Hi Nicolas,

On Wed, Jul 4, 2012 at 6:08 PM, Nicolas Goaziou  wrote:
>> The exported latex source however has the following:
>>
>>   \documentclass[11pt]{article}
>
> This is because "LaTeX_CLASS" and "LaTeX_CLASS_OPTIONS" properties are
> not recognized as export properties. You have to use them as a buffer
> keyword (#+LATEX_CLASS: beamer).
>

Okay, but this brings up a use case issue for me. I usually have a org
file dedicated to a project I'm working on. Then I have notes on
different sub topics and presentations in different subtrees. As needed,
I export the subtrees. This can be simple LaTeX or html export for notes
(to share or print), or beamer export in case I want to give a
presentation.

If I understand correctly, having a buffer keyword would mean I would
need to find and update it appropriately everytime I want to export
something. I can live with this, but it would be great if there was
support these export options as properties. Then all the subtree exports
can be decoupled easily.


>> I would also like to work on some user documentation for the beamer
>> backend (when I do find some free time :-p). I see that org-e-beamer.el
>> is very well commented so I will start there, but do you have any other
>> pointers that might help me clearly document the supported features?
>
> I suppose you know about Eric S Fraga's tutorial at:
>
>   http://orgmode.org/worg/org-tutorials/org-beamer/tutorial.html
>
> Since the back-end shares a lot with its previous incarnation, you will
> find, /mutatis mutandis/, much information about it.

Okay thanks, I was also thinking something similar and started based on
that. For all the common features I'll refer to Eric's tutorial and will
outline only the new, altered or deprecated features in my file.

Thanks again for this beautiful work. :)

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] org-element-drag-* broken

2012-07-04 Thread Nicolas Goaziou
Hello,

suvayu ali  writes:

> Yes the move is allowed. I can reproduce the problem with the attached
> ECM. Evaluate the lisp block in a minimal Emacs session and try to
> reorder the list below with M-.

I see. This behaviour is documented in `org-element-at-point' docstring:

--8<---cut here---start->8---
As a special case, if point is at the very beginning of a list or
sub-list, returned element will be that list instead of the first
item.  In the same way, if point is at the beginning of the first
row of a table, returned element will be the table instead of the
first row.
--8<---cut here---end--->8---

It means that if point is at the very beginning of the list, it will try
to move the whole list. Since there is nothing after the list, it
returns an error.

In order to drag the first item, you have to move one character forward,
or use `org-element-down' in order to "enter" the list.


Regards,

-- 
Nicolas Goaziou



Re: [O] org-element-drag-* broken

2012-07-04 Thread suvayu ali
On Wed, Jul 4, 2012 at 5:56 PM, Nicolas Goaziou  wrote:
> Could you provide an ECM? I cannot reproduce the problem.
>
> Also, is the move that you're trying to achieve allowed?

Yes the move is allowed. I can reproduce the problem with the attached
ECM. Evaluate the lisp block in a minimal Emacs session and try to
reorder the list below with M-.

PS: Sorry for the weird filename. Without the txt, Gmail screws up the
attachment MIME type.

-- 
Suvayu

Open source is the future. It sets us free.
# -*- mode: org; -*-

* Setup
#+BEGIN_SRC emacs-lisp :results silent
  (load-library "org-export")
  (defalias 'org-metaup 'org-element-drag-backward)
  (defalias 'org-metadown 'org-element-drag-forward)
#+END_SRC

* Comparisons
Some text
1. list item
2. some emphasized text
3. another list item


Re: [O] [ANN] Beamer back-end for org-export in contrib/

2012-07-04 Thread Nicolas Goaziou
Hello,

> This however didn't work for me. Since the beamer export is not in the
> dispatcher yet, I tried the following:
>
>   * Lifetime acceptance WG update
> :PROPERTIES:
> :LaTeX_CLASS: beamer
> :LaTeX_CLASS_OPTIONS: [presentation,smaller]
> :EXPORT_FILE_NAME: WG_update.pdf
> :EXPORT_AUTHOR: Suvayu Ali
> :EXPORT_DATE: 05 June, 2012
> :EXPORT_OPTIONS: H:1 num:nil toc:nil ^:{}
> :END:
>
>   ** Frame title 1
>
>   M-: (org-e-beamer-export-to-pdf t)
>
> The exported latex source however has the following:
>
>   \documentclass[11pt]{article}

This is because "LaTeX_CLASS" and "LaTeX_CLASS_OPTIONS" properties are
not recognized as export properties. You have to use them as a buffer
keyword (#+LATEX_CLASS: beamer).

> I would also like to work on some user documentation for the beamer
> backend (when I do find some free time :-p). I see that org-e-beamer.el
> is very well commented so I will start there, but do you have any other
> pointers that might help me clearly document the supported features?

I suppose you know about Eric S Fraga's tutorial at:

  http://orgmode.org/worg/org-tutorials/org-beamer/tutorial.html

Since the back-end shares a lot with its previous incarnation, you will
find, /mutatis mutandis/, much information about it.


Regards,

-- 
Nicolas Goaziou



Re: [O] org-element-drag-* broken

2012-07-04 Thread Nicolas Goaziou
Hello,

suvayu ali  writes:

> I have been trying out the `org-element-drag-backward' and
> `org-element-drag-forward' navigation commands. I believe they stopped
> working yesterday when I updated my org-mode (Git: dab2505 -> a69f4b8).
>
> When I try to move list items, I get the backtrace shown below. FWIW,
> promotion and demotion works.

Could you provide an ECM? I cannot reproduce the problem.

Also, is the move that you're trying to achieve allowed?


Regards,

-- 
Nicolas Goaziou



Re: [O] Org-Export Subtree Options Not Working

2012-07-04 Thread Jeffrey Spencer
Sorry didn't finish the message.

That doesn't seem to work from what I have tried.

If for example it is

* 2012:noexport:
** June   :noexport:
*** Not going output
*** Want to export this and subtrees  :export:
 Also export
The above example won't export anything because the export is below the
:noexport:.

I just wrote a kbd macro to search up to the nearest tag in the structure I
define, select that subtree, and export. Then set to a key-binding to
reload each time but figured there was a better way to do this.

Or was interested for the reasons of creating a way to export a subtree at
a specific headline level always. Is there a way to go up from your current
level to a specific level in the subtree. Like if your on the 6th level but
want to go up to the third level heading. Is there a command or key
shortcut to do this essentially??

Cheers

On Wed, Jul 4, 2012 at 5:21 PM, Detlef Steuer  wrote:

> On Wed, 4 Jul 2012 14:03:24 +1000
> Jeffrey Spencer  wrote:
>
> > Thanks, that fixed it but another question.
> >
> > if you export the whole file then and not just the selection can you use
> a
> > tag or property to specify a different directory to export into instead
> of
> > the same directory as the org file. Will creating the Property Tag at the
> > top level work for this??
> >
> > Also, is there an easy way to tell it to ignore the first say 2 headers
> in
> > the file and only export starting with the third header. My first two
> > headers are just to keep track of dates eg.
> > * 2010
> > ** June
> >
> > I would rather these be ignored when doing the export. The only way I
> know
> > is to export the subtree.
>
> You should be able to use :noexport: on these.
>
> hth
> Detlef
>
>
> >
> > If there isn't then is there a way to write a command that would take the
> > current place your working in go up to the third level heading, select
> the
> > third level, and run an export command. Or the fastest way to do this via
> > key bindings?
> >
> > Cheers,
> > Jeff
> >
> > On Tue, Jul 3, 2012 at 7:29 PM, Nicolas Goaziou 
> wrote:
> >
> > > Hello,
> > >
> > > Jeffrey Spencer  writes:
> > >
> > > > When I input subtree options for modifying the global options when
> > > > selecting with C-c @ and then exporting.
> > > >
> > > > The subtree options for example:
> > > >
> > > > #+EXPORT_OPTIONS: H:2 num:t toc:f \n:nil @:t ::t |:t ^:t -:t f:t *:t
> <:t
> > > >  TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:nil
> > > > #+EXPORT_FILE_NAME: tester
> > > >
> > > > are not used and just ignored. Shouldn't these overide the file
> settings
> > > > from what I read in the org-manual. Where do these need to be
> placed. It
> > > is
> > > > right below the subtree I am selecting for export.
> > >
> > > You have to use headlines properties (with C-c C-x p) instead of
> > > keywords, i.e.
> > >
> > > --8<---cut here---start->8---
> > > * Headline
> > >   :PROPERTIES:
> > >   :EXPORT_TITLE: subtree-title
> > >   :END:
> > > Paragraph
> > > --8<---cut here---end--->8---
> > >
> > >
> > > Regards,
> > >
> > > --
> > > Nicolas Goaziou
> > >
> >
>
>
>
>


Re: [O] Broken LaTeX export

2012-07-04 Thread SW
Eric S Fraga  ucl.ac.uk> writes:

> A simple solution which keeps your interest in the outline structure at
> this stage of the writing is to add the line
> 
> #+options: H:3

...

Thanks. That's a useful suggestion.




[O] Agenda Upcoming Faces

2012-07-04 Thread SW
I have agenda TODO items due in 5d (in org-upcoming-deadline face), in 16d (in
default face) and in 26d (in org-upcoming-deadline face).

Why is the 16d deadline in default face?




[O] bug#11774: bug#11774: bug#11774: org-mode causes undo boundaries to be lost

2012-07-04 Thread Toby Cubitt
On Tue, Jul 03, 2012 at 05:18:50PM -0700, Samuel Wales wrote:
> On 7/3/12, Stefan Monnier  wrote:
> >> self-insert-command.  Even just turning that magic 20 number into a
> >> variable would help.
> >
> > Providing it as a variable would be very easy, indeed.
>
> Therefore, IF we have that variable, then undo-boundary considerations
> should be simply to DTRT for undo-tree, org-self-insert-command,
> and other code, in such a way that subtle bugs are prevented.

Just to clarify the situation with undo-tree: it doesn't care how or when
undo boundaries are inserted, and never did. The problem was only that
undo boundaries that had nothing to do with self-insert-command were
being *deleted*, due to the subtle interaction between the new Emacs-24
self-insert-command and org-mode's org-self-insert-cluster-for-undo
feature.

I've already pushed a change to the git version of undo-tree to make it
work even if something else deletes undo boundaries that it shouldn't
have touched (e.g. org-mode + Emacs-24). Deleting boundaries that have
nothing to do with self-insert-command is still a bug, in my opinion, but
it's a bug that no longer has catastrophic consequences in
undo-tree-mode.

It sounds from the preceding discussion that the right solution is simply
to disable org-self-insert-cluster-for-undo in Emacs-24, since the
purpose of org-mode's clustering was to recover the normal clustering
behaviour and the standard self-insert-command clustering now works in
org-mode with Emacs-24.

The question of how to customize the clustering granularity seems to me
to be a separate question (which can presumably be solved by making the
hard-coded 20 into a variable).

Toby
-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: ts...@cantab.net
web:   www.dr-qubit.org





[O] org-element-drag-* broken

2012-07-04 Thread suvayu ali
Hi Nicolas,

I have been trying out the `org-element-drag-backward' and
`org-element-drag-forward' navigation commands. I believe they stopped
working yesterday when I updated my org-mode (Git: dab2505 -> a69f4b8).

When I try to move list items, I get the backtrace shown below. FWIW,
promotion and demotion works.

I hope this helps.


Debugger entered--Lisp error: (error "Cannot swap elements")
  signal(error ("Cannot swap elements"))
  error("Cannot swap elements")
  (if (and specialp (or (not (eq (org-element-type elem-B) (quote
paragraph))) (/= (org-element-property :begin elem-B)
(org-element-property :contents-begin elem-B (error "Cannot swap
elements"))
  (let ((specialp (not (bolp (if (and specialp (or (not (eq
(org-element-type elem-B) (quote paragraph))) (/=
(org-element-property :begin elem-B) (org-element-property
:contents-begin elem-B (error "Cannot swap elements")) (let*
((ind-B (when specialp (goto-char (org-element-property :begin
elem-B)) (org-get-indentation))) (beg-A (org-element-property :begin
elem-A)) (end-A (save-excursion (goto-char (org-element-property :end
elem-A)) (skip-chars-backward "
\n") (point-at-eol))) (beg-B (org-element-property :begin elem-B))
(end-B (save-excursion (goto-char (org-element-property :end elem-B))
(skip-chars-backward "
\n") (point-at-eol))) (overlays (cons (mapcar (lambda (ov) (list ov
... ...)) (overlays-in beg-A end-A)) (mapcar (lambda (ov) (list ov ...
...)) (overlays-in beg-B end-B (body-A (buffer-substring beg-A
end-A)) (body-B (delete-and-extract-region beg-B end-B))) (goto-char
beg-B) (when specialp (setq body-B (replace-regexp-in-string "\\`[
]*" "" body-B)) (org-indent-to-column ind-B)) (insert body-A) (mapc
(lambda (ov) (move-overlay (car ov) (+ (nth 1 ov) (- beg-B beg-A)) (+
(nth 2 ov) (- beg-B beg-A (car overlays)) (goto-char beg-A)
(delete-region beg-A end-A) (insert body-B) (mapc (lambda (ov)
(move-overlay (car ov) (+ (nth 1 ov) (- beg-A beg-B)) (+ (nth 2 ov) (-
beg-A beg-B (cdr overlays)) (goto-char (org-element-property :end
elem-B
  org-element-swap-A-B((paragraph (:begin 1258 :end 1268
:contents-begin 1258 :contents-end 1267 :post-blank 0)) (item (:bullet
"- " :begin 1268 :end 1298 :contents-begin 1270 :contents-end 1298
:checkbox nil :counter nil :tag nil :hiddenp nil :structure ((1256 0
"- " nil nil nil 1268) (1268 0 "- " nil nil nil 1298) (1298 0 "- " nil
nil nil 1307) (1307 0 "- " nil nil nil 1335) (1335 0 "- " nil nil nil
1344)) :post-blank 0)))
  (let ((size-next (- (save-excursion (goto-char (org-element-property
:end next-elem)) (skip-chars-backward "
\n") (forward-line) (if (and (eolp) (not ...)) (1+ (point)) (point)))
(org-element-property :begin next-elem))) (size-blank (-
(org-element-property :end elem) (save-excursion (goto-char
(org-element-property :end elem)) (skip-chars-backward "
\n") (forward-line) (point) (org-element-swap-A-B elem next-elem)
(goto-char (+ pos size-next size-blank)))
  (let ((next-elem (org-element-at-point))) (when (or
(org-element-nested-p elem next-elem) (and (eq (org-element-type
next-elem) (quote headline)) (not (eq (org-element-type elem) (quote
headline) (goto-char pos) (error "Cannot drag element forward"))
(let ((size-next (- (save-excursion (goto-char (org-element-property
:end next-elem)) (skip-chars-backward "
\n") (forward-line) (if (and ... ...) (1+ ...) (point)))
(org-element-property :begin next-elem))) (size-blank (-
(org-element-property :end elem) (save-excursion (goto-char
(org-element-property :end elem)) (skip-chars-backward "
\n") (forward-line) (point) (org-element-swap-A-B elem next-elem)
(goto-char (+ pos size-next size-blank
  (let* ((pos (point)) (elem (org-element-at-point))) (when (=
(point-max) (org-element-property :end elem)) (error "Cannot drag
element forward")) (goto-char (org-element-property :end elem)) (let
((next-elem (org-element-at-point))) (when (or (org-element-nested-p
elem next-elem) (and (eq (org-element-type next-elem) (quote
headline)) (not (eq (org-element-type elem) (quote headline)
(goto-char pos) (error "Cannot drag element forward")) (let
((size-next (- (save-excursion (goto-char ...) (skip-chars-backward "
\n") (forward-line) (if ... ... ...)) (org-element-property :begin
next-elem))) (size-blank (- (org-element-property :end elem)
(save-excursion (goto-char ...) (skip-chars-backward "
\n") (forward-line) (point) (org-element-swap-A-B elem next-elem)
(goto-char (+ pos size-next size-blank)
  org-metadown()
  call-interactively(org-metadown nil nil)


-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Org-Export Subtree Options Not Working

2012-07-04 Thread Detlef Steuer
On Wed, 4 Jul 2012 14:03:24 +1000
Jeffrey Spencer  wrote:

> Thanks, that fixed it but another question.
> 
> if you export the whole file then and not just the selection can you use a
> tag or property to specify a different directory to export into instead of
> the same directory as the org file. Will creating the Property Tag at the
> top level work for this??
> 
> Also, is there an easy way to tell it to ignore the first say 2 headers in
> the file and only export starting with the third header. My first two
> headers are just to keep track of dates eg.
> * 2010
> ** June
> 
> I would rather these be ignored when doing the export. The only way I know
> is to export the subtree.

You should be able to use :noexport: on these.

hth
Detlef 


> 
> If there isn't then is there a way to write a command that would take the
> current place your working in go up to the third level heading, select the
> third level, and run an export command. Or the fastest way to do this via
> key bindings?
> 
> Cheers,
> Jeff
> 
> On Tue, Jul 3, 2012 at 7:29 PM, Nicolas Goaziou  wrote:
> 
> > Hello,
> >
> > Jeffrey Spencer  writes:
> >
> > > When I input subtree options for modifying the global options when
> > > selecting with C-c @ and then exporting.
> > >
> > > The subtree options for example:
> > >
> > > #+EXPORT_OPTIONS: H:2 num:t toc:f \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
> > >  TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:nil
> > > #+EXPORT_FILE_NAME: tester
> > >
> > > are not used and just ignored. Shouldn't these overide the file settings
> > > from what I read in the org-manual. Where do these need to be placed. It
> > is
> > > right below the subtree I am selecting for export.
> >
> > You have to use headlines properties (with C-c C-x p) instead of
> > keywords, i.e.
> >
> > --8<---cut here---start->8---
> > * Headline
> >   :PROPERTIES:
> >   :EXPORT_TITLE: subtree-title
> >   :END:
> > Paragraph
> > --8<---cut here---end--->8---
> >
> >
> > Regards,
> >
> > --
> > Nicolas Goaziou
> >
>