I got it thank you guys !!


2012/12/20 Myles English <mylesenglish@gmail.com>

Mohamed HIBTI writes:

> Thanks Myles,
> This is realy what I want. I have just to fix something (may be my
> org-version).
> The variable org-export-before-processing-hook seems missing.
> I have org-version 7.8.10 (with emacs 24.2.1)
> Regards,
> Mohame

Sorry again, I should have said that I am using this with the git
version and the new exporter.

I don't know if there is anything that will work for you on version
7.8.10.  I can recommend the git version though it is quite stable and
rarely causes problems, once set up it is very easy to update, see the
worg page for details.

Myles

> 2012/12/20 Myles English <mylesenglish@gmail.com>
>
>>
>> mohamed writes:
>>
>> > Myles,
>> > Thank you for this answer.
>> > I tried it with
>> > -------------------------------
>> > (add-to-list 'org-export-preprocess-hook
>> > 'my-export-delete-headlines-tagged-noheading)
>> > -------------------------------
>>
>> Sorry, I should have said: add it to org-export-before-processing-hook,
>> so you use it like this:
>>
>> #+begin_src emacs-lisp
>> (defun my-export-delete-headlines-tagged-noheading (backend)
>>   (dolist (hl (nreverse (org-element-map (org-element-parse-buffer
>> 'headline)
>>                                          'headline
>>                                          'identity)))
>>     (when (member "noheading" (org-element-property :tags hl))
>>       (goto-char (org-element-property :begin hl))
>>       (delete-region (point) (progn (forward-line) (point))))))
>>
>> (add-to-list 'org-export-before-processing-hook
>>              'my-export-delete-headlines-tagged-noheading)
>> #+end_src
>>
>> Myles
>>
>> >
>> >
>> > But I got some errors when exporting
>> >
>> > -----------------------------------------------------------------
>> > Exporting to LaTeX...  run-hooks: Wrong number of
>> > arguments: (lambda (backend) (dolist (hl (nreverse (org-element-map
>> > (org-element-parse-buffer (quote headline)) (quote headline) (quote
>> identity))))
>> > (when (member "noheading" (org-element-property :tags hl)) (goto-char
>> > (org-element-property :begin hl)) (delete-region (point) (progn
>> (forward-line)
>> > (point)))))), 0 (my-export-delete-headlines-tagged-noheading)
>> > -----------------------------------------------------------------
>> >
>> >
>> > I guess I have to use it in another way. My knowledge of lisp
>> programming is
>> > very limited.
>> >
>> > Regards,
>> > Mohamed
>>
>>