[Orgmode] Exporting BEAMER_HEADER_EXTRA

2010-09-16 Thread Francesco Pizzolante
Hi,

I have noticed a small problem with the export of the #+BEAMER_HEADER_EXTRA
content (containing, as described in the documentation, the \usetheme{MyTheme}
command).

As of now, it is generated just before the \begin{document} command and after
the export of \title{}, \author{} and \date{} commands.

This means that if any of these commands (title, author, date) are
customized/overridden in the theme, we don't get the customizations as they
are called before the \usetheme{} command.

Thus, the #+BEAMER_HEADER_EXTRA content should be exported before the export
of \title{}, \author{} and \date{} command; hence, the right order would be:

- \documentclass{}
- block =def-packages=
- block =packages=
- block =LATEX_EXTRA=
- block =LATEX_BEAMER_EXTRA= <<< NEW position (instead of after \title...)
- \title{}, \author{}, \date{}

A simple workaround is to use #+LATEX_HEADER instead of #+BEAMER_HEADER_EXTRA
to call the \usetheme{} command.

Thanks,
Francesco

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Project management > Dynamic block per tag + [Babel]

2010-11-22 Thread Francesco Pizzolante
Hi,

I'm using Org to manage a project.

I need to output a tasks list for every of my colleagues, person per person.

I'm currently using tags to assing people to tasks (even if I'm not completely
convinced that this is the right way to go).

What I would like is to generate a dynamic block for each person with all
tasks assigned to that person. This means, list all headings with a given tag.

Could someone tell me how to do that?


I tried using Babel to output a custom report where I will be able to (not yet
done) easily filter by tag.

But I'm already blocked with such a code:

--8<---cut here---start->8---
#+begin_src emacs-lisp :results output
(with-output-to-string
  (org-agenda nil "a"))
#+end_src
--8<---cut here---end--->8---

It does not produce any output. Any idea?


Thanks,
Francesco

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Project management > Dynamic block per tag + [Babel]

2010-12-09 Thread Francesco Pizzolante


Hi Matt,

Thanks a lor for you answer.

I preferred your second suggestion as I can add it directly to my Org buffer:

> --8<---cut here---start->8---
> #+source: tasklist
> #+begin_src emacs-lisp :var person="me"
>  (let (tasklist)
>    (org-map-entries
>     (lambda ()
>       (add-to-list 'tasklist
>                    (concat "- " (nth 4 (org-heading-components)
>     (concat person "/!TODO") 'agenda)
>    (mapconcat 'identity tasklist "\n"))
> #+end_src
>
> #+call: tasklist(person="Jenny")
> --8<---cut here---end--->8---
>
> Add this to an org file, replace Jenny with the appropriate name, and
> type C-c C-c to spit out a list (of all TODO items tagged with the
> relevant name) that looks like this:
>
> --8<---cut here---start->8---
> #+results: tasklist(person="Jenny")
> #+begin_example
> - Call George
> - Call Archie
> - Estimate cost of widgets
> --8<---cut here---end--->8---

Currently you code returns todo items with the todo keyword "TODO" only.

What do I have to change in order to get all todo items with selected todo
keyword? As an example, I'd like to keep in the lists the todo items with TODO
and STARTED but not the ones marked as DONE, WAIT or NEW.

Thanks again for your help.

Regards,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Export to LaTeX bug

2010-12-09 Thread Francesco Pizzolante
Hi,

Exporting to LaTeX generates a weird a usepackage line (with fixltx2e).

Here's a simple example:

--8<---cut here---start->8---
#+TITLE: Test export LaTeX

* This is a simple test
--8<---cut here---end--->8---

Look at the 4th line of the resulting export:

--8<---cut here---start->8---
% Created 2010-12-09 Thu 17:04
\documentclass[11pt]{article}
\usepackage[utf8x]{inputenc}
\usepackage[(T1 fontenc)]{( fixltx2e)}
\usepackage{listings}
\usepackage{xcolor}
\providecommand{\alert}[1]{\textbf{#1}}
\begin{document}



\title{Test export \LaTeX{}}
\author{Francesco Pizzolante}
\date{09 December 2010}
\maketitle

\setcounter{tocdepth}{3}
\tableofcontents
\vspace*{1cm}

\section{This is a simple test}
\label{sec-1}

\end{document}
--8<---cut here---end--->8---

Thanks,
F.

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [Babel] LaTeX code not exported

2010-12-09 Thread Francesco Pizzolante
Hi,

LaTeX code blocks are ignored when exporting to HTML or PDF.

The following Org example:

--8<---cut here---start->8---
#+TITLE: Test export LaTeX
#+BABEL: :exports code

#+begin_src latex
\documentclass{article}
#+end_src
--8<---cut here---end--->8---

Gives the following HTML result:

--8<---cut here---start->8---



Test export LaTeX



Table of Contents


1 This is a simple test





1 This is a simple 
test






 Author: Francesco Pizzolante

 Date: 2010-12-09 17:41:54 



--8<---cut here---end--->8---

Is this a bug? Do I miss an option somewhere?

Any help is welcome.

Regards,
Francesco

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Export to LaTeX bug

2010-12-14 Thread Francesco Pizzolante
Hi,

Please ignore this thread.

This problem was coming from a bug in my .emacs file.

*I* was doing weird things with the org-export-latex-packages-alist variable:

  (add-to-list 'org-export-latex-packages-alist
   '(("T1" "fontenc")
 ("" "fixltx2e")
 ("" "graphicx")
 ("" "longtable")
 ("" "float")
 ("" "wrapfig")
 ("" "soul")
 ("" "t1enc")
 ("" "textcomp")
 ("" "marvosym")
 ("" "wasysym")
 ("" "latexsym")
 ("" "amssymb")
 ("" "hyperref")
 ("\\tolerance=1000")) t)

I'm sorry for the inconvenience.

Regards,
Francesco


> Exporting to LaTeX generates a weird a usepackage line (with fixltx2e).
>
> Here's a simple example:
>
> --8<---cut here---start->8---
> #+TITLE: Test export LaTeX
>
> * This is a simple test
> --8<---cut here---end--->8---
>
> Look at the 4th line of the resulting export:
>
> --8<---cut here---start->8---
> % Created 2010-12-09 Thu 17:04
> \documentclass[11pt]{article}
> \usepackage[utf8x]{inputenc}
> \usepackage[(T1 fontenc)]{( fixltx2e)}
> \usepackage{listings}
> \usepackage{xcolor}
> \providecommand{\alert}[1]{\textbf{#1}}
> \begin{document}
>
>
>
> \title{Test export \LaTeX{}}
> \author{Francesco Pizzolante}
> \date{09 December 2010}
> \maketitle
>
> \setcounter{tocdepth}{3}
> \tableofcontents
> \vspace*{1cm}
>
> \section{This is a simple test}
> \label{sec-1}
>
> \end{document}
> --8<---cut here---end--->8---
>
> Thanks,
> F.
>
> ___
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Embedding the style when exporting to HTML

2010-12-14 Thread Francesco Pizzolante
Hi,

I'm still in the process of managing a project with Org while trying to
evangelize my colleagues to Org. The goal is to share documents in the
simplest possible way.

What I'm trying to do is to have my style be embedded (inline) to my exported
HTML file.

Today, it can done by customizing org-export-html-style or add my whole style
in my Org buffer with the #+STYLE directive.

This has the following disadvantages:

- I have to share my .emacs file with my customizations in order for other
  people be able to export the Org file as required. Thus if someone has
  another configuration file, it will not work;

- The style itself (the CSS) is not easily testable and not separate from the
  data (it is included in my Org file or in my .emacs).

It would be good to specify a file for the style in the Org buffer itself and
have an option telling Org if the style has to be embedded (or inline) to the
exported HTML or not.

Having this option has the following advantages:

- my exported file is self-contained and is easily shareable;

- anybody can export the Org file and will get the desired result (even with a
  different Emacs config);

- the CSS itself is easily testable and maintainable by different guys and
  can even be a different project.

What do you think?

Is it possible to achieve this with the current version of Org?

Any suggestion is welcome.

Regards,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Embedding the style when exporting to HTML

2010-12-14 Thread Francesco Pizzolante
Hi Christian,

> The following would make the exported HTML link to an external stylesheet.
>
> #+STYLE: 
>
> But that 's not what you're after? You want the stylesheet to be /outside/
> (linked from) your Org file, but /embedded in/ the exported HTML? Did I get
> that right?

Indeed. That would be the ideal solution for me: it would bring all the
advantages I'm looking for:

- separate files for developing separately the style and the content;

- anybody could export the file as no special Emacs configuration is needed;

- the exported file would be self-contained.

Do you think about one way of doing this?

Thanks,
Francesco

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Project management > Dynamic block per tag + [Babel]

2010-12-16 Thread Francesco Pizzolante


Hi Matt,

> Another option is to use a babel block and org-map-entries to spit out a
> simple list of tasks for each person:
>
> --8<---cut here---start->8---
> #+source: tasklist
> #+begin_src emacs-lisp :var person="me"
>  (let (tasklist)
>    (org-map-entries
>     (lambda ()
>       (add-to-list 'tasklist
>                    (concat "- " (nth 4 (org-heading-components)
>     (concat person "/!TODO") 'agenda)
>    (mapconcat 'identity tasklist "\n"))
> #+end_src
>
> #+call: tasklist(person="Jenny")
> --8<---cut here---end--->8---
>
> Add this to an org file, replace Jenny with the appropriate name, and
> type C-c C-c to spit out a list (of all TODO items tagged with the
> relevant name) that looks like this:
>
> --8<---cut here---start->8---
> #+results: tasklist(person="Jenny")
> #+begin_example
> - Call George
> - Call Archie
> - Estimate cost of widgets
> --8<---cut here---end--->8---

Thanks a lot for your great help.

I've played a little with the code you've sent and here's what I end up with:

--8<---cut here---start->8---
#+source: tasklist
#+begin_src emacs-lisp :var person="FPZ" :results raw
(setq org-agenda-files (list (buffer-file-name)))
(let (tasklist)
  (add-to-list 'tasklist "" t)
  (org-map-entries
   (lambda ()
 (let ((priority (nth 3 (org-heading-components
   (add-to-list 'tasklist
(concat "| *" (nth 2 (org-heading-components)) "* "
"|/[#" (char-to-string (if priority
priority ?B)) "]/ "
"| [[" (nth 4 (org-heading-components)) "]]|") t)))
   (concat person "/!TODO|STARTED|WAIT") 'agenda)
  (mapconcat 'identity tasklist "\n"))
#+end_src
--8<---cut here---end--->8---

This enables to get a table with a task per row. For each task, I get the TODO
keywork, the priority and a link to the corresponding section in my Org
buffer.

Here'a an example from one of my document:
--8<---cut here---start->8---
#+results: tasklist
|||
 |
| *WAIT*| /[#C]/ | [[See if we have to filter the processes
against something else]]|
| *WAIT*| /[#C]/ | [[See if we have to filter the products against
something else than the branch]] |
| *STARTED* | /[#A]/ | [[Display static party questions block]]
 |
| *WAIT*| /[#C]/ | [[Analyse the risk management screen]]
 |
--8<---cut here---end--->8---

This is really great as each person can now have a quick overview of their
tasks and they just jave to click to get the details of the tasks!

The next step for me, would be to be able to sort this table against
priorities for instance.

If you think about a simple way of doing this, please let me know.

Regards,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [babel] References to variable block names

2011-01-12 Thread Francesco Pizzolante
Hi,

I'm trying to maintain my employees CVs in a single Org file using Babel (see
example hereunder).

For this, I created several level-1 headings, one for each employee.

Then, I have my main CV block (cv source block, see last "Composed CV"
heading) containing the layout of the CVs. This block is "called" for each
employee, in order to tangle a LaTeX file with the correct information.

Though, currently, I'm not able to use variables *in noweb references* (see my
employee variable in <>.

Could someone tell me how to have a generic solution, in this way or another?

Any other ideas regarding this are welcome!

Thanks a lot,
Francesco


--8<---cut here---start->8---
* Alex

#+srcname: cv-alex
#+begin_src latex :noweb yes :tangle alex.tex
<>
#+end_src

** Profile

#+srcname: profile-alex
#+begin_src latex
Software engineering expert.
#+end_src

** Experience

#+srcname: experience-alex
#+begin_src latex
\cventry{2007--2010}{Project Manager}{MyProject}{MyCompany}{}{}
\cventry{2005--2007}{Project Manager}{MyProject2}{MyCompany2}{}{}
#+end_src

* Albert

#+srcname: cv-albert
#+begin_src latex :noweb yes :tangle albert.tex
<>
#+end_src

** Profile

#+srcname: profile-albert
#+begin_src latex
Software engineering expert.
#+end_src

** Experience

#+srcname: experience-albert
#+begin_src latex
\cventry{2009--2010}{Developer}{MyProject}{MyCompany}{}{}
\cventry{2008--2009}{Developer}{MyProject2}{MyCompany2}{}{}
#+end_src

* Composed CV:noexport:

#+srcname: cv
#+begin_src latex :noweb yes :var v-jobtitle="Software Engineer"
\documentclass{mycvclass}
\usepackage[utf8x]{inputenc}

\firstname{v-firstname}
\familyname{v-familyname}
\jobtitle{v-jobtitle}

\begin{document}

\section{Profile}
<>

\section{Experience}
<>

\end{document}
#+end_src
--8<---cut here---end--->8---

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] References to variable block names

2011-01-13 Thread Francesco Pizzolante
Dear Eric,

Thanks for your answer.

> In your example the cv source block only seems to have a single variable
> specified with a :var header argument (namely v-jobtitle), e.g.
>
> #+srcname: cv
> #+begin_src latex :noweb yes :var v-jobtitle="Software Engineer"
> ...
> #+end_src
>
> however your example noweb reference uses 4 variables.  You will need to
> update the cv source block so that each variable is given a header
> argument.
>
> #+srcname: cv
> #+headers: :var v-firstname="Alex" :var v-familyname="Pizzo"
> #+headers: :var v-jobtitle="Project Manager" :var employee="alex"
> #+begin_src latex :noweb yes :var v-jobtitle="Software Engineer"
> ...
> #+end_src

Well, the variable replacement works even if I do not specify the variables in
a header argument. It seems to work like a simple string replace for each
'variable="value"' parameter in the noweb reference.

When I write this:

--8<---cut here---start->8---
<>
--8<---cut here---end--->8---

When I tangle/evaluate the code, it replaces any occurrence of "v-firstname"
in the cv source code by "Albert" even if the variable is not given a header
argument...

Seems like the header argument is "just" used to give a default value for the
replacement.

Is this the expected behavior?


> Then ensure that you can call the cv function using a call line, e.g.
>
> #+call: cv(v-firstname="Alex",v-familyname="Pizzo",v-jobtitle="Project 
> Manager",employee="alex")
>
> Once that is working then the noweb reference should work as well.

I tried what you say, but it seems that a variable in a noweb reference does
not get replaced by its value. From my point of view, it seems that:

- either, the noweb references are replaced before the variables get replaced
  by their values;

- or, the variable replacement does not work in noweb references.

Here's a shorter example where, whatever I try, I keep getting the Profile
section empty:

--8<---cut here---start->8---
* Alex

#+call: cv(employee="alex")

#+srcname: cv-alex
#+begin_src latex :noweb yes :tangle alex.tex
<>
#+end_src

** Profile

#+srcname: profile-alex
#+begin_src latex
Software engineering expert.
#+end_src

* Composed CV
#+srcname: cv
#+begin_src latex :noweb yes :var employee="alex"
\documentclass{mycvclass}
\usepackage[utf8x]{inputenc}

\begin{document}

\section{Profile}
<>

\end{document}
#+end_src
--8<---cut here---end--->8---

Any help is welcome.

Thanks,
Francesco

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: LaTeX export of images

2009-10-13 Thread Francesco Pizzolante
Hi Carsten,

Sorry for my late reply on this subject.

> OK, I have now modified image placement in LaTeX.
>
> 1. Image in text
>
>[[./img/x.png]]
>
> 2. Floating image with caption and modified size and placement
>
>#+CAPTION: My caption
>#+ATTR_LATEX: placement=[H] width=0.6\textwidth
>[[./img/x.png]]
>
> 3. Wrapping text around the image
>
>#+ATTR_LaTeX: wrap
>#+ATTR_HTML: align="left"
>[[./img/x.png]]
>
> 4. Wrapping text around the image with modified size and wrapfigure placement
>
>#+ATTR_LaTeX: wrap width=0.38\textwidth placement={r}{0.4\textwidth
>#+ATTR_HTML: align="right" width="250"
>[[./img/x.png]]
>
> Even if there is a caption, wrap will work and force the
> image to be non-floating with text wrapped around.
>
> Comments?

I did not test the wrap option yet, but the rest is perfect (images in text,
placements, width, captions, labels).

I still miss one single option: "float" in order to force the centered figure
environment if if no caption/label is present.

I would add something like

#+ATTR_LATEX: float

or

#+ATTR_LATEX: float=t

Is this feasible?

Thanks a lot!

Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] LaTeX export of tables

2009-10-13 Thread Francesco Pizzolante
Hi,

When exporting tables to LaTeX, I think it would be good to have the following
options to be able to define:

  - the table environment to be used: now we have the option to have tabular
and longtable, but I could also use array, tabular*, tabularx, tabulary,
etc.

The general rule is:

\begin{TABLEENV}{WIDTH}[VPOS]{COLS}
ROWS
\end{TABLEENV}

TABLEENV can be any of tabular, array, tabular*, tabularx, etc., depending
on the type of table I want.

Some types of table need a WIDTH to be specified; in this case, I would
add a WIDTH option. An extra vertical position VPOS option can also be
added to some types of table.

The COLS parameter already receives the value from the "align" org
attribute.

The following options

#+ATTR_LATEX: tabularx width=\textwidth align=lX vpos=tb

would generate the following LaTeX code:

\begin{tabularx}{\textwidth}[tb]{lX}
ROWS
\end{tabularx}


  - the rule to be used as hline (similar option as in
#+ORGTBL: :hline="\\midrule"):

#+ATTR_LATEX: hline=midrule or #+ATTR_LATEX: hline="\\midrule"


  - define the top and bottom rules:

#+ATTR_LATEX: toprule="\\toprule" bottomrule="\\bottomrule"


Does it make sense? Would it be possible to have these new options in a future
orgmode release?

Thanks a lot.
Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] LaTeX export of tables

2009-10-19 Thread Francesco Pizzolante
Hi,

Can I give this thread a bump?

Francesco Pizzolante wrote:
> Hi,
>
> When exporting tables to LaTeX, I think it would be good to have the following
> options to be able to define:
>
>   - the table environment to be used: now we have the option to have tabular
> and longtable, but I could also use array, tabular*, tabularx, tabulary,
> etc.
>
> The general rule is:
>
> \begin{TABLEENV}{WIDTH}[VPOS]{COLS}
> ROWS
> \end{TABLEENV}
>
> TABLEENV can be any of tabular, array, tabular*, tabularx, etc., depending
> on the type of table I want.
>
> Some types of table need a WIDTH to be specified; in this case, I would
> add a WIDTH option. An extra vertical position VPOS option can also be
> added to some types of table.
>
> The COLS parameter already receives the value from the "align" org
> attribute.
>
> The following options
>
> #+ATTR_LATEX: tabularx width=\textwidth align=lX vpos=tb
>
> would generate the following LaTeX code:
>
> \begin{tabularx}{\textwidth}[tb]{lX}
> ROWS
> \end{tabularx}
>
>
>   - the rule to be used as hline (similar option as in
> #+ORGTBL: :hline="\\midrule"):
>
> #+ATTR_LATEX: hline=midrule or #+ATTR_LATEX: hline="\\midrule"
>
>
>   - define the top and bottom rules:
>
> #+ATTR_LATEX: toprule="\\toprule" bottomrule="\\bottomrule"
>
>
> Does it make sense? Would it be possible to have these new options in a future
> orgmode release?

I really am eager to use orgmode in order to generate all my LaTeX documents.
But, as of now, the LaTeX export of tables offers only limited flexibility.

My proposal is simply to add a few org attributes (type of the table, toprule,
bottomrule, hline, vpos) in order to get an improved flexibility when
generating LaTeX tables.

Can someone take care of my request?

Thanks a lot,
Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Blorgit > SVN integration

2009-11-13 Thread Francesco Pizzolante
Hi,

I've started playing with Blorgit and it really looks very promising...

I have a few questions:

1) Is it possible to integrate Blorgit with SVN instead of git? If yes, how
   can I do it?

2) If I have comments in an org file, as soon as I edit the file through the
   web interface, the comments disappear (they're still present as * COMMENT
   lines in the org file though, but no longer displayed in the browser).

3) I would like to add a .pdf link (next to edit .org .tex) in order to
   download the PDF coming from the compilation (pdflatex) of the .tex file.
   Is it possible?

4) Is it possible to add a button in order to create a new file directly from
   the web interface?

Many thanks in advance for your help!

F.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Blorgit > SVN integration

2009-11-19 Thread Francesco Pizzolante
Hi Eric,

First of all, I thank you very much for your useful tips.

Thanks to you, I think I've made a step forward. Here's how.


>> 1) Is it possible to integrate Blorgit with SVN instead of git? If yes, how
>>can I do it?
>
> Yes, it should be possible to use any version control backend, the only
> command that will not work with svn is the option to automatically
> commit any edits to the git repository, however changing this command
> should be straightforward.  You should just have to make a change in
> backend/blog.rb line 15.

This is what I've added to blog.rb:

--8<---cut here---start->8---
diff --git a/backend/blog.rb b/backend/blog.rb
index 0f43728..827ec05 100644
--- a/backend/blog.rb
+++ b/backend/blog.rb
@@ -17,6 +17,20 @@ class Blog < ActiveFile::Base
 end
   end

+  # if the svn_commit option is set then add a hook to automatically
+  # commit any changes from the web interface to svn.
+  if $global_config[:config]['svn_commit']
+puts "adding svn commit hooks Blog.after_save"
+
+add_hooks(:save)
+
+def after_save
+  Dir.chdir(Blog.base_directory) do
+%x{svn add #{self.path} && svn ci -m "#{self.path} updated through the 
web interface" #{self.path}}
+  end
+end
+  end
+
   def self.files(path)
 base = (File.directory?(self.expand(path)) ? self.expand(path) : 
File.dirname(self.expand(path)))
 self.entries(path).
--8<---cut here---end--->8---

You simply need to add the "svn_commit: true" options to the blorgit.yml
config file and make your blogs directory a SVN working copy for this to work.

I do a "svn add" (in case this is a new file) followed by an "svn commit".

This works very well.

One little question: is it possible to add a comment field when editing a file
through the web interface and use that comment as the log when checking in the
file in the repository?


>> 2) If I have comments in an org file, as soon as I edit the file through the
>>web interface, the comments disappear (they're still present as * COMMENT
>>lines in the org file though, but no longer displayed in the browser).
>>
>
> Hmm, not sure about that, are you sure that you are creating the comment
> outline headings exactly how they are created when blorgit adds them
> through the web interface?

Well, the comments were added by the web interface itself (the org file was
completely edited by the web interface) and were correctly displayed as soon
as you add them. But then, they disappeared once you edited the page. When
looking at the org file, the comments were still there but no longer displayed
through the web interface.

But, this issue went away from the moment I created a brand new blogs folder.
I cannot reproduce it. I don't have any more details about this for the
moment. I will come back to you with more details if needed. Thanks for your
help.


>> 3) I would like to add a .pdf link (next to edit .org .tex) in order to
>>download the PDF coming from the compilation (pdflatex) of the .tex file.
>>Is it possible?
>
> Yes, this should certainly be possible (and please let me know if you
> succeed and I would like to add that change to the main repo).  See line
> 70 in backend/acts_as_org/lib/acts_as_org.rb, it should be fairly
> straight forward to create a to_pdf command similar to the to_tex
> command defined therein.

Here's what I did for this.

First I added the .pdf link:

--8<---cut here---start->8---
diff --git a/blorgit.rb b/blorgit.rb
index 077b5d9..93bea47 100644
--- a/blorgit.rb
+++ b/blorgit.rb
@@ -197,6 +197,8 @@ __END__
 %a{ :href => path_for(@blog, :format => 'org'), :title => 'download as 
org-mode' } .org
   %li
 %a{ :href => path_for(@blog, :format => 'tex'), :title => 'download as 
LaTeX' } .tex
+  %li
+%a{ :href => path_for(@blog, :format => 'pdf'), :title => 'download as 
PDF' } .pdf
 #title_separator

 @@ sidebar
:
--8<---cut here---end--->8---


I had to remove the first dot in the exported filenames as pdflatex doesn't
like it:

--8<---cut here---start->8---
diff --git a/Rakefile b/Rakefile
index 7c6d202..129b952 100644
--- a/Rakefile
+++ b/Rakefile
@@ -13,7 +13,7 @@ end
 Dir[File.join(File.dirname(__FILE__), "themes", "*", "*.rake")].each { |ext| 
load ext }

 # handle exported files
-def all_exported(dir) Dir.chdir($blogs){ Dir['**/.exported_*'].each{ |path| 
yield(path) } } end
+def all_exported(dir) Dir.chdir($blogs){ Dir['**/exported_*'].each{ |path| 
yield(path) } } end
 namespace :exported do
   desc "list all temporary exported files"
   task :list do

diff --git a/elisp/org-interaction.el b/elisp/org-interaction.el
index 2311156..78373df 100644
--- a/elisp/org-interaction.el
+++ b/elisp/org-interaction.el
@@ -23,7 +23,7 @@ evaluating BODY."
(kill-buffer ,temp-file)
,temp-result)))

-(de

[Orgmode] LaTeX export of section links

2009-11-20 Thread Francesco Pizzolante
Hi,

I have a few questions about links to sections.

I've read that it is better to user IDs and CUSTOM_IDs to links to section...

Here's a small example with 4 cases:

--8<---cut here---start->8---
* First
  :PROPERTIES:
  :CUSTOM_ID: heading-a
  :END:

  Hello Toto!

* Second
# <>

  Hello Tata!

* Third
#+CUSTOM_ID: heading-c

  Hello Titi!

* Fourth
#+ID: heading-d

  Hello Tete!

[[heading-a]]
[[heading-b]]
[[heading-c]]
[[heading-d]]
--8<---cut here---end--->8---

Which give the following LaTeX code:

--8<---cut here---start->8---
\section{First}
\label{sec-1}
\label{heading-a}


  Hello Toto!

\section{Second}
\label{sec-2}
\label{heading-b}


  Hello Tata!

\section{Third}
\label{sec-3}


  Hello Titi!

\section{Fourth}
\label{sec-4}


  Hello Tete!

\hyperref[sec-1]{heading-a}
\hyperref[sec-2]{heading-b}
\hyperref[sec-3]{heading-c}
\hyperref[sec-4]{heading-d}
--8<---cut here---end--->8---

The first and second cases both generate labels which are not used in LaTeX.

The third and fourth cases are very elegant as they use only aliases (which
are dropped from the LaTeX code).

My questions are:

- what's the difference between using ID and CUSTOM_ID?

- the cases "Third" and "Fourth" are the more elegant from my point of view.
  Is this the right way of doing?

- what's the difference between cases "First" and "Second" (I mean between
  using PROPERTIES and # <>)?

- in the documentation (section 4.2), we talk about "CUSTOM_ID property" does
  it mean that we should use it as in case 1?

Thanks.
Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Blorgit > SVN integration

2009-11-20 Thread Francesco Pizzolante
Hi Eric,

 1) Is it possible to integrate Blorgit with SVN instead of git? If yes, how
can I do it?
>>
>> This is what I've added to blog.rb:
>>
>> diff --git a/backend/blog.rb b/backend/blog.rb
>> index 0f43728..827ec05 100644
>> [...]
>>
> Thanks, that patch looks great.  If you don't mind I'd like to apply the
> patch to the blorgit git repository on github.  Do you have a github
> user name patch which I can use for patch authorship, or could I just
> use your name and email address?

Of course, I'll be happy to contribute. I just created a fresh account on
github (user name: fpz). Is this that you need? If not, you can use my name
but prefer this email address: francesco.pizzola...@gmail.com. Thanks.


>> One little question: is it possible to add a comment field when editing a
>> file through the web interface and use that comment as the log when
>> checking in the file in the repository?
>>
>
> That behavior is not currently part of blorgit, but it shouldn't be hard
> to add.  See lines 241 through 247 of blorgit.rb which are responsible
> for rendering the edit page.  It shouldn't be hard to add a comment
> field, and then later access that field when committing to SVN/GIT.

I will have a look at this soon.


 3) I would like to add a .pdf link (next to edit .org .tex) in order to
download the PDF coming from the compilation (pdflatex) of the .tex
file. Is it possible?
>>>
>>> Yes, this should certainly be possible (and please let me know if you
>>> succeed and I would like to add that change to the main repo).  See line
>>> 70 in backend/acts_as_org/lib/acts_as_org.rb, it should be fairly
>>> straight forward to create a to_pdf command similar to the to_tex
>>> command defined therein.
>>
>> Here's what I did for this.
>>
>> [...]
> Would it be possible to push the "dot removal" behavior into the shell
> script.  That way the files could be re-hidden behind a dot after the
> pdf export has finished.

That's an idea. I'll have a look.


> Also, rather than using a shell script, would it be possible to use the
> built in `org-export-as-pdf' function.  This may obviate the need for a
> shell script at all.  In this case you probably wouldn't need to remove
> the leading "." in the file names, and if you did, it could be done in
> elisp right around export with the `rename-file' function.

I went the shell script way because I already had a shell script for the pdf
part (with several iterations to get the references right). I will have a look
at your proposition and see if I can make it work the emacs way too...


Thanks.

Talk to you soon.

Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Bug in LaTeX export of multiple footnote references

2009-11-20 Thread Francesco Pizzolante
Hi,

Exporting multiple references to the same footnote to LaTeX lead to a wrong
generated code.

The following example:

--8<---cut here---start->8---
* Title
  This is my text[fn:1:This is my footnote.]. And another one[fn:1].
--8<---cut here---end--->8---

Will produce the following LaTeX code:

--8<---cut here---start->8---
\section{Title}
\label{sec-1}

  This is my text\footnote{This is my footnote. }. And another one\$$^{1}$\$.
--8<---cut here---end--->8---

The correct code should be:

--8<---cut here---start->8---
\section{Title}
\label{sec-1}

  This is my text\footnote{This is my footnote. }. And another one$^{1}$.
--8<---cut here---end--->8---

Regards,
Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] LaTeX export of section links

2009-11-20 Thread Francesco Pizzolante
Hi Carsten,

>> --8<---cut here---start->8---
>> * First
>>  :PROPERTIES:
>>  :CUSTOM_ID: heading-a
>>  :END:
>>
>>  Hello Toto!
>>
>> * Second
>> # <>
>>
>>  Hello Tata!
>>
>> * Third
>> #+CUSTOM_ID: heading-c
>>
>>  Hello Titi!
>>
>> * Fourth
>> #+ID: heading-d
>>
>>  Hello Tete!
>>
>> [[heading-a]]
>> [[heading-b]]
>> [[heading-c]]
>> [[heading-d]]
>> --8<---cut here---end--->8---
>>
>> Which give the following LaTeX code:
>>
>> --8<---cut here---start->8---
>> \section{First}
>> \label{sec-1}
>> \label{heading-a}
>>
>>
>>  Hello Toto!
>>
>> \section{Second}
>> \label{sec-2}
>> \label{heading-b}
>>
>>
>>  Hello Tata!
>>
>> \section{Third}
>> \label{sec-3}
>>
>>
>>  Hello Titi!
>>
>> \section{Fourth}
>> \label{sec-4}
>>
>>
>>  Hello Tete!
>>
>> \hyperref[sec-1]{heading-a}
>> \hyperref[sec-2]{heading-b}
>> \hyperref[sec-3]{heading-c}
>> \hyperref[sec-4]{heading-d}
>> --8<---cut here---end--->8---
>>
>> The third and fourth cases are very elegant as they use only aliases (which
>> are dropped from the LaTeX code).
>
> Third and forth are non-existent syntax in Org, these lines are just treated
> as comments and are removed during export.

OK. But the information in these 2 comments is correctly used to replace the
alias (heading-c and heading-d) with the label generated by org during the
export. See the last 2 references in my example: these references are correct.
They thus have been correctly processed from heading-c and heading-d to sec-3
and sec-4... these comments are thus not simply removed... right?

In the case of the :CUSTOM_ID: property, the property is also used to convert
the alias to the label (heading-a to sec-1) but additionally an extra label
(heading-a) is created and not used.

That's why, when creating references to sections I found the #+CUSTOM_ID very
elegant... But apparently I don't have to use such syntax...

I wanted to know the recommended way of doing references...

Thanks a lot for your help.

Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] LaTeX export of section links

2009-11-20 Thread Francesco Pizzolante
Carsten,

>> OK. But the information in these 2 comments is correctly used to replace the
>> alias (heading-c and heading-d) with the label generated by org during the
>> export. See the last 2 references in my example: these references are
>> correct.
>> They thus have been correctly processed from heading-c and heading-d 
>> to sec-3
>> and sec-4... these comments are thus not simply removed... right?
>
> This is only by chance, because a simple text search does match these two
> lines.
> if you'd happen to have the string headline-a anywhere in the file, the link
> would point to the enclosing section.
>
>> That's why, when creating references to sections I found the #
>> +CUSTOM_ID very
>> elegant... But apparently I don't have to use such syntax...
>
> Not if you want to have reliable links, no.

It's understood now.

Thanks a lot for your detailed answers.

Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Blorgit > Adding PDF export

2009-11-23 Thread Francesco Pizzolante
Eric,

> Also, rather than using a shell script, would it be possible to use the
> built in `org-export-as-pdf' function.  This may obviate the need for a
> shell script at all.  In this case you probably wouldn't need to remove
> the leading "." in the file names, and if you did, it could be done in
> elisp right around export with the `rename-file' function.

Regarding the addition of an extra link in order to get the PDF export, I took
your remarks into account and here's what I finally went to.

First, add the ".pdf" link to the page:

--8<---cut here---start->8---
diff --git a/blorgit.rb b/blorgit.rb
index 077b5d9..93bea47 100644
--- a/blorgit.rb
+++ b/blorgit.rb
@@ -197,6 +197,8 @@ __END__
 %a{ :href => path_for(@blog, :format => 'org'), :title => 'download as 
org-mode' } .org
   %li
 %a{ :href => path_for(@blog, :format => 'tex'), :title => 'download as 
LaTeX' } .tex
+  %li
+%a{ :href => path_for(@blog, :format => 'pdf'), :title => 'download as 
PDF' } .pdf
 #title_separator

 @@ sidebar
--8<---cut here---end--->8---


In "acts_as_org.rb", call a "org-file-to-pdf" emacs function:

--8<---cut here---start->8---
diff --git a/lib/acts_as_org.rb b/lib/acts_as_org.rb
index 458741d..8e027fc 100644
--- a/lib/acts_as_org.rb
+++ b/lib/acts_as_org.rb
@@ -80,6 +80,24 @@ PREAMBLE
   l_path = self.latex_path(path)
   File.exist?(l_path) and File.mtime(l_path) > File.mtime(path)
 end
+
+def pdf_path(path)
+  File.join(File.dirname(path),
+ActiveFile::Acts::Org::EXP_PREFIX + File.basename(path) + 
".pdf")
+end
+
+def to_pdf(path, options = {})
+  p_path = self.pdf_path(path)
+  options = {:postamble => false}.merge(options)
+  self.emacs_run("(org-file-to-pdf  \"#{path}\")") unless 
self.clean_pdf?(path)
+  return nil unless File.exist?(p_path)
+  html = File.read(p_path)
+end
+
+def clean_pdf?(path)
+  p_path = self.pdf_path(path)
+  File.exist?(p_path) and File.mtime(p_path) > File.mtime(path)
+end
   end

   module InstanceMethods
@@ -107,6 +125,19 @@ PREAMBLE
   self.class.to_latex(self.full_path, options)
 end
 alias :to_tex :to_latex
+
+def pdf_path
+  self.class.pdf_path(self.full_path)
+end
+
+def clean_pdf?
+  self.class.clean_pdf?(self.full_path)
+end
+
+def to_pdf(options = {})
+  self.class.to_pdf(self.full_path, options)
+end
+
   end
 end
   end
--8<---cut here---end--->8---


In "org-interaction.el", added the "org-file-to-pdf" function:

--8<---cut here---start->8---
diff --git a/elisp/org-interaction.el b/elisp/org-interaction.el
index 2311156..9b0d695 100644
--- a/elisp/org-interaction.el
+++ b/elisp/org-interaction.el
@@ -24,6 +24,7 @@ evaluating BODY."
,temp-result)))

 (defvar org-interaction-prefix ".exported_")
+(defvar tmp-prefix "exported_")

 (defun org-file-to-html (file-path)
   "Open up an org file, publish it to html, and then return the
@@ -65,6 +66,31 @@ latex as a string."
 (write-file latex-path)
 (kill-buffer (current-buffer)))

+(defun org-file-to-pdf (file-path)
+  "Open up an org file and export it as pdf."
+  (let* ((file-name (file-name-nondirectory file-path))
+(file-dir (file-name-directory file-path))
+(org-tmp-path (expand-file-name (concat tmp-prefix file-name ".org") 
"/tmp/"))
+(pdf-tmp-path (expand-file-name (concat tmp-prefix file-name ".pdf") 
"/tmp/"))
+(tex-tmp-path (expand-file-name (concat tmp-prefix file-name ".tex") 
"/tmp/"))
+(pdf-path (expand-file-name (concat org-interaction-prefix file-name 
".pdf") file-dir)))
+(if (and (file-exists-p pdf-path)
+(< 0 (time-to-seconds
+  (time-subtract
+   (nth 5 (file-attributes pdf-path))
+   (nth 5 (file-attributes file-path))
+   pdf-path
+  (with-temp-filebuffer
+   file-path
+   (write-file org-tmp-path)
+   (org-mode)
+   (save-window-excursion
+(org-export-as-pdf nil)
+(rename-file pdf-tmp-path pdf-path)
+(delete-file org-tmp-path)
+(delete-file tex-tmp-path)
+(kill-buffer (current-buffer)))
+
 ;; customization
 (setq org-export-blocks-witheld '(hidden comment))
--8<---cut here---end--->8---

Note that I use the /tmp folder to store temporary files without the leading
dot (the export do PDF does not work with a leading dot).

What do you think?

Thanks for your feedback.

Regards,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies 

[Orgmode] org-export-as-pdf > Removing log files

2009-11-23 Thread Francesco Pizzolante
Hi,

When removing log files, the "org-export-as-pdf" function should also delete
the ".idx" files:

--8<---cut here---start->8---
diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index ad45a21..17e038c 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -720,7 +720,7 @@ when PUB-DIR is set, use this as the publishing directory."
(error "PDF file was not produced")
   (set-window-configuration wconfig)
   (when org-export-pdf-remove-logfiles
-   (dolist (ext '("aux" "log" "out" "toc"))
+   (dolist (ext '("aux" "idx" "log" "out" "toc"))
  (setq file (concat base "." ext))
  (and (file-exists-p file) (delete-file file
   (message "Exporting to PDF...done")
--8<---cut here---end--->8---

Regards,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] org-export-as-pdf > Deleting the pdf file

2009-11-23 Thread Francesco Pizzolante
Hi,

When working with LaTeX files (and now with org files as well), we are used to
open the resulting PDF files with "Sumatra PDF" viewer. It is very handy because
it does not lock the file (like Adobe Reader) and thus enables us to recompile
it while it is still open. It is then refreshed automatically at the end of
the compilation.

While using the "org-export-as-pdf" function, we are not able to get the same
behavior as the function deletes the pdf file before the compilation. The
deletion fails because the pdf file is opened in the viewer.

Would it be possible to avoid deleting the pdf file before compilation?

--8<---cut here---start->8---
diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 5aa6409..6e1356d 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -698,7 +698,6 @@ when PUB-DIR is set, use this as the publishing directory."
   (re-search-forward "bibliography{" nil t
 cmd)
 (with-current-buffer outbuf (erase-buffer))
-(and (file-exists-p pdffile) (delete-file pdffile))
 (message "Processing LaTeX file...")
 (if (and cmds (symbolp cmds))
(funcall cmds file)
--8<---cut here---end--->8---

Thanks,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Blorgit > Adding PDF export

2009-11-23 Thread Francesco Pizzolante
Eric,

> First off this looks great.

Thanks.

> Rather than explicitly using the "/tmp" directory i would recommend
> using the `make-temp-file' function, which should work across a wider
> range of systems.  Additionally if you need to get the directory from a
> path, or combine a file-name and a directory name into a path I'd
> recommend the `expand-file-name' and `file-name-directory' functions
> respectively.
>
> With those change I would love to include this new feature into the main
> blorgit repository.

I tried to take your remarks into account as much as possible.

I only changed "org-interaction.el". Here's the diff:

--8<---cut here---start->8---
diff --git a/elisp/org-interaction.el b/elisp/org-interaction.el
index 2311156..9b785e2 100644
--- a/elisp/org-interaction.el
+++ b/elisp/org-interaction.el
@@ -65,6 +65,31 @@ latex as a string."
 (write-file latex-path)
 (kill-buffer (current-buffer)))

+(defun org-file-to-pdf (file-path)
+  "Open up an org file and export it as pdf."
+  (let* ((file-name (file-name-nondirectory file-path))
+(file-dir (file-name-directory file-path))
+(org-tmp-path (make-temp-file "org-file-to-pdf-"))
+(pdf-tmp-path (concat org-tmp-path ".pdf"))
+(tex-tmp-path (concat org-tmp-path ".tex"))
+(pdf-path (expand-file-name (concat org-interaction-prefix file-name 
".pdf") file-dir)))
+(if (and (file-exists-p pdf-path)
+(< 0 (time-to-seconds
+  (time-subtract
+   (nth 5 (file-attributes pdf-path))
+   (nth 5 (file-attributes file-path))
+   pdf-path
+  (with-temp-filebuffer
+   file-path
+   (write-file org-tmp-path)
+   (org-mode)
+   (save-window-excursion
+(org-export-as-pdf nil)
+(rename-file pdf-tmp-path pdf-path t)
+(delete-file org-tmp-path)
+(delete-file tex-tmp-path)
+(kill-buffer (current-buffer)))
+
 ;; customization
 (setq org-export-blocks-witheld '(hidden comment))
--8<---cut here---end--->8---

Is this better?

Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Blorgit > Issue with setf

2009-11-25 Thread Francesco Pizzolante
Hi,

After having updated orgmode and blorgit to their latest versions, I kept
getting the following error:

*ERROR*: Symbol's function definition is void: setf

This error was preventing the creation of any html/latex/pdf files.

After applying this patch, everything is back to normal:

--8<---cut here---start->8---
diff --git a/elisp/org-interaction.el b/elisp/org-interaction.el
index 5b4868b..6f87971 100644
--- a/elisp/org-interaction.el
+++ b/elisp/org-interaction.el
@@ -1,4 +1,5 @@
 (require 'org)
+(require 'cl)
--8<---cut here---end--->8---

Maybe cl is no longer loaded by other packages?

Thanks,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Blorgit > Issue with setf

2009-11-25 Thread Francesco Pizzolante
Hi,

After having updated orgmode and blorgit to their latest versions, I kept
getting the following error:

*ERROR*: Symbol's function definition is void: setf

This error was preventing the creation of any html/latex/pdf files.

After applying this patch, everything is back to normal:

--8<---cut here---start->8---
diff --git a/elisp/org-interaction.el b/elisp/org-interaction.el
index 5b4868b..6f87971 100644
--- a/elisp/org-interaction.el
+++ b/elisp/org-interaction.el
@@ -1,4 +1,5 @@
 (require 'org)
+(require 'cl)
--8<---cut here---end--->8---

Maybe cl is no longer loaded by other packages?

Thanks,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [PATCH] sha1 hash of latex fragments to avoid regeneration

2009-12-02 Thread Francesco Pizzolante
ocks-format-ditaa): Use sha1
>>>>> + hash keys to cache and re-use images generated by the
>>>>> + org-exp-blocks interface to ditaa and dot.
>>>>> +
>>>>> 2009-11-16  Carsten Dominik  
>>>>>
>>>>>   * org-html.el (org-export-html-home/up-format): Add an ID to the
>>>>> diff --git a/lisp/org-exp-blocks.el b/lisp/org-exp-blocks.el
>>>>> index 71e1608..72fe6c4 100644
>>>>> --- a/lisp/org-exp-blocks.el
>>>>> +++ b/lisp/org-exp-blocks.el
>>>>> @@ -217,9 +217,15 @@ Specify the path at which the image should be
>>>>> saved as the first
>>>>> element of headers, any additional elements of headers will be
>>>>> passed to the ditaa utility as command line arguments."
>>>>>  (message "ditaa-formatting...")
>>>>> -  (let ((out-file (if headers (car headers)))
>>>>> - (args (if (cdr headers) (mapconcat 'identity (cdr headers) " ")))
>>>>> - (data-file (make-temp-file "org-ditaa")))
>>>>> +  (let* ((args (if (cdr headers) (mapconcat 'identity (cdr headers)
>>>>> " ")))
>>>>> + (data-file (make-temp-file "org-ditaa"))
>>>>> + (hash (sha1 (prin1-to-string (list body args
>>>>> + (raw-out-file (if headers (car headers)))
>>>>> + (out-file-parts (if (string-match
>>>>> "\\(.+\\)\\.\\([^\\.]+\\)
>>>>> $" raw-out-file)
>>>>> + (cons (match-string 1 raw-out-file)
>>>>> +   (match-string 2 raw-out-file))
>>>>> +   (cons raw-out-file "png")))
>>>>> + (out-file (concat (car out-file-parts) "_" hash "." (cdr
>>>>> out-file-parts
>>>>>(unless (file-exists-p org-ditaa-jar-path)
>>>>>  (error (format "Could not find ditaa.jar at %s" org-ditaa-jar-
>>>>> path)))
>>>>>(setq body (if (string-match "^\\([^:\\|:[^ ]\\)" body)
>>>>> @@ -229,9 +235,21 @@ passed to the ditaa utility as command line
>>>>> arguments."
>>>>>   "\n")))
>>>>>(cond
>>>>> ((or htmlp latexp docbookp)
>>>>> -  (with-temp-file data-file (insert body))
>>>>> -  (message (concat "java -jar " org-ditaa-jar-path " " args " "
>>>>> data-file " " out-file))
>>>>> -  (shell-command (concat "java -jar " org-ditaa-jar-path " "
>>>>> args " " data-file " " out-file))
>>>>> +  (unless (file-exists-p out-file)
>>>>> +(mapc ;; remove old hashed versions of this file
>>>>> + (lambda (file)
>>>>> +   (when (and (string-match (concat (regexp-quote (car out-
>>>>> file-parts))
>>>>> +"_\\([[:alnum:]]+\\)\
>>>>> \."
>>>>> +(regexp-quote (cdr out-
>>>>> file-parts)))
>>>>> +file)
>>>>> +  (= (length (match-string 1 out-file)) 40))
>>>>> + (delete-file (expand-file-name file
>>>>> +(file-name-directory
>>>>> out-file)
>>>>> + (directory-files (or (file-name-directory out-file)
>>>>> +  default-directory)))
>>>>> +(with-temp-file data-file (insert body))
>>>>> +(message (concat "java -jar " org-ditaa-jar-path " " args "
>>>>> " data-file " " out-file))
>>>>> +(shell-command (concat "java -jar " org-ditaa-jar-path " "
>>>>> args " " data-file " " out-file)))
>>>>>  (format "\n[[file:%s]]\n" out-file))
>>>>> (t (concat
>>>>>"\n#+BEGIN_EXAMPLE\n"
>>>>> @@ -259,14 +277,32 @@ digraph data_relationships {
>>>>> }
>>>>> #+end_dot"
>>>>>  (message "dot-formatting...")
>>>>> -  (let ((out-file (if headers (car headers)))
>&

Re: [Orgmode] Blorgit > SVN integration

2009-12-03 Thread Francesco Pizzolante
Hi Eric,

>> One little question: is it possible to add a comment field when editing a 
>> file
>> through the web interface and use that comment as the log when checking in 
>> the
>> file in the repository?
>
> That behavior is not currently part of blorgit, but it shouldn't be hard
> to add.  See lines 241 through 247 of blorgit.rb which are responsible
> for rendering the edit page.  It shouldn't be hard to add a comment
> field, and then later access that field when committing to SVN/GIT.

I've added a text input in the UI:

--8<---cut here---start->8---
diff --git a/blorgit.rb b/blorgit.rb
index 93bea47..c7e4a92 100644
--- a/blorgit.rb
+++ b/blorgit.rb
@@ -245,6 +245,8 @@ __END__
 %form{ :action => path_for(@blog), :method => :post, :id => :comment_form }
   %textarea{ :id => :body, :name => :body, :rows => 28, :cols => 82 }= 
@blog.body
   %br
+  Change log:
+  %input{ :id => :change_log, :name => :change_log, :type => :text }
   %input{ :id => :submit, :name => :edit, :value => :update, :type => :submit }
   %a{ :href => path_for(@blog) } Cancel
--8<---cut here---end--->8---

But then, I have absolutely no idea on how to access that value when
committing. It should be something like this:

--8<---cut here---start->8---
diff --git a/backend/blog.rb b/backend/blog.rb
index 827ec05..555f12c 100644
--- a/backend/blog.rb
+++ b/backend/blog.rb
@@ -26,7 +26,7 @@ class Blog < ActiveFile::Base
   index: index
 def after_savee
   Dir.chdir(Blog.base_directory) do
-%x{svn add #{self.path} && svn ci -m "#{self.path} updated through the 
web interface" #{self.path}}
+%x{svn add #{self.path} && svn ci -m "#{self.path} updated through the 
web interface: #{self.change_log}" #{sel
   endt: true
 end
   end
--8<---cut here---end--->8---

I tried adding an instance method in base.rb but didn't manage to make it
work.

A little help would be welcome.

Thanks a lot,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Blorgit > SVN integration

2009-12-07 Thread Francesco Pizzolante
Hi Eric,

> Thanks for the patch.
>
> I got it working and pushed up the change to the blorgit git repository.

That's cool! Thanks for that!


> Now all we need is an interface for reviewing/reverting previous
> commits, and individual username/passwords and blorgit will be a full
> fledged wiki! :)

I was about to tell you the exact same things... :-)

F.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [PATCH] sha1 hash of latex fragments to avoid regeneration

2009-12-07 Thread Francesco Pizzolante
Eric,

> Would it be possible to switch from using org-exp-blocks to using
> org-babel?  If so then you could use org-babel's caching which does
> *not* affect the exported file name, but rather saves a sha1 key as
> (mostly) hidden text in the org-mode buffer.
>
> so for example
>
> #+BEGIN_ditaa procedure.png
>  +-+
>  | Example |
>  | |
>  |   +-+   |
>  |   | |   |
>  |   | |   |
>  |   +-+   |
>  +-+
> #+END_ditaa
>
> would be written as
>
> #+begin_src ditaa :file procedure.png :cache :exports results
>  +-+
>  | Example |
>  | |
>  |   +-+   |
>  |   | |   |
>  |   | |   |
>  |   +-+   |
>  +-+
> #+end_src
>
> and pressing C-cC-c on the block (or exporting) would result in the
> insertion of a link to the resulting image into the org-mode buffer
> behind a results line as follows -- only in org most of the hash is
> hidden.
>
> #+results[bdffac60833c9f925a52bd6617dace39832b7dda]:
> [[file:procedure.png]]

I don't see any problem in using org-babel. The only issues I see with this
solution are the following:

- when you export, no #+results line is added to the org-mode buffer;

- you, thus, have to do the C-cC-c at least once in your block to generate
  the #+results line;

- when you export (to LaTeX or PDF), the image is always re-computed (no
  caching mechanism is used), while doing C-cC-c, the caching is used.

Can you confirm these points?


> My problem with your proposed solution is that it entails storing
> information *outside* of the org-mode buffer -- which granted we are
> already doing although in a less dramatic way.  The creation of external
> files whose sole purpose is to save a hash in their filename strikes me
> as wasteful/messy.

I agree with your point. I was "simply" trying to reuse what has been done for
the caching of images in org. The org-babel solution is more elegant.

Thanks,
F.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: File modification date

2009-12-07 Thread Francesco Pizzolante
Hi,

>> DATE was implemented exactly to specify a fixed date. You can get the
>> modification date with
>>
>> {{{modification-time(%Y-%m-%d)}}}
>>
>> and the current date with
>>
>> {{{date(%Y-%m-%d)}}}
>>
>> These will be expanded upon export.  So you can, in fact, do
>>
>> #+DATE: {{{modification-time(%Y-%m-%d)}}}
>
> The problem is that the author does not see anymore the "last modification
> date", then, except in the PDF output.
>
> And, in fact, if that Org file is put under VC, you can have two people
> printing (exporting) the exact same document and it would still have a
> different date. That's because, by default, the original modification date is
> not kept on the file system when checking out a file from Subversion (my
> current VC system).
>
> To do so, one need to set to his =.subversion/config=:
>
> #+BEGIN_SRC sh
> # keep the modification time from the repository, for Makefiles, etc.
> use-commit-times = yes
> #+END_SRC
>
> So, I find it would be good for the author to see the "real" last modification
> date (which, moreover, can be different from the "copy" date of the file in
> your file system).

In the same line of thinking, it would be good to keep trace of the "real"
creation date too and, as you suggest it, by completely separating these dates
from the file system dates.

What matters here are the dates corresponding to the content of the file, not
the file itself. And those dates could be exported to the PDF as well (or
other types of exportations).

In order to clarify my point of view, I see 3 important dates to keep:

1) The creation date:

   It could be defined with

   #+CREATED: 2009-12-01 09:36  or  #+CREATION_DATE: 2009-12-01 09:36

   and, when exporting to LaTeX, it would be exported to

   \pdfinfo{/CreationDate (D:200912010936)}.

   It will then appear in the PDF properties of the exported document as

   Created: 2009/12/01 09:36:00.

   This date is defined once and never updated. It can even be added
   automatically by the C-c C-e t command when creating a new buffer.


2) The modification date:

   It could be defined with

   #+MODIFIED: 2009-12-07 16:45  or  #+MODIFICATION_DATE: 2009-12-07 16:45

   and, when exporting to LaTeX, it could be exported to

   \pdfinfo{/ModDate (D:200912071645)}.

   It will then appear in the PDF properties of the exported document as

   Modified: 2009/12/07 16:45:31.

   This is the date that you will see updated each time that you change and
   save your org buffer. It could be done automatically with org-mode.


3) The last date is the date you want to display in your document (in effect,
   the one that is exported as \date(XXX) in LaTeX).

   This date could be the last modification date (in this case, you would not
   need to specify it) or give it a fixed value (in this case, you specify it
   as it works now: #+DATE: 2009-12-09).


With these dates, a document would contain all the information regarding it's
life cycle independently of the file system. And, in addition, the information
would be propagated in the exported documents.

What do you all think?

Regards
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Exporting non utf8 org documents

2009-12-08 Thread Francesco Pizzolante
Hi,

I have colleagues who are writing Org documents with latin-1 encoding and when
I export these documents to LaTeX I run into problems, because Org assumes
utf8.

Here's a little example:

--8<---cut here---start->8---
#+LATEX_CLASS: article

* Ceci est un test

  Voici un petit texte rédigé en français.

* COMMENT Setup

# This is for the sake of Emacs.
# Local Variables:
# coding: iso-latin-1
# End:
--8<---cut here---end--->8---

The exportation to LaTeX gives the following result:

--8<---cut here---start->8---
% Created 2009-12-08 mar. 17:10
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{soul}
\usepackage{amssymb}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{listings}

\title{org-french}
\author{Francesco Pizzolante}
\date{08 décembre 2009}

\begin{document}

\maketitle

\setcounter{tocdepth}{3}
\tableofcontents
\vspace*{1cm}

\section{Ceci est un test}
\label{sec-1}


  Voici un petit texte rédigé en français.



\end{document}
--8<---cut here---end--->8---

When compiling, due to the \usepackage[utf8]{inputenc} directive, I get this
error:

ERROR: Package utf8x Error: MalformedUTF-8sequence.


In order to fix this issue, I see the following solutions:

- Would it be possible for Org to automatically get the coding system of the
  buffer and then generate the correct option for the inputenc package?

or

- Would it be possible to have a variable like #+CODING-SYSTEM: iso-latin-1
  which would be used to generate the correct option for the inputenc package?

Any other proposition or idea is welcome.

In addition, Org should use the `utf8x' option (instead of `utf8') which
enables to handle unbreakable spaces (useful in french).

Thanks.

Regards,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [babel] Executing source block which includes another block

2009-12-10 Thread Francesco Pizzolante
Hi,

Here's a small example where I'm interested both in tangling source blocks and
executing sources blocks in my org buffer:

--8<---cut here---start->8---
* Test

** Common part

#+srcname: common
#+begin_src sh :exports none :results silent
   VAR=ThisIsATest
#+end_src

** My shell script

#+srcname: script
#+begin_src sh :exports results :tangle my-script
   <>
   date
   echo $VAR
#+end_src
--8<---cut here---end--->8---


When I tangle the script block, I correctly get the following my-script.sh
file:

--8<---cut here---start->8---
#!/usr/bin/env sh
# generated by org-babel-tangle
# [[id:a0232b32-0b2c-4105-94ae-8c0f1ca67101][script]]
VAR=ThisIsATest
date
echo $VAR
# script ends here
--8<---cut here---end--->8---


When I try to execute (C-cC-c) the same script block I get the following
result:

--8<---cut here---start->8---
#+results: script
| "sh:" | "line" | "6:" | "syntax"   | "error" | "near" | "unexpected" | 
"token" | "`newline'" |
| "sh:" | "line" | "6:" | "`<>'" | ""  | "" | ""   | "" 
 | ""  |
--8<---cut here---end--->8---

The included <> block should also be executed when executing the
<

Re: [Orgmode] [babel] Executing source block which includes another block

2009-12-11 Thread Francesco Pizzolante
Hi Dan,

> Thanks for the very clear example. I believe that adding the :noweb
> header argument as below solves your problem. I'm sorry that this is not
> yet documented.

Indeed, the :noweb header argument solves my problem.
Thanks for the hint.

For my understanding, does it mean that the :noweb header argument is aimed at
doing noweb block replacements when _executing_ source blocks? Is this its
definition?

While this header argument is not needed to do noweb block replacements when
_tangling_. Is this correct?

Thanks.

Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [babel] double quotes in tables

2009-12-14 Thread Francesco Pizzolante
Hi,

Often, I find useful that babel could generate result tables without the
double quotes (") enclosing all the text values in the cells.

In order to do that, I added a 'noquotes` option to the :results header
argument.

Here's my patch. As I'm not an elisp expert, please tell me if there's a
better/safer way to do that or maybe that it already exists an option to do
that...

--8<---cut here---start->8---
diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el
index 4c9bff5..13c8237 100644
--- a/contrib/babel/lisp/org-babel.el
+++ b/contrib/babel/lisp/org-babel.el
@@ -706,6 +706,9 @@ code  the results are extracted in the syntax of the 
source
   code of the language being evaluated and are added
   inside of a #+BEGIN_SRC block with the source-code
   language set appropriately."
+  (setq outputformat "%S")
+  (if (member "noquotes" result-params)
+  (setq outputformat "%s"))
   (if (stringp result)
   (progn
 (setq result (org-babel-clean-text-properties result))
@@ -739,7 +742,7 @@ code  the results are extracted in the syntax of the 
source
 (if (and (listp (car result))
   (listp (cdr (car result
 result (list result))
-'(:fmt (lambda (cell) (format "%S" cell "\n"))
+'(:fmt (lambda (cell) (format outputformat 
cell "\n"))
(forward-line -1) (org-cycle))
   ((member "file" result-params)
(insert result))
@@ -827,7 +830,8 @@ parameters when merging lists."
   (let ((results-exclusive-groups
 '(("file" "vector" "table" "scalar" "raw" "org" "html" "latex" "code" 
"pp")
   ("replace" "silent")
-  ("output" "value")))
+  ("output" "value")
+   ("noquotes")))
(exports-exclusive-groups
 '(("code" "results" "both" "none")))
params results exports tangle cache vars var ref)
--8<---cut here---end--->8---

Thanks,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] Idiomatic handling of quotes

2009-12-18 Thread Francesco Pizzolante
Hi Thomas,

> In the example below, note that the R representation of the directory listing
> escapes the quotes in the original and encloses it all in a  second set of
> quotes, e.g. "\"theta-1.csv\"".
>
> This must come up a lot.  Is there an idiomatic way to change
> "\"theta-1.csv\"" to "theta-1.csv" so that it could be assigned to x  and the
> following statement would yield a valid path?
>
> afile <- paste("r/",x,sep="")
>
> I'm aware the answer might be R code, but it is to tightly tied to org-
> babel I figure it makes sense to ask the question here.

I already sent an email related to double quotes in result tables. See the
email hereunder.

In order to get a result table without the double quotes for all texts, I use
the patch enclosed in my email and add the ":results noquotes" header
parameter.

In your example, I would get the following result:

--8<---cut here---start->8---
#+srcname: thetas()
#+begin_src shell :results noquotes
cd r && ls theta*
#+end_src

#+results: thetas
| theta-1.csv   |
| theta-2.csv   |
--8<---cut here---end--->8---

Is this what you need?

Here's the email I sent a few days ago. It contains the patch I use to remove
the double quotes when I need it:

-
From: Francesco Pizzolante 
Subject: [Orgmode] [babel] double quotes in tables
To: mailing-list-org-mode 
Date: Mon, 14 Dec 2009 17:18:30 +0100

Hi,

Often, I find useful that babel could generate result tables without the
double quotes (") enclosing all the text values in the cells.

In order to do that, I added a 'noquotes` option to the :results header
argument.

Here's my patch. As I'm not an elisp expert, please tell me if there's a
better/safer way to do that or maybe that it already exists an option to do
that...

--8<---cut here---start->8---
diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el
index 4c9bff5..13c8237 100644
--- a/contrib/babel/lisp/org-babel.el
+++ b/contrib/babel/lisp/org-babel.el
@@ -706,6 +706,9 @@ code  the results are extracted in the syntax of the 
source
   code of the language being evaluated and are added
   inside of a #+BEGIN_SRC block with the source-code
   language set appropriately."
+  (setq outputformat "%S")
+  (if (member "noquotes" result-params)
+  (setq outputformat "%s"))
   (if (stringp result)
   (progn
 (setq result (org-babel-clean-text-properties result))
@@ -739,7 +742,7 @@ code  the results are extracted in the syntax of the 
source
 (if (and (listp (car result))
   (listp (cdr (car result
 result (list result))
-'(:fmt (lambda (cell) (format "%S" cell "\n"))
+'(:fmt (lambda (cell) (format outputformat 
cell "\n"))
(forward-line -1) (org-cycle))
   ((member "file" result-params)
(insert result))
@@ -827,7 +830,8 @@ parameters when merging lists."
   (let ((results-exclusive-groups
 '(("file" "vector" "table" "scalar" "raw" "org" "html" "latex" "code" 
"pp")
   ("replace" "silent")
-  ("output" "value")))
+  ("output" "value")
+   ("noquotes")))
(exports-exclusive-groups
 '(("code" "results" "both" "none")))
params results exports tangle cache vars var ref)
--8<---cut here---end--->8---

Thanks,
Francesco
-

Regards,
Francesco




___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Exporting non utf8 org documents

2010-01-08 Thread Francesco Pizzolante
Hi Carsten,

> here is a possible solution:
>
> Please get the latest git version of org-mode.  Then put the following code
> into
> .emacs:
>
> (defun my-org-export-latex-fix-inputenc ()
>   "Set the codingsystem in inputenc to what the buffer is."
>   (let* ((cs buffer-file-coding-system)
>  (opt (latexenc-coding-system-to-inputenc cs)))
> (when opt
>   (goto-char (point-min))
>   (while (re-search-forward "usepackage\\[\\(.*?\\)\\]
> {inputenc}"
> nil t)
> (goto-char (match-beginning 1))
> (delete-region (match-beginning 1) (match-end 1))
> (insert opt))
>   (save-buffer
>
> (eval-after-load "org-latex"
>   '(add-hook 'org-export-latex-after-save-hook
>  'my-org-export-latex-fix-inputenc))
>
> Let me know how it goes.

Thanks for your solution.

I've tested with both latin1 and utf8 Org buffers and I get the correct
encoding passed to LaTeX in both cases.

Regarding the utf8 encoding, I had a remark in my first message, which was:

>> In addition, Org should use the `utf8x' option (instead of `utf8') which
>> enables to handle unbreakable spaces (useful in french).

Could you change that too?

Thanks a lot,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] LaTeX export > Avoid \newline command after timestampsX-Draft-From: ("nnimap+mc:INBOX.sncb")

2010-03-17 Thread Francesco Pizzolante
Hi,

When exporting an Org buffer to latex, I can see that Org generates an extra
\newline command just after exporting the timestamps to the heading.

An example.

This Org stuff:
--8<---cut here---start->8---
*** DONE My Task :Be:
SCHEDULED: <2010-03-01 Mon> DEADLINE: <2010-03-05 Fri>
:LOGBOOK:
- State "STARTED"from "TODO"   [2010-03-02 Tue 09:30]
- State "DONE"   from "STARTED"[2010-03-02 Tue 10:00]
CLOCK: [2010-03-02 Tue 09:30]--[2010-03-02 Tue 10:00] =>  0:30
- PWA.
:END:
:PROPERTIES:
:Effort:   4:00
:END:
--8<---cut here---end--->8---

Is exported to latex this way:
--8<---cut here---start->8---
\subsubsection{\textbf{DONE} My Task \textbf{:Be:}}
\label{sec-2.2.2}

\texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} 
\textit{2010-03-05 Fri}\newline
--8<---cut here---end--->8---

At the end of the timestamps line, you can see the extra \newline command.

This \newline command should be removed as it adds extra vertical space which
does not respect the document class definition used for the document.

In order to do that, I made the following change to org-latex.el and it works
for me, but I'm not sure my change is completely safe:

--8<---cut here---start->8---
index 03216a8..88bd8c3 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1511,7 +1511,7 @@ The conversion is made depending of STRING-BEFORE and 
STRING-AFTER."
   (beginning-of-line 1)
   (unless (looking-at ".*newline[ \t]*$")
(end-of-line 1)
-   (insert "\\newline")
+   

 (defun org-export-latex-fixed-width (opt)
   "When OPT is non-nil convert fixed-width sections to LaTeX."
--8<---cut here---end--->8---

Is this the right thing to do to avoid this extra \newline command?

Thanks,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] LaTeX export > Avoid \newline command after timestampsX-Draft-From: ("nnimap+mc:INBOX.sncb")

2010-03-18 Thread Francesco Pizzolante
Hi,

Thanks for your remarks.

>>> thanks for this.  The reason why I put this is is to make sure that
>>> text after that line will start
>>> in a new line, and now flow into the scheduled/deadline line.   For
>>> example:
>>
>>> *** DONE My Task :Be:
>>>   SCHEDULED: <2010-03-01 Mon> DEADLINE: <2010-03-05 Fri>
>>>   this should start a new line but does not with your patch
>>
>>> Do you disagree that this is the right thing to do?  Do you know a
>>> method to achieve the same result without generating extra white
>>> space?
>>
>> We could simply insert a blank line (e.g. "\n\n"), couldn't we?  This
>> would let LaTeX start a new paragraph if there's no space between
>> scheduled/deadline line and do no harm if there is, because LaTeX
>> doesn't care about multiple newlines.
>
> Yes, we could, but what I tries was to *not* start a new paragraph...

Why not? From my point of view, the timestamps are more technical information
and the text you have after is the "real" text regarding the heading, so why
not put them on separate paragraphs?

After a few more tests, I think that David's suggestion is the best one:
having a simple blank line after the timestamps in the generated LaTex code.

This way, if we have some text in the heading, LaTex will simply start a new
paragraph and we will have the correct spacing. If don't have text in the
heading, LaTeX will simply ignore the blank line and will format the next
heading according to the document class chosen.

The problem with the actual implementation is that it forces a newline in all
cases (both if you have text in the heading or not) which does not respect the
document class formatting that you've chosen.

What do you think?

Thanks a lot,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] LaTeX export > Avoid \newline command after timestampsX-Draft-From: ("nnimap+mc:INBOX.sncb")

2010-03-18 Thread Francesco Pizzolante
Hi David,

David Maus wrote:
> Took me a while to realize the problem with current implementation: If
> you already have a blank line between scheduled/deadline line and the
> content the newline forces extra spacing between scheduled/deadline
> and the following paragraph.

I'm sorry if I wasn't clear enough.


> This cleary /is/ problem.  Maybe we should catch these two cases
> (patch attached):
>
> ,
> | (unless (and (looking-at ".*\n[ \t]*\n") (looking-at ".*newline[ 
> \t]*$"))
> `
>
> Insert \newline only if there is no paragraph separator.  As far as I
> can see the LaTeX code is already rendered when
> `org-export-latex-keywords' is called so this should work out.

I tried your patch, but I still get extra \newline commands in the generated
LaTeX.

Let's go back to examples, I think it will be easier to understand my problem.

1) Heading with no text

--8<---cut here---start->8---
** STARTED  First
   SCHEDULED: <2010-03-01 Mon> DEADLINE: <2010-03-19 Fri>
--8<---cut here---end--->8---

Gives the following:

--8<---cut here---start->8---
\subsection{\textbf{STARTED} First}
\label{sec-1.1}

   \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} 
\textit{2010-03-19 Fri}\newline
--8<---cut here---end--->8---

Which gives me an extra vertical space between this heading and the next one.

While I would expect this (with or without the extra blank line in this case,
as there's no text after):

--8<---cut here---start->8---
\subsection{\textbf{STARTED} First}
\label{sec-1.1}

   \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} 
\textit{2010-03-19 Fri}

--8<---cut here---end--->8---


2) Heading with text and no blank line between heading and text

--8<---cut here---start->8---
** STARTED  Second
   SCHEDULED: <2010-03-01 Mon> DEADLINE: <2010-03-19 Fri>
   This task is split among all services and communication between the
   entities.
--8<---cut here---end--->8---

This gives the following:

--8<---cut here---start->8---
\subsection{\textbf{STARTED} Second}
\label{sec-1.2}

   \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} 
\textit{2010-03-19 Fri}\newline\newline
   This task is split among all services and communication between the
   entities.
--8<---cut here---end--->8---

I also get an extra vertical space between the timestamps and the text which
is on a new paragraph.

Instead, I was expecting this:

--8<---cut here---start->8---
\subsection{\textbf{STARTED} Second}
\label{sec-1.2}

   \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} 
\textit{2010-03-19 Fri}

   This task is split among all services and communication between the
   entities.
--8<---cut here---end--->8---


3) Heading with text and blank line between heading and text

--8<---cut here---start->8---
** DONE Third
   DEADLINE: <2010-03-26 Fri>

   This task is split among all services and communication between the
   entities.
   Second paragraph.

   fdqsfdq
--8<---cut here---end--->8---

This gives the following:

--8<---cut here---start->8---
\subsection{\textbf{DONE} Third}
\label{sec-1.3}

   \texttt{DEADLINE:} \textit{2010-03-26 Fri}\newline

   This task is split among all services and communication between the
   entities.
   Second paragraph.

   fdqsfdq
--8<---cut here---end--->8---

In this case, again, I get an extra vertical space between the timestamps and
the text which is also in a new paragraph.

Instead, I would simply expect this:

--8<---cut here---start->8---
\subsection{\textbf{DONE} Third}
\label{sec-1.3}

   \texttt{DEADLINE:} \textit{2010-03-26 Fri}

   This task is split among all services and communication between the
   entities.
   Second paragraph.

   fdqsfdq
--8<---cut here---end--->8---


As you can see from these 3 examples, it is safer to always generate blank
lines only instead of \newline commands.

Sorry for the length of this message.

I hope, the problem is clearer now.

Please let me know what you think.

Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] LaTeX export > Avoid \newline command after timestampsX-Draft-From: ("nnimap+mc:INBOX.sncb")

2010-03-18 Thread Francesco Pizzolante
Hi David,

> Yes, sorry, my brain's logical unit misfired.  What I meant was
>
> ,
> | (unless (or (looking-at ".*\n[ \t]*\n") (looking-at ".*newline[ \t]*$"))
> `
>
> Translating to: insert /no/ \newline, if either (a) there is a empty
> line beneath this line or (b) there is already a \newline.

We're going ahead! ;-)

Your intention is also clearer for me now.

Examples 1 and 3 are OK. I still have a remark for example 2.

> 2) Heading with text and no blank line between heading and text
>
> ** STARTED  Second
>SCHEDULED: <2010-03-01 Mon> DEADLINE: <2010-03-19 Fri>
>This task is split among all services and communication between the
>entities.
>
> Gives the following:
>
> \section{STARTED  Second}
> \label{sec-2}
>
>\texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} 
> \textit{2010-03-19 Fri}\newline
>This task is split among all services and communication between the
>entities.
>
> This would be Carsten's case.

Yes, it is. ;-)


> IMO inserting a \newline after the deadline/scheduled line if text follows
> immediately (example 2) makes sense.

I'm just wondering why having a special handling for this case (the second
one). Adding a simple blank line instead of the \newline command would be
cleaner as it you would totally rely on LaTeX for the formatting.

In addition, we keep having 2 different behaviors: in example 2, the text
starts on a newline (but on the same paragraph as what comes before) while on
example 3, the text starts on a new paragraph.

See the attached picture which shows clearly the difference between the text
of section 1.2 and the text of section 1.3: for this example, I simply use the
default article formatting which uses paragraph indentation except for the
first paragraph of sections.

>From my point of view, both examples 2 and 3 should be exported the same way:
it should not matter if we have (or not) an empty line in the Org buffer between
the heading and text. While, in the LaTex code, we should always add blank
line instead of \newline commands. LaTeX will thus always put things on
separate paragraphs, which totally makes sens to me.

Does all this make sense to you?

F.
<>___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Exporting non utf8 org documents

2010-03-22 Thread Francesco Pizzolante
Hi Carsten,

I'm sorry for my very very late reply on this topic, but I'm just observing
problem with this.

> you can remove the code I sent you again, and instead grab the latest git
> release.
>
> Then you can also do
>
> (setq org-export-latex-inputenc-alist '(("utf8" . "utf8x")))
>
> to get utf8x instead of utf8.

I still get the utf8 encoding even if, as you said, I set this:

--8<---cut here---start->8---
(setq org-export-latex-inputenc-alist '(("utf8" . "utf8x")))
--8<---cut here---end--->8---


So, we get the following code:

--8<---cut here---start->8---
(defun org-export-latex-fix-inputenc ()
  "Set the codingsystem in inputenc to what the buffer is."
  (let* ((cs buffer-file-coding-system)
 (opt (or (ignore-errors (latexenc-coding-system-to-inputenc cs))
  "utf8")))
(when opt
  ;; Translate if that is requested
  (setq opt (or (cdr (assoc opt org-export-latex-inputenc-alist)) opt))
  ;; find the \usepackage statement and replace the option
  (goto-char (point-min))
  (while (re-search-forward "usepackage\\[\\(AUTO\\)\\]{inputenc}"
nil t)
(goto-char (match-beginning 1))
(delete-region (match-beginning 1) (match-end 1))
(insert opt))
  (and buffer-file-name
   (save-buffer)
--8<---cut here---end--->8---

If I print the opt variable (message opt), I can see that its value is
correctly set to utf8x.

But, the re-search-forward command always fails. In effect, if I change the
last argument from t to nil, I get the following error:

--8<---cut here---start->8---
while: Search failed: "usepackage\\[\\(AUTO\\)\\]{inputenc}"
--8<---cut here---end--->8---

I'm using an almost empty Org buffer with no option at all, so it generates a
simple article document class.

I would like to give you more input, but I don't know how to better debug
this. If you have any idea, please let me know.

Thanks a lot,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Problem exporting to LaTeX/PDF from command line

2010-04-19 Thread Francesco Pizzolante
Hi,

I'm trying to write a shell script in order to convert/export Org files to
LaTeX/PDF from the command line (org2tex/org2pdf). The whole process works
well, except that it seems that some bits of the exportation are not executed.

Here's an example of what I do.

I'm using the org-interaction.el file from Blorgit:

--8<---cut here---start->8---
(require 'org)
(require 'cl)

(setq font-lock-mode t)

(defun refresh-then-find-file (file)
  "Find file ensuring that the latest changes on disk are
represented in the file."
  (let (file-buf)
(while (setq file-buf (get-file-buffer file))
  (kill-buffer file-buf))
(find-file file)))

(defmacro with-temp-filebuffer (file &rest body)
  "Open FILE into a temporary buffer execute BODY there like
`progn', then kill the FILE buffer returning the result of
evaluating BODY."
  (let ((temp-result (make-symbol "temp-result"))
(temp-file (make-symbol "temp-file")))
`(let (,temp-result ,temp-file)
   (refresh-then-find-file ,file)
   (setf ,temp-file (current-buffer))
   (setf ,temp-result (progn ,@body))
   (kill-buffer ,temp-file)
   ,temp-result)))

;; (defvar org-interaction-prefix ".exported_")
(defvar org-interaction-prefix "")

(defun org-file-to-html (file-path)
  "Open up an org file, publish it to html, and then return the
html as a string."
  (let* ((file-name (file-name-nondirectory file-path))
 (file-dir (file-name-directory file-path))
 (html-path (expand-file-name (concat org-interaction-prefix file-name) 
file-dir)))
(if (and (file-exists-p html-path)
 (< 0 (time-to-seconds
   (time-subtract
(nth 5 (file-attributes html-path))
(nth 5 (file-attributes file-path))
html-path
  (with-temp-filebuffer
   file-path
   (org-mode)
   (save-window-excursion
 (org-export-as-html-to-buffer nil)
 (write-file html-path)
 (kill-buffer (current-buffer)))

(defun org-file-to-latex (file-path)
  "Open up an org file, publish it to latex, and then return the
latex as a string."
  (let* ((file-name (file-name-nondirectory file-path))
 (file-dir (file-name-directory file-path))
 (latex-path (expand-file-name (concat org-interaction-prefix file-name 
".tex") file-dir)))
(if (and (file-exists-p latex-path)
 (< 0 (time-to-seconds
   (time-subtract
(nth 5 (file-attributes latex-path))
(nth 5 (file-attributes file-path))
latex-path
  (with-temp-filebuffer
   file-path
   (org-mode)
   (save-window-excursion
 (org-export-as-latex-to-buffer nil)
 (write-file latex-path)
 (kill-buffer (current-buffer)))

(defun org-file-to-pdf (file-path)
  "Open up an org file and export it as pdf."
  (let* ((file-name (file-name-sans-extension file-path))
 (file-dir (file-name-directory file-path))
 (org-tmp-path (make-temp-file "org-file-to-pdf-"))
 (pdf-tmp-path (concat org-tmp-path ".pdf"))
 (tex-tmp-path (concat org-tmp-path ".tex"))
 (pdf-path (expand-file-name (concat org-interaction-prefix file-name 
".pdf") file-dir)))
(if (and (file-exists-p pdf-path)
 (< 0 (time-to-seconds
   (time-subtract
(nth 5 (file-attributes pdf-path))
(nth 5 (file-attributes file-path))
pdf-path
  (with-temp-filebuffer
   file-path
   (write-file org-tmp-path)
   (org-mode)
   (save-window-excursion
 (org-export-as-pdf nil)
 (rename-file pdf-tmp-path pdf-path t)
 (delete-file org-tmp-path)
;; (delete-file tex-tmp-path)
 (kill-buffer (current-buffer)))

;; customization
;; (setq org-export-blocks-witheld '(hidden comment))

;; Start the server
;; (server-start)

;; save the emacsclient server socket location
;; (with-temp-file "/tmp/emacsclient-socket-dir"
;;   (insert server-socket-dir))
--8<---cut here---end--->8---


Here's the file I'm trying to convert (test.org):

--8<---cut here---start->8---
#+TITLE:   Features report
#+AUTHOR:Francesco Pizzolante
#+EMAIL: f...@missioncriticalit.com
#+DATE:  2010-04-19
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE: en_US

#+LaTeX_CLASS_OPTIONS: [a4paper]

* First test
** tatatata
--8<---cut here---end--->8---


On the command line, I run the following command:

--8<---cut here---start->8---
emacs --batch -l org-interaction.el --eval "(org-file-

Re: [Orgmode] Problem exporting to LaTeX/PDF from command line

2010-04-20 Thread Francesco Pizzolante
Hi,

I forgot to mention that, of course, when I do the same operation within
Emacs, using the C-c C-e l, the file is exported without problem.

Any idea?

Thanks,
Francesco

Francesco Pizzolante wrote:
> Hi,
>
> I'm trying to write a shell script in order to convert/export Org files to
> LaTeX/PDF from the command line (org2tex/org2pdf). The whole process works
> well, except that it seems that some bits of the exportation are not executed.
>
> Here's an example of what I do.
>
> I'm using the org-interaction.el file from Blorgit:
>
> (require 'org)
> (require 'cl)
>
> (setq font-lock-mode t)
>
> (defun refresh-then-find-file (file)
>   "Find file ensuring that the latest changes on disk are
> represented in the file."
>   (let (file-buf)
> (while (setq file-buf (get-file-buffer file))
>   (kill-buffer file-buf))
> (find-file file)))
>
> (defmacro with-temp-filebuffer (file &rest body)
>   "Open FILE into a temporary buffer execute BODY there like
> `progn', then kill the FILE buffer returning the result of
> evaluating BODY."
>   (let ((temp-result (make-symbol "temp-result"))
> (temp-file (make-symbol "temp-file")))
> `(let (,temp-result ,temp-file)
>(refresh-then-find-file ,file)
>(setf ,temp-file (current-buffer))
>(setf ,temp-result (progn ,@body))
>(kill-buffer ,temp-file)
>,temp-result)))
>
> ;; (defvar org-interaction-prefix ".exported_")
> (defvar org-interaction-prefix "")
>
> (defun org-file-to-html (file-path)
>   "Open up an org file, publish it to html, and then return the
> html as a string."
>   (let* ((file-name (file-name-nondirectory file-path))
>  (file-dir (file-name-directory file-path))
>  (html-path (expand-file-name (concat org-interaction-prefix 
> file-name) file-dir)))
> (if (and (file-exists-p html-path)
>  (< 0 (time-to-seconds
>(time-subtract
> (nth 5 (file-attributes html-path))
> (nth 5 (file-attributes file-path))
> html-path
>   (with-temp-filebuffer
>file-path
>(org-mode)
>(save-window-excursion
>  (org-export-as-html-to-buffer nil)
>  (write-file html-path)
>  (kill-buffer (current-buffer)))
>
> (defun org-file-to-latex (file-path)
>   "Open up an org file, publish it to latex, and then return the
> latex as a string."
>   (let* ((file-name (file-name-nondirectory file-path))
>  (file-dir (file-name-directory file-path))
>  (latex-path (expand-file-name (concat org-interaction-prefix 
> file-name ".tex") file-dir)))
> (if (and (file-exists-p latex-path)
>  (< 0 (time-to-seconds
>(time-subtract
> (nth 5 (file-attributes latex-path))
> (nth 5 (file-attributes file-path))
> latex-path
>   (with-temp-filebuffer
>file-path
>(org-mode)
>(save-window-excursion
>  (org-export-as-latex-to-buffer nil)
>  (write-file latex-path)
>  (kill-buffer (current-buffer)))
>
> (defun org-file-to-pdf (file-path)
>   "Open up an org file and export it as pdf."
>   (let* ((file-name (file-name-sans-extension file-path))
>  (file-dir (file-name-directory file-path))
>  (org-tmp-path (make-temp-file "org-file-to-pdf-"))
>  (pdf-tmp-path (concat org-tmp-path ".pdf"))
>  (tex-tmp-path (concat org-tmp-path ".tex"))
>  (pdf-path (expand-file-name (concat org-interaction-prefix file-name 
> ".pdf") file-dir)))
> (if (and (file-exists-p pdf-path)
>  (< 0 (time-to-seconds
>(time-subtract
> (nth 5 (file-attributes pdf-path))
> (nth 5 (file-attributes file-path))
> pdf-path
>   (with-temp-filebuffer
>file-path
>(write-file org-tmp-path)
>(org-mode)
>(save-window-excursion
>  (org-export-as-pdf nil)
>  (rename-file pdf-tmp-path pdf-path t)
>  (delete-file org-tmp-path)
> ;; (delete-file tex-tmp-path)
>  (kill-buffer (current-buffer)))
>
> ;; customization
> ;; (setq org-export-blocks-witheld '(hidden comment))
>
> ;; Start the server
> ;; (server-start)
>
> ;; save the emacsclient server socket location
> ;; (with-temp-file "/tmp/emacsclient-socket-dir"
> ;;   (insert server-socket-dir)

Re: Nick Dokos: Re: [Orgmode] Problem exporting to LaTeX/PDF from command line

2010-04-22 Thread Francesco Pizzolante
Hi Nick,

Thanks a lot for having made those tests and sorry for my late reply.

I didn't have time to go the direction you suggest: I will to check my
load-path and I'll let you know.

Thanks again.

Francesco


Nick Dokos wrote:
> Talking to myself again...
>
> From:Nick Dokos 
> Subject: Re: [Orgmode] Problem exporting to LaTeX/PDF from command line
> To:  nicholas.do...@hp.com
> Date:Tue, 20 Apr 2010 11:46:41 -0400
>
>
> Nick Dokos  wrote:
>
>> Nick Dokos  wrote:
>> 
>> > Francesco Pizzolante  wrote:
>> > 
>> > > Hi,
>> > > 
>> > > I forgot to mention that, of course, when I do the same operation within
>> > > Emacs, using the C-c C-e l, the file is exported without problem.
>> > > 
>> > > Any idea?
>> > > 
>> > 
>> > I tried a little debugging on this, but I didn't get very far before I
>> > ran out of time. The re-search-forward for "#+LaTeX_CLASS_OPTIONS" in
>> > org-export-latex-set-initial-vars fails and it looks to me like a rather
>> > subtle problem: the temp file buffer looks empty. Whether that's the
>> > fault of the with-temp-file-buffer macro or something else, I'm not
>> > sure.
>> > 
>> 
>> Still not sure what is going on, but this modified org-interaction.el
>> file (it loads the necessary org-XXX.el files explicitly - be sure to
>> change the load-path appropriately) seems to work for me. I have not tried
>> to load org-XXX.elc files to see whether that works or not.
>> 
>> Nick
>> 
>> ---
>> (add-to-list 'load-path "/home/nick/src/emacs/org/org-mode/lisp")
>> ...
>
> I think that's the problem: picking up org from the *right* place works.
> Picking it up from whatever is built-in with your emacs does not. So just
> fix the load-path before you (require 'org) and all shall be well (famous
> last words...)
>
> Nick
>
>
> --
>


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Exporting customized align attribute to LaTeX

2010-05-12 Thread Francesco Pizzolante
Hi,

Exporting a customized align attribute for a table produces a wrong result.

Here's an example where I'm customizing the S column type (coming from the
siunitx package): I want to add the EUR symbol after each value in the
specified column.

--8<---cut here---start->8---
* TEST

  #+ATTR_LATEX: align=lS<{{\,\si{\EUR}}}
  | A   |  12584.35 |
  | BB  | 123456.67 |
  | CCC | 987654.32 |
--8<---cut here---end--->8---

When exporting to LaTeX, I get the following result:

--8<---cut here---start->8---
\section{TEST}
\label{sec-1}

\begin{center}
\begin{tabular}{lS<{{\}
 A&   12584.35  \\
 BB   &  123456.67  \\
 CCC  &  987654.32  \\
\end{tabular}
\end{center}
--8<---cut here---end--->8---

I should get the following for the begin{tabular} line:

--8<---cut here---start->8---
\begin{tabular}{lS<{{\,\si{\EUR}
--8<---cut here---end--->8---

Is there a way to achieve this?

Thanks,
Francesco


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[O] Filter agenda view to subtree

2011-08-10 Thread Francesco Pizzolante
Hi,

I would like to be able to filter the agenda view according to an Org file or
a subtree.

Currently, the only way to do that is:
1. change buffer,
2. go the desired one,
3. go to the desired subtree,
4. generate the agenda view restricted to the current subtree (C-c C-x <).

It would be good to have the ability (with a key binding) to filter directly
from the agenda view, selecting the subtree "à la refile" (having completion
for the files and subtrees). And then, be able to reset the filter to the
"full" view.

Is there a way to achieve this or does this corresponds to a new feature in
the agenda view?

Thanks for your help.

Francesco



[O] Bug when publishing images

2011-03-14 Thread Francesco Pizzolante
Hi,

Since this morning, I have problems exporting (inline) images.

Here's an example.

Such content in my Org buffer:

--8<---cut here---start->8---
[[file:toto.png]]
--8<---cut here---end--->8---

is exported to this HTML code:

--8<---cut here---start->8---
<img src="toto.png"  alt="toto.png" />
--8<---cut here---end--->8---

where the first and last "<" and ">" are escaped.

Could someone fix this as soon as possible?

Thanks a lot,
Francesco Pizzolante



Re: [O] Bug when publishing images

2011-03-14 Thread Francesco Pizzolante
Bastien,

>> Since this morning, I have problems exporting (inline) images.
>>
>> Here's an example.
>>
>> Such content in my Org buffer:
>>
>> [[file:toto.png]]
>>
>> is exported to this HTML code:
>>
>> toto.png
>
> Yes, this is a problem with last commit.
>
> Simply do this:
>
> ~$ git checkout HEAD~1
>
> and wait till that problem is fixed.

Thanks a lot.

Francesco



Re: [O] Bug when publishing images

2011-03-14 Thread Francesco Pizzolante
Hi David,

> At Mon, 14 Mar 2011 10:09:37 +0100,
> Francesco Pizzolante wrote:
>> Since this morning, I have problems exporting (inline) images.
>>
>> ...
>>
>> Could someone fix this as soon as possible?
>
> The joys of bleeding edget.
>
> Should be fixed by now.

Thanks for the fix. It works better now.

There's still a little problem though when adding a caption:

--8<---cut here---start->8---
#+CAPTION: toto
[[file:toto.png]]
--8<---cut here---end--->8---

This exports to the following HTML code:

--8<---cut here---start->8---

<p>
toto

--8<---cut here---end--->8---

Regards,
 Francesco



Re: [O] Bug when publishing images

2011-03-16 Thread Francesco Pizzolante
Hi David,

>> There's still a little problem though when adding a caption:
>>
>> --8<---cut here---start->8---
>> #+CAPTION: toto
>> [[file:toto.png]]
>> --8<---cut here---end--->8---
>
> Indeed.  I overlooked a stray  tag.  This one is fixed by now.

Again, thanks a lot for the fix: it's perfect at the level of the image now.

There's still a small problem with the caption being escaped (I thought it
would disappear with your previous fix, that's why I didn't add it to my
example, so here it is now).

If I have this:

--8<---cut here---start->8---
#+CAPTION: toto\trade
[[file:toto.png]]
--8<---cut here---end--->8---

It is exported to:

--8<---cut here---start->8---


toto™

--8<---cut here---end--->8---

While I would expect (and it was like that before):

--8<---cut here---start->8---


toto™

--8<---cut here---end--->8---

Thanks.

Regards,
 Francesco



Re: [O] Bug when publishing images

2011-03-21 Thread Francesco Pizzolante
Hi David,

>> >> There's still a little problem though when adding a caption:
>> >>
>> >> --8<---cut here---start->8---
>> >> #+CAPTION: toto
>> >> [[file:toto.png]]
>> >> --8<---cut here---end--->8---
>> >
>> > Indeed.  I overlooked a stray  tag.  This one is fixed by now.
>>
>> Again, thanks a lot for the fix: it's perfect at the level of the image now.
>>
>> There's still a small problem with the caption being escaped (I thought it
>> would disappear with your previous fix, that's why I didn't add it to my
>> example, so here it is now).
>
> This should be fix now.

Indeed, it is.

Thanks a lot.

Francesco



[O] HTML export > Bold and italic links

2011-03-21 Thread Francesco Pizzolante
Hi,

Exporting the following links:

--8<---cut here---start->8---
Exporting a [[http://www.google.com][*bold link*]].
Exporting a *[[http://www.google.com][bold link]]*.

Exporting an [[http://www.google.com][/italic link/]].
Exporting an /[[http://www.google.com][italic link]]/.
--8<---cut here---end--->8---

Gives the following HTML code:

--8<---cut here---start->8---

Exporting a http://www.google.com";>bold link.
Exporting a *http://www.google.com";>bold link*.


Exporting a http://www.google.com";>bold link.
Exporting a /http://www.google.com";>bold link/.

--8<---cut here---end--->8---

I Would expect the following code:

--8<---cut here---start->8---

Exporting a http://www.google.com";>bold link.
Exporting a http://www.google.com";>bold link.


Exporting a http://www.google.com";>bold link.
Exporting a http://www.google.com";>bold link.

--8<---cut here---end--->8---

As you can see, the first option (setting the bold and italic symbols *into*
the link) works, while the second one (setting the bold and italic symbols
*outside* the links) does not work.

I think both options should work. At least the second one was working last
week.

Thanks.

Francesco



[O] HTML export > Resizing an activated inline image

2011-04-06 Thread Francesco Pizzolante
Hi,

When you want to resize an inline image, you have to write something like the
following:

--8<---cut here---start->8---
#+ATTR_HTML: width=50%
[[./images/toto.png]]
--8<---cut here---end--->8---

This generates the following HTML code:

--8<---cut here---start->8---

--8<---cut here---end--->8---

Now, I would like my image to be activated and the link should point to the
image itself. So, I'm trying the following:

--8<---cut here---start->8---
#+ATTR_HTML: width=50%
[[./images/toto.png][file:./images/toto.png]]
--8<---cut here---end--->8---

But this adds the width to the anchor and not to the image:

--8<---cut here---start->8---

--8<---cut here---end--->8---

Any idea on the way to the get the following HTML code from Org?

--8<---cut here---start->8---

--8<---cut here---end--->8---

Thanks for your help.

Francesco



[O] LaTeX export of headings to lists

2011-05-27 Thread Francesco Pizzolante
Hi,

When exporting headings to LaTeX lists, I can see extra vertical blank spaces
if the headings directly starts with a sub-heading or a list. It does not
happen if you have text in your heading (before the sub-heading or the list).

Here's my ECM:

--8<---cut here---start->8---
#+OPTIONS:   H:2 num:t toc:nil

* Level 1

** Level 2

*** Level 3

 A

- A1
- A2
- A3

 B

- B1
- B2
- B3
--8<---cut here---end--->8---

When exporting this example to LaTeX, you can see that there's extra space
between:

- Level 3 and A
- A and A1
- B and B1

This happens beacause the LaTeX export adds and extra line break (\\) after
each \item in addition to the newline (\n). I thus propose the following patch
which fixes the problem:

--8<---cut here---start->8---
index 764a48d..706bb4a 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1234,7 +1234,7 @@ numbered sections and lower levels as unnumbered 
sections."
 (delete-region (point-at-bol 0) (point))
   (insert (format "\\begin{%s}\n"
   (symbol-name org-export-latex-low-levels
-(insert (format "\n\\item %s\n%s%%"
+(insert (format "\n\\item %s\n%s%%"
 heading
 (if label (format "\\label{%s}" label) "")))
 (insert (org-export-latex-content content))
--8<---cut here---end--->8---

If you don't see any problem with this fix, could you apply it?

Thanks a lot,
 Francesco Pizzolante



[O] Issue when jumping from agenda view to clock line

2012-10-24 Thread Francesco Pizzolante
Hi,

I'm having an issue when jumping from the C-c a a / v c view (check log view
in the agenda view) to a clock line.

Here's a small example.

#+begin_src org
* My tasks

** First task
   :LOGBOOK:
   CLOCK: [2012-10-22 Mon 13:00]--[2012-10-22 Mon 14:30] =>  1:00
   CLOCK: [2012-10-23 Tue 13:00]--[2012-10-23 Tue 14:30] =>  1:00
   CLOCK: [2012-10-24 Wed 13:00]--[2012-10-24 Wed 14:30] =>  1:00
   :END:
#+end_src

In the agenda view (C-c a a) for Wed 24, enable the check view (v c), then
press ENTER on the log line for "First task", you jump to the corresponding
heading (First task) but it positions the cursor just after the :LOGBOOK:
keyword and the drawer remains closed.

The previous and correct behaviour was to jump to the corresponding line (in
the example, the third clock line) in the opened drawer.

I'm using org-mode version 7.9.2 (release_7.9.2-53-g93040f).

Thanks for your help.

Francesco



Re: [O] Issue when jumping from agenda view to clock line

2012-11-16 Thread Francesco Pizzolante
Hi,

> Here's a small example.
>
> #+begin_src org
> * My tasks
>
> ** First task
>:LOGBOOK:
>CLOCK: [2012-10-22 Mon 13:00]--[2012-10-22 Mon 14:30] =>  1:00
>CLOCK: [2012-10-23 Tue 13:00]--[2012-10-23 Tue 14:30] =>  1:00
>CLOCK: [2012-10-24 Wed 13:00]--[2012-10-24 Wed 14:30] =>  1:00
>:END:
> #+end_src
>
> In the agenda view (C-c a a) for Wed 24, enable the check view (v c), then
> press ENTER on the log line for "First task", you jump to the corresponding
> heading (First task) but it positions the cursor just after the :LOGBOOK:
> keyword and the drawer remains closed.

Just to let you know that I found the issue...

It was coming from the following code I was using (taken from Worg:
http://orgmode.org/worg/org-configs/org-hooks.html):

╭
│   ;; get a compact view during follow mode in the agenda
│ (defun my-compact-follow ()
│   "Make the view compact, then show the necessary minimum."
│   (ignore-errors
│ (save-excursion
│   (while (org-up-heading-safe))
│   (hide-subtree)))
│   (let ((org-show-siblings nil)
│ (org-show-hierarchy-above t))
│ (org-reveal))
│   (save-excursion
│ (org-back-to-heading t)
│ (show-children)))
│
│(add-hook 'org-agenda-after-show-hook 'my-compact-follow)
╰

But I don't understand the cause of it.

Thanks,
 Francesco



[O] Why does export of images to LaTeX requires either org-special-blocks or org-jsinfo?

2012-11-21 Thread Francesco Pizzolante
Hi,

I have noticed that the correct export of images in LaTeX requires one of
these 2 packages: org-special-blocks or org-jsinfo.

While I cannot see any relation between these packages and the export of
images in LaTeX, if none of these 2 packages is loaded then images are
exported as \href instead of \includegraphics, in other words, as links
instead of images.

Here's the code I used to check this:

╭
│ (setq org-modules nil)
│ ;;(require 'org-special-blocks)
│ ;;(require 'org-jsinfo)
╰

Please let me know if you have any explanation to this behaviour.

Thanks a lot.

Regards,
 Francesco



Re: [O] Why does export of images to LaTeX requires either org-special-blocks or org-jsinfo?

2012-11-21 Thread Francesco Pizzolante
Hi Suvayu,

> Those modules are optional.  How do you write your links in the org
> file?  To be included in LaTeX export with includegraphics, the
> description part of the link should be empty.  e.g.
>
>   [[/path/to/image]]
>
> This creates an inline image in the final pdf.

That's exactly what I do and it works perfectly until you do this (trying to
load as few modules as possible):

╭
│ (setq org-modules nil)
╰

Then, you'll see that images will be exported as links instead of images
(\href instead of \includegraphics).

What I don't understand is that you fix the issue by loading either
org-special-blocks or org-jsinfo (uncommenting one of these 2 lines):

╭
│ (require 'org-special-blocks)
│ ;;(require 'org-jsinfo)
╰

Thus, it seems like these packages are not optional (or, at least, of the 2)
to get the correct export of inline images to LaTeX.

Any idea why this behavior?

Regards,
 Francesco



Re: [O] Why does export of images to LaTeX requires either org-special-blocks or org-jsinfo?

2012-11-21 Thread Francesco Pizzolante
Hi Achim,

> Both of these will load org-html, either directly or indirectly.  With
> that the default definition for org-export-html-inline-images comes into
> existence, which despite the name is also used for other exporters.

Thanks a lot for the explanation.

Is there a plan to make this variable independent of the html backend?

Regards,
 Francesco



Re: [O] flyspell and code blocks

2012-12-21 Thread Francesco Pizzolante
Hi,

Jambunathan K wrote:
> Julian Burgos  writes:
>
>> It is possible to make flyspell to ignore (i.e. do not spell check)
>> the text within code blocks (I mean blocks of texts separated by
>> #+begin_src and #+end src)?  I did my homework but could not find a
>> good answer.
>
> See
> http://lists.gnu.org/archive/html/help-gnu-emacs/2012-02/msg00162.html
>
> which links to the following bug report
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10804

I'm not sure whether this issue has been fixed or not.

But, while I was testing Jambunathan's following code:

╭
│ (defadvice org-mode-flyspell-verify
│   (after my-org-mode-flyspell-verify activate)
│   "Don't spell check src blocks."
│   (setq ad-return-value
│   (and ad-return-value
│(not (org-in-src-block-p))
│(not (member 'org-block-begin-line (text-properties-at (point
│(not (member 'org-block-end-line (text-properties-at (point)))
╰

I found that it only works when setting the org-src-fontify-natively variable:

╭
│(setq org-src-fontify-natively t)
╰

I hope this helps.

An even better solution would be to use flyspell-prog-mode (to spellcheck
comments and strings in source code) within the Org source blocks.

Any idea how to achieve this?

Thanks,
 Francesco



Re: [O] [PATCH] Separate file time from its tasks times

2012-04-20 Thread Francesco Pizzolante

Hi Bastien,

I'd like to give my opinion on this subject.

> The original display of the clock table with the default values
> for both options is consistent.  Putting the "File time" in a
> different column would require putting the "Total time" in yet
> another column, which IMO makes the clock table to large.

First of all, I agree with you on the fact that the current way of 
presenting the table is clear enough, at least if you keep bold 
formatting for file times.


If I understand well, Sebastien's problem is due to the fact that he has 
to remove the bold formatting in order to be able to make references to 
this table's cells (in order to use its content value in a formula).


Removing bold formatting makes things unclear as you end up with 3 
levels on the same column (grand total, file totals and first level 
heading totals). In this case, I agree with Sebastien and I would prefer 
to split the first column into 2, keeping the grand total and file 
totals on the first column.


So, in my opinion, I see 2 solutions (which are not exclusive):

1) Be able to use a cell's content value in a formula even if a special 
formatting is used in that cell; if there's already a way to achieve 
this today, please tell us...


2) Follow Sebastien's idea in order for one to choose how to display the 
first 3 levels (grand total, file times and first level heading totals): 
in either 1 or 2 or 3 columns. The default being 1 column, corresponding 
to the current behavior.


Hope this helps.

Thanks,
 Francesco



[O] Defining a new emphasis

2012-05-07 Thread Francesco Pizzolante
Hi,

I'm trying to define a new emphasis that would work like org-code (=) except
that it would export to \textsf instead of \texttt in LaTeX.

I tried several combinations using org-emphasis-alist and
org-export-latex-emphasis-alist, but I must admit that I'm lost amongst all
parameters controlling how the emphasis is processed:

- org-emphasis-alist defines a 'verbatim' optional parameter
- org-export-latex-emphasis-alist defines a protected (t/nil) parameter
- special format string like \\verb or \\protectedtexttt may also be used

Here are tests I've made (using the option ^:nil) with this reference string
=look_at:my~ti ny\reference^string=:

| verbatim | protected | format string | Resulting LaTeX code   
   | Comment
 |
|--+---+---+---+-|
| no   | nil   | \\textsf{%s}  | look\_{}at:my\~{}ti 
ny\reference\^{}string| OK except 
for the backslash |
| no   | t | \\textsf{%s}  | look_at:my~ti ny\reference^string  
   | NOT OK 
 |
| yes  | nil   | \\textsf{%s}  | look_at:my~ti ny\reference^string  
   | NOT OK 
 |
| yes  | t | \\textsf{%s}  | look_at:my~ti ny\reference^string  
   | NOT OK 
 |
| yes  | nil   | \\protectedtexttt | look\_at:my\textasciitilde\{}ti 
ny\textbackslash\{}reference\textasciicircum\{}string | NOT OK  
|
| yes  | t | \\protectedtexttt | look\_at:my\textasciitilde{}ti 
ny\textbackslash{}reference\textasciicircum{}string| OK 
 |

I would like to get the exact same output as == gives (no interpretation of
the chars I write) except that I'd like to use \textsf instead of \texttt but
I can't find the right combination for the parameters (verbatim, protected) to
achieve this goal.

Any help or comment is welcome.

Thanks a lot.

Francesco



Re: [O] Defining a new emphasis

2012-05-07 Thread Francesco Pizzolante


Hi Nicolas,

>> I'm trying to define a new emphasis 
>
> Please don't. We're in the process of hard-coding emphasis markers.

OK. Understood.


>> that would work like org-code (=) except that it would export to
>> \textsf instead of \texttt in LaTeX.
>
> If that's related to export, you can tweak the export of verbatim
> (=text=) output.
>
> For example, in the new exporter (if you use development Org, you can
> (require 'org-export) and just call M-x org-export-dispatch), it just
> means to change \texttt into \textsf through verbatim filters (list of
> function applied to the output of each verbatim object).
>
> It's a way to have the last words over export engine.
>
> Here is the code:
>
> #+begin_src emacs-lisp
> (defun my-latex-verbatim-filter (text backend info)
>   "In `e-latex' backend, change \"texttt\" into \"textsf\"."
>   ;; No change for other backends.
>   (if (not (eq backend 'e-latex)) text
> (replace-regexp-in-string "\\`texttt" "textsf" text)))
>
> (add-to-list 'org-export-filter-verbatim-functions 'my-latex-verbatim-filter)
> #+end_src
>
> If you call `org-export-dispatch' on a buffer containing:
>
>   =look_at:my~ti ny\reference^string=
>
> you will get:
>
>   \textsf{look\_at:my\textasciitilde{}ti 
> ny\textbackslash{}reference\textasciicircum{}string}

My goal is, in fact, to keep the default behavior of the '=' marker and redefine
the behavior of the '~' marker.

I'd like '~' to behave exactly the same way = does but using \textsf instead of
\texttt. Is it possible?

Thanks,
 Francesco




[Orgmode] Record extra info for each time block

2009-04-06 Thread Francesco Pizzolante
Hi,

I'm discovering org-mode and it's really great.

I'm still wondering how to do several things... like this one:
regarding a headline, it is possible to clock the amount of time
you worked on it. But sometimes, you also need to record some
other information related to that time block, for example, the
distance you had to drive to go to the meeting or some costs
(like parking costs) that you had to pay for it.

Example:

* Project1
  ** Meetings
 :LOGBOOK:
 CLOCK: [2009-03-02 mon. 10:00]--[2009-03-02 mon. 12:30] =>  2:30
> 15 kilometers
 CLOCK: [2009-03-03 tue. 09:30]--[2009-03-03 tue. 12:30] =>  3:00
> 15 kilometers + 12,00 EUR
 :END:

Is there a way to record this information? If not, what is your
advice?

Of course, it would be nice to get a final table with everything
summed up: total work, total kilometers, total fees.

Thanks in advance for your help.

F.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Record extra info for each time block

2009-04-07 Thread Francesco Pizzolante
Hi Matthew,

First of all, thanks for your quick answer.

>> But sometimes, you also need to record some other information related
>> to that time block, for example, the distance you had to drive to go
>> to the meeting or some costs (like parking costs) that you had to pay
>> for it.
>>
>> Example:
>>
>> * Project1
>>   ** Meetings
>>  :LOGBOOK:
>>  CLOCK: [2009-03-02 mon. 10:00]--[2009-03-02 mon. 12:30] =>  2:30
>> > 15 kilometers
>>  CLOCK: [2009-03-03 tue. 09:30]--[2009-03-03 tue. 12:30] =>  3:00
>> > 15 kilometers + 12,00 EUR
>>  :END:
>>
>> Is there a way to record this information? If not, what is your
>> advice?
>>
>
> You could also record this information as properties. E.g.,
>
> ,
> | * Meetings
> |   :PROPERTIES:
> |   :COLUMNS:  %30ITEM %CLOCKSUM %10distance{+} %10expenses{$}
> |   :END:
> | ** Meeting One
> |:LOGBOOK:
> |CLOCK: [2009-04-06 Mon 13:25]--[2009-04-06 Mon 14:37] =>  1:12
> |:END:
> |:PROPERTIES:
> |:distance: 15
> |:expenses: 13.45
> |:END:
> | 
> | ** Meeting Two
> |:LOGBOOK:
> |CLOCK: [2009-04-06 Mon 16:41]--[2009-04-06 Mon 18:41] =>  2:00
> |:END:
> |:PROPERTIES:
> |:distance: 28
> |:expenses: 22.31
> |:END:
> | 
> `
>
>> Of course, it would be nice to get a final table with everything
>> summed up: total work, total kilometers, total fees.
>
> If you add a column line (as in the example above) you can use column
> view (C-c C-x C-c) to get a nice overview with everything summed up in the top
> heading. Or you could capture the data in a table (C-x C-c i). E.g.,
>
> ,
> | ** Summary 
> | #+BEGIN: columnview :hlines 1 :id local
> | | ITEM   | CLOCKSUM | distance | expenses |
> | |+--+--+--|
> | | * Meetings | 3:12 |   43 |35.76 |
> | | ** Meeting One | 1:12 |   15 |13.45 |
> | | ** Meeting Two | 2:00 |   28 |22.31 |
> | #+END:
> `

Your solution is nice and works but it doesn't fit all my needs:
the distance and expense information are recorded for a headline
but it is not related to a specific "time block".

When I think a little further, I realize that it would be great
to attach information to "time blocks".

Here's, in more details, what I'd like to have. The idea is to
generate 2 views from the same set of information: the first
view would be a "per project" view and a second one, a "per day"
view.

Let's take an example.

Let's assume that we have the following headline view (with new
attributes associated to each time block, in an imaginary syntax):

--8<---cut here---start->8---

* Work for April 2009
*** Project 1
This is project 1.
* Task 11
  This is task 11.
  :LOGBOOK:
  CLOCK: [2009-04-06 mon. 10:00]--[2009-04-06 mon. 12:30] =>  2:30 + 
expense 10.00
  CLOCK: [2009-04-06 mon. 13:00]--[2009-04-06 mon. 14:00] =>  1:00 + 
distance 15
  :END:
* Task 12
  This is task 12.
  :LOGBOOK:
  CLOCK: [2009-04-06 mon. 08:00]--[2009-04-06 mon. 10:00] =>  2:00 + 
distance 5
  :END:

*** Project 2
This is project 2.
* Task 21
  This is task 21.
  :LOGBOOK:
  CLOCK: [2009-04-06 mon. 15:00]--[2009-04-06 mon. 17:00] =>  2:00
  :END:
* Task 22
  This is task 22.
  :LOGBOOK:
  CLOCK: [2009-04-06 mon. 14:00]--[2009-04-06 mon. 15:00] =>  1:00
  :END:

*** Project3
This is project 3.
* Task 31
  This is task 31.
  :LOGBOOK:
  CLOCK: [2009-04-07 tue. 08:00]--[2009-04-07 tue. 11:30] =>  3:30 + 
expense 10.00 + distance 5
  :END:

--8<---cut here---end--->8---

This project view is very important as it is the main view for
time clocking on a per project basis.

>From this single view, I would like to be able to generate 2
kinds of exportable tables (in LaTex or other documents -- not
an overlay solution like column view).

The first one would be a summary per project for April 2009 and
would be mainly used by project managers.

--8<---cut here---start->8---

|---+---+--+--|
| Description   |  Work | Distance | Expenses |
|---+---+--+--|
| * Work for April 2009 | 12:00 |   25 |20.00 |
|---+---+--+--|
| *** Project 1 |  5:30 |   20 |10.00 |
| * Task 11 |  3:30 |   15 |10.00 |
| * Task 12 |  2:00 |5 |  |
| *** Project 2 |  3:00 |  |  |
| * Task 21 |  2:00 |  |  |
| * Task 22 |  1:00 |  |  |
| *** Project 3 |  3:30 |5 |10.00 |
| * Task 31 |  3:30 |5 |10.00 |
|   |   |  |  |
|---+---+

[Orgmode] Time computation errors

2009-04-07 Thread Francesco Pizzolante
Hi,

Going on in discovering org-mode, I found 2 problems when trying
to make computations on times.

Consider the following example:

--8<---cut here---start->8---
* Test
#+COLUMNS: %25ITEM(Description)  %Time1{:} %Time2{:} %Time3{:}

#+BEGIN: columnview :hlines 1 :id local
| Description | Time1 | Time2 | Time3  |
|-+---+---+|
| * Test  |  3:30 |  3:00 | #ERROR |
| *** Item 1  | -1:30 |  1:00 | #ERROR |
| *** Item 2  |  4:00 |  2:00 | #ERROR |
#+TBLFM: $4=$2+$3
#+END:

*** Item 1
:PROPERTIES:
:Time1:-1:30
:Time2:1:00
:END:

*** Item 2
:PROPERTIES:
:Time1:4:00
:Time2:2:00
:END:
--8<---cut here---end--->8---


Problems:

1) The sum of Time1 for Test headline is wrong: 3:30 instead of
   2:30;

2) I'm unable to sum times through a formula (see Time3 column).
   The same formula works perfectly when you replace times with
   integers.

Any feedback is welcome.

Thanks,
Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Time computation errors

2009-04-07 Thread Francesco Pizzolante
Hi Bernt,

Thanks for your answer.

>> Consider the following example:
>>
>> --8<---cut here---start->8---
>> * Test
>> #+COLUMNS: %25ITEM(Description)  %Time1{:} %Time2{:} %Time3{:}
>>
>> #+BEGIN: columnview :hlines 1 :id local
>> | Description | Time1 | Time2 | Time3  |
>> |-+---+---+|
>> | * Test  |  3:30 |  3:00 | #ERROR |
>> | *** Item 1  | -1:30 |  1:00 | #ERROR |
>> | *** Item 2  |  4:00 |  2:00 | #ERROR |
>> #+TBLFM: $4=$2+$3
>> #+END:
>>
>> *** Item 1
>> :PROPERTIES:
>> :Time1:-1:30
>> :Time2:1:00
>> :END:
>>
>> *** Item 2
>> :PROPERTIES:
>> :Time1:4:00
>> :Time2:2:00
>> :END:
>> --8<---cut here---end--->8---
>>
>>
>> Problems:
>>
>> 1) The sum of Time1 for Test headline is wrong: 3:30 instead of
>>2:30;
>>
>> 2) I'm unable to sum times through a formula (see Time3 column).
>>The same formula works perfectly when you replace times with
>>integers.
>>
>> Any feedback is welcome.
>
> I don't believe negative times are supported currently.

You are probably right. The fact is that:

1) when you clock in and out, you can get negative durations (I
   know, it seems weird...) and then your clock table is wrong
   (negative duration are not taken into account when
   calculating the sums). Anyway, I think it should be good to
   support negative durations in order, for example, to compute
   differences between durations (which can lead to positive or
   negative times);

2) I'm still unable to sum positive times value in my table (see
   my problem 2) in my previous email). Is there a specific
   operator in order to sum times?

Thanks,
F.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Time computation errors

2009-04-07 Thread Francesco Pizzolante
Bernt Hansen,

Bernt Hansen wrote:
> "Francesco Pizzolante"
>  writes:
>
>>>> Problems:
>>>>
>>>> 1) The sum of Time1 for Test headline is wrong: 3:30 instead of
>>>>2:30;
>>>>
>>>> 2) I'm unable to sum times through a formula (see Time3 column).
>>>>The same formula works perfectly when you replace times with
>>>>integers.
>>>>
>>>> Any feedback is welcome.
>>>
>>> I don't believe negative times are supported currently.
>>
>> You are probably right. The fact is that:
>>
>> 1) when you clock in and out, you can get negative durations (I
>>know, it seems weird...) and then your clock table is wrong
>>(negative duration are not taken into account when
>>calculating the sums). Anyway, I think it should be good to
>>support negative durations in order, for example, to compute
>>differences between durations (which can lead to positive or
>>negative times);
>
> How do you get negative times by clocking in and out?  The only way I
> can think of that you can get negative time is if you edit the clocked
> values after they are created.  By definition you have to clock in
> _before_ you clock out (right?) so everything clocked should be 0
> minutes or positive.  Am I missing something?

Not at all, you're right: you only get negative times when you
manually edit your clocks.


>> 2) I'm still unable to sum positive times value in my table (see
>>my problem 2) in my previous email). Is there a specific
>>operator in order to sum times?
>
> I'm not sure what the answer to this is.  I use the clocking features to
> summarize time spent working on tasks in clock reports only and I've
> never had the need to deal with negative values or summing clocked
> values manually in a table.
>
> Maybe other users have experience with summing times in tables outside
> of clock reports?

On example could be to determine the difference between the
estimated effort and the time really spent. You would
necessarily end up with negative durations (supposing that some
asks took less time than the estimated effort).

Does it make sense?

Thanks,
Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Timeline view > Headers not time-sorted

2009-04-30 Thread Francesco Pizzolante
Hi,

I'm using org-mode version 6.25a and I'm getting the following
problem: in the timeline view of a single Org file, headers are
not time-sorted.

Here's an Org file example:

--8<---cut here---start->8---
* P1
  :LOGBOOK:
  CLOCK: [2009-04-30 Thu. 13:00]--[2009-04-30 Thu. 15:00] =>  2:00
  :END:

* P2
  :LOGBOOK:
  CLOCK: [2009-04-30 Thu. 10:00]--[2009-04-30 Thu. 12:00] =>  2:00
  :END:
--8<---cut here---end--->8---

With the previous Org file, I end up with the following timeline
view (C-c a L):

--8<---cut here---start->8---
---
Thursday   30 April 2009
  Clocked:   (2:00) P1
  Clocked:   (2:00) P2
--8<---cut here---end--->8---

I would expect to see P2 before P1 in the timeline.

Could you tell me what I'm doing wrong?

Thanks a lot,
Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Timeline view > Headers not time-sorted

2009-05-04 Thread Francesco Pizzolante
Hi Dominik,

Thanks for your reply.

> have you modified org-agenda-sorting strategy?  What is its
> value?

I didn't modify its value. Here it is:

((agenda time-up priority-down category-keep)
 (todo priority-down category-keep)
 (tags priority-down category-keep)
 (search category-keep))

Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Timeline view > Display total time per day

2009-05-04 Thread Francesco Pizzolante
Hi,

In the timeline view of a single Org file, I would like to
display the total amount of clocked time per day, something like
the following:

Wednesday   1 April 2009 (6:30)
  Clocked:   (0:30) P1
  Clocked:   (4:00) P2
  Clocked:   (2:00) P1
Thursday2 April 2009 (5:00)
  Clocked:   (3:00) P2
  Clocked:   (2:00) P3
etc.

Could you tell me how to achieve that?

Thanks a lot,
Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Timeline view > Headers not time-sorted

2009-05-05 Thread Francesco Pizzolante
Hi,

> Strange, because if I try your file, I get the correct
> sequence.

I finally located the problem: when I add the following line to
my .emacs file then the problem happens.

(require 'dircolors)

Without dircolors everything works fine.

Maybe you have an explanation (dircolors.el is attached)?

Thanks for your help,
Francesco


dircolors.el
Description: application/emacs-lisp
___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: LaTeX export bugs?

2009-09-15 Thread Francesco Pizzolante
Hi,

Carsten Dominik wrote:
> On Jul 1, 2009, at 10:21 PM, Sébastien Vauban wrote:
>> Other things I've noticed:
>>
>> - Even with version 6.28, the `#+TBLNAME' tag must be located in column 0
>> (at
>>  least, for the highlighting features to work)
>
> Fixed, thanks.

I'm using orgmode 6.30c and I still have this problem: if the #+TBLNAME: tag
is not located in column 0, the remote reference does not work.

Here's my little test:

#+TBLNAME: A
|   | T |
|---+---|
|   |  2.00 |
|   |  5.00 |
|---+---|
| # |  9.00 |
| ^ | total |
#+TBLFM: $2=vsum(@-...@-ii);%.2f

#+TBLNAME: price
   |T |PU | Total |
   |--+---+---|
   | 9.00 | 10.25 | 92.25 |
   |--+---+---|
#+TBLFM: @2$1=remote(A,$total);%.2f::@2$3=$1*$2;%.2f


Just add a few spaces at the first line and when you recompute the second
table you get a "Can't find remote table A" message.

Moreover, in a LaTeX environment, using the orgtbl minor mode, the
highlighting (font locking) does not work on the #+TBLNAME: line, even if
located in column 0.

Thanks.
F.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: LaTeX export bugs?

2009-09-16 Thread Francesco Pizzolante
Hi Carsten,

> indeed, it looks like I did make a mistake when recently trying to fix  
> this.
> 
> I believe I have got it right this time (current git version), please  
> verify.

It works perfectly now.

Thanks!

Francesco



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] LaTeX export of images

2009-09-22 Thread Francesco Pizzolante
Hi,

I have a question about the LaTeX export of images.

I wondering why we treat differently images with caption/label than the ones
that do not have caption/label.

I suppose that we want to make the difference between images that appear in
the middle of the text and those who will appear in a float (with possibly
label and caption).


1) Images in the middle of the text

If I have the following example:

,
| For this example, I will use this image [[myimage.png]] which is a very 
good one.
`

Then, when exported, it produces the following LaTeX code:

,
| For this example, I will the use this image
| \centerline{\includegraphics{myimage}} which is a very good one.
`

Which produces weird layout when compiled to PDF.

In this case, we should just generate \includegraphics{myimage} without the
centerline command.


2) Images in floats

In the case of floats, the correct generated code should be something like:

\begin{figure}[htb]
\centering
\includegraphics{myimage}
\label{LABEL}
\caption{CAPTION}
\end{figure}

and not

\begin{figure}[htb]
\centerline{\includegraphics{myimage}}
\label{LABEL}
\caption{CAPTION}
\end{figure}

This can also be fixed quickly I think.

Now, the question is: is it correct to identify a "float" image thanks to its
caption and label attributes? Can't we have a "float" image without label or
caption?


Thanks for your help and input.

Francesco


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] LaTeX export of images

2009-09-30 Thread Francesco Pizzolante
Hi Nick and Carsten,

First of all I thank you for your replies and the already checked-in patch.

The behavior for images inserted in the middle of a paragraph is now correct.

>> Yes sure, but what is wrong with \centerline?  does the \centering  
>> lead to a different result?

Using \centerline in the middle of a paragraph makes the image centered in the
rest of the line: if you have word before and after the image, you get first
the words before the image, then you get the image which is centered according
to the remaining space on the line, and finally the words that come after the
images are printed on the following line... it was really weird.

Now, thanks to Nick's patch the image is correctly printed in the middle of
the text.


> Currently, specifying either a #+CAPTION or a #+LABEL (or both) floats
> the image.  Absent both of these the image is inlined (although without
> the above patch, it's inlined badly).
>
> LaTeX implicitly assumes that a floating figure has a caption: that's
> where the figure number is incremented for example. Given that, it does
> not seem productive to have a separate indicator for floats.
>
> Of course, if one is willing to forego the incrementing of the counter,
> then a float without a caption is possible in LaTeX - but is it useful?
> If it is, then using the #+LABEL specifier alone is enough to float the
> image (but currently, there is a problem in org-latex in that a \caption
> is always output - but that is a minor problem, easily fixed, if so
> desired).
>
> To summarize: org-latex currently always produces a \caption which
> causes LaTeX to increment the figure counter, but also to produce
> a "Figure :" caption, even if the caption is empty. We could
> change org-latex not to produce a \caption if #+CAPTION is absent,
> but that would mean that the figure counter does not get incremented.
>
> I'm not sure that a saparate specifier is needed (it might be
> desirable only on readability grounds: saying #+FLOAT, rather than
> #+CAPTION or #+LABEL makes it a bit more obvious). These specifiers are
> per-image, afaict, not per-file/subtree. For my part, I don't
> see the need for the coarser kind of control: per-image is enough.
> But if desired, then maybe
>
> #+FLOAT: t (default nil)
>
> or perhaps better
>
> #+OPTIONS: float:t
>
> can be used for the coarser control.
>
> I hope this is clear but if there are questions, let me know. What do
> you think?

This is perfectly clear. I thought a little bit more about this and I come
with the following idea.

We should float an image by default if the image is alone on a line (with or
without caption or label). If label and caption are present than we add them
to the float. If not, we simply float the image.

An extra option like

#+OPTIONS: float:nil/t

could be used if we want to override the default behavior.

In summary:

1) an image in the middle of the text simply exports as a \includegraphics
   command (this works perfectly no, so nothing to do here);

2) an image alone on a line should be floated by default;

3) caption and label are added only if present;

4) and extra option can be used to override the default behavior determining
   if the image is floated of not.

Does all this make sense to you? Do you think this is feasible?

If you have questions, please let me know.

Regards,
Francesco



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [O] Fontification of org code block not printed

2014-08-01 Thread Francesco Pizzolante
Hi Bastien,

> This is the fault of Org.
>
> I fixed this in master by removing `org-block-background'.
>
> This is radical but I think this is really better:
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f8b42e8
>
> Sebastien, let's think about another way of getting a
> color for the background, if that's really needed.

I have to say that I'm surprised about the way this issue has been
fixed. Let me tell you why.

1) The fix 'simply' removes a useful Org functionality, which I use for
   3 years now, without providing any alternative.

2) The first approach would have been to try to fix the issue instead of
   completely removing the functionality which, as I already said, is
   present since a long time.

3) A possible workaround, without completely removing
   org-block-background, would have been to add a variable in order for
   people to activate (or de-activate) it and use it (or avoid the
   issue).

4) To conclude, according to Stefan Monnier (see his answser from
   2014-07-29 11:38), the issue is due to a bug in ps-def.el and not in
   Org:

> It's a problem in the ps-def.el code which handles the `face' property
> in a "naive" way: it fails to merge the various active face properties
> (from the various overlays and the text-property).

Could you, then, put org-block-background back and let the fix be done
in Emacs and not in Org?

Thanks a lot.

Regards,
 Francesco



[O] [BUG] S-tab shows sub-headlines of archived headlines when org-inlinetask is loaded

2014-08-06 Thread Francesco Pizzolante
Hi,

Under normal cirscumstances, S-tab does not show up sub-headlines of
archived headlines.

When 'org-inlinetask' is loaded, the behavior of S-tab changes and it
shows up sub-headlines of archived headlines (which is not what we
expect).

Here's an ECM in order to easily reproduce the issue:

--8<---cut here---start->8---
#+TITLE: ECM S-TAB

* Problem

When org-inlinetask is loaded, S-TAB displays the sublevels of ARCHIVE'd tasks!

* Example

* DONE This task is DONE, but well archived   :ARCHIVE:

** Subpoint A (BUG IF YOU SEE ME!)

** Subpoint B (BUG IF YOU SEE ME!)

* DONE This task is DONE, but not archived

** Subpoint A

** Subpoint B
--8<---cut here---end--->8---

Thanks for your help.

Regards,
 Francesco



[O] Disabling figure numbers

2014-09-04 Thread Francesco Pizzolante
Hi,

Currently, with the latest Elpa version, when exporting Org buffers to
HTML generates figure numbers for images having a caption.

How can I disable this behavior in order to get images with captions but
without figure numbers?

Thanks a lot.

Regards,
 Francesco



[O] [BUG] Entries from Org code blocks appear in agenda

2014-09-04 Thread Francesco Pizzolante
Hi,

I noticed that entries from Org code blocks are erroneously displayed in
the agenda.

Here's a very simple Org example in order to reproduce it
(my-simple-test.org):

--8<---cut here---start->8---
* Test

#+BEGIN_SRC org
,SCHEDULED: <2014-09-04 Thu 10:00>
#+END_SRC
--8<---cut here---end--->8---

The minimal Emacs configuration used to reproduce the issue is
(my-simple-test.el):

--8<---cut here---start->8---
(setq org-agenda-files '("~/my-simple-test.org"))
--8<---cut here---end--->8---

And Emacs (my version is 24.3.1) is started with the following command:

--8<---cut here---start->8---
emacs -Q -l my-simple-test.el
--8<---cut here---end--->8---

If you run M-x org-agenda > a, you can see that the Test entry appears
in today's agenda, which is, of course, wrong (see issue here:
http://screencast.com/t/0bhud8qPxxj).

Regards,
 Francesco



Re: [O] [BUG] Entries from Org code blocks appear in agenda

2014-09-09 Thread Francesco Pizzolante


Hi Nicolas,

>> I noticed that entries from Org code blocks are erroneously displayed in
>> the agenda.
>>
>> Here's a very simple Org example in order to reproduce it
>> (my-simple-test.org):
>>
>> * Test
>>
>> #+BEGIN_SRC org ,SCHEDULED: <2014-09-04 Thu 10:00> #+END_SRC
>
> This is a known bug that would require to use the parser in
> "org-agenda.el" for a proper fix.
>
> Meanwhile, I wrote a workaround. Would you mind testing it (note: it
> applies on maint, probably not on master without conflicts).

Thanks for the patch.

I just applied and tested it on org-plus-contrib-20140908 from Elpa but
the workaround does not work as I can still see the erroneous headings
appearing in the agenda.

Regards,
 Francesco




[O] [bug] Alignment bug in clock tables

2014-10-02 Thread Francesco Pizzolante
Hi,

I'm having an alignment issue in clock tables, both in the agenda and in
dynamic blocks.

By default, \emsp is displayed in clock tables for level 2 (or above) to
indent headings. To avoid that, I set the variable `org-pretty-entities'
to t, and in this case the alignment of the table is broken when you
regenerate it.

I currently see no solution if I want correct alignment in clock tables
without seeing \emsp.

Any idea how to achieve that?

Here's a small screen capture that shows the issue:
http://screencast.com/t/qpmxDV8R543G

Thanks.

 Francesco



Re: [O] [bug] Alignment bug in clock tables

2014-10-16 Thread Francesco Pizzolante
Hi Joost,

> I reported this on September 2nd too. Hitting C-c C-c inside the table
> fixes the formatting. Also moving to a position inside the table and
> doing: M-x org-table-align fixes the formatting. Hence
> I tried to create a new formatter function in order to re-align after
> writing the table:
>
> (defun my-formatter( ipos tables params )
>   (progn
> (org-clocktable-write-default ipos tables params)
> (forward-line 2)
> (org-table-align)
> )
>   )
>
> and install this as the formatter, but it didn't help. If it would have
> helped, I could have fixed the default table-writer by adding
> (org-table-align). 
>
> Anyone an idea?

On my side, I tried another *workaround*: I call (org-table-align) in
a before-save-hook. This way, all tables are correctly aligned when
I save. I simply call:

(org-table-map-tables 'org-table-align t)

But this only works when you save and thus only for file buffers (and
you can still see the misalignment when you create/update the dynamic
blocks).

Currently I have no solution for agenda buffers when displaying clock
tables.

Any hint to fix this is welcome.

Regards,
 Francesco



[O] [PATCH] Avoid all modification hooks in org-unmodified

2013-01-30 Thread Francesco Pizzolante
Hello,

I've changed org-unmodified in order to avoid all modification hooks to be
called (not only before-change-functions and after-change-functions, but also
first-change-hook).

I've used inhibit-modification-hooks as described here:
http://www.gnu.org/software/emacs/manual/html_node/elisp/Change-Hooks.html

In my case, this positively impacts the loading of the agenda.

Regards,
 Francesco

>From 173526db9d9b925e9eb568a725647e4065f0e27c Mon Sep 17 00:00:00 2001
From: Francesco Pizzolante 
Date: Wed, 30 Jan 2013 16:09:22 +0100
Subject: [PATCH] Avoid all modification hooks in org-unmodified

* org-macs.el (org-unmodified): Avoid all modification hooks in org-unmodified

TINYCHANGE
---
 lisp/org-macs.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index a44bdbe..ceee306 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -93,7 +93,7 @@ Also, do not record undo information."
   `(set-buffer-modified-p
 (prog1 (buffer-modified-p)
   (let ((buffer-undo-list t)
-   before-change-functions after-change-functions)
+   (inhibit-modification-hooks t))
,@body
 (def-edebug-spec org-unmodified (body))
 
-- 
1.7.9




[O] [PATCH] Avoid modification hooks in org-clock-sum

2013-01-31 Thread Francesco Pizzolante
Hello,

This patch avoid modification hooks to be run in org-clock-sum by using
org-unmodified (instead of simply saving and restoring buffer-modified-p).

On my system, this speeds up the creation of clock reports.

I should have indented the code but I didn't in order to respect the
less-than-20-lines change (I have no copyright assignment to the FSF yet).

Regards,
 Francesco

>From b328fadfbc76143ab86286f8a9939fa2c49ba186 Mon Sep 17 00:00:00 2001
From: Francesco Pizzolante 
Date: Wed, 30 Jan 2013 17:21:42 +0100
Subject: [PATCH] Avoid Protect org-clock-sum using org-unmodified

* org-clock.el (org-clock-sum): Avoid modification hooks in org-clock-sum

TINYCHANGE
---
 lisp/org-clock.el |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 7bd5b5a..945fcd0 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1675,8 +1675,8 @@ each headline in the time range with point at the 
headline.  Headlines for
 which HEADLINE-FILTER returns nil are excluded from the clock summation.
 PROPNAME lets you set a custom text property instead of :org-clock-minutes."
   (interactive)
-  (let* ((bmp (buffer-modified-p))
-(re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*"
+  (org-unmodified
+(let* ((re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*"
 org-clock-string
 "[ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[ 
\t]+\\([0-9]+\\):\\([0-9]+\\)\\)"))
 (lmax 30)
@@ -1753,8 +1753,7 @@ PROPNAME lets you set a custom text property instead of 
:org-clock-minutes."
  (setq t1 0)
  (loop for l from level to (1- lmax) do
(aset ltimes l 0)))
-  (setq org-clock-file-total-minutes (aref ltimes 0)))
-(set-buffer-modified-p bmp)))
+   (setq org-clock-file-total-minutes (aref ltimes 0))
 
 (defun org-clock-sum-current-item (&optional tstart)
   "Return time, clocked on current item in total."
-- 
1.7.9



[O] [PATCH] Protect org-agenda-prepare-buffers with org-unmodified

2013-01-31 Thread Francesco Pizzolante
Hello,

This patch protects changes done in org-agenda-prepare-buffers with
org-unmodified instead of saving/restoring buffer-modified-p. This avoids
modification hooks to run.

Regards,
 Francesco

>From 6ce481a40a64510d67708ca63d27bdb434ee3e5a Mon Sep 17 00:00:00 2001
From: Francesco Pizzolante 
Date: Thu, 31 Jan 2013 16:35:31 +0100
Subject: [PATCH] Protect org-agenda-prepare-buffers with org-unmodified

* org.el (org-agenda-prepare-buffers): stable 

TINYCHANGE
---
 lisp/org.el |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index ca751a7..a578371 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17008,7 +17008,7 @@ When a buffer is unmodified, it is just killed.  When 
modified, it is saved
(inhibit-read-only t)
(org-inhibit-startup org-agenda-inhibit-startup)
(rea (concat ":" org-archive-tag ":"))
-   bmp file re)
+   file re)
 (save-excursion
   (save-restriction
(while (setq file (pop files))
@@ -17018,7 +17018,7 @@ When a buffer is unmodified, it is just killed.  When 
modified, it is saved
  (org-check-agenda-file file)
  (set-buffer (org-get-agenda-file-buffer file)))
(widen)
-   (setq bmp (buffer-modified-p))
+   (org-unmodified
(org-refresh-category-properties)
(org-refresh-properties org-effort-property 'org-effort)
(org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
@@ -17045,8 +17045,7 @@ When a buffer is unmodified, it is just killed.  When 
modified, it is saved
   org-comment-string))
  (while (re-search-forward re nil t)
(add-text-properties
-(match-beginning 0) (org-end-of-subtree t) pc)))
-   (set-buffer-modified-p bmp)
+(match-beginning 0) (org-end-of-subtree t) pc
 (setq org-todo-keywords-for-agenda
   (org-uniquify org-todo-keywords-for-agenda))
 (setq org-todo-keyword-alist-for-agenda
-- 
1.7.9



Re: [O] [PATCH] Avoid all modification hooks in org-unmodified

2013-01-31 Thread Francesco Pizzolante


Hi Bastien,

> This is great.  It's not only more efficient but also more
> consistent.  Thanks a lot for joining the "agenda optimization
> gang" with such a contribution!  I applied your patch, with
> a tiny change in the ChangeLog.

Thanks for your message and for having applied the patch.
I'm happy that it effectively helps.

I've also noticed several other spots where org-unmodified should be used
instead of simply saving and restoring buffer-modified-p.

I will submit another tiny patch in order for you to see.

Regards,
 Francesco




Re: [O] [PATCH] Avoid modification hooks in org-clock-sum

2013-01-31 Thread Francesco Pizzolante


Hi Bastien,

> Applied, thanks.

Thanks to you.


> Please let me know if you want to assign your copyright for
> further patches -- the limit is cumulative over patches.

I just introduced a request to the FSF.

Regards,
 Francesco




[O] Visibility cycling applied on several windows

2013-04-02 Thread Francesco Pizzolante
Hi,

If you have 2 windows opened with the same Org buffer, when you use a
visibility cycling command (TAB, S-TAB, etc.), it changes the visibility in
both windows, while you would expect the visibility being changed only in the
active windows (not in both windows).

Is there a way to restrict the visibility cycling only to the active window?

Thanks a lot for your help.

Regards,
 Francesco




Re: [O] Visibility cycling applied on several windows

2013-04-02 Thread Francesco Pizzolante
Hi Christopher and Thorsten,

Thanks for your replies.

Christopher Schmidt wrote:
> Thorsten Jolitz  writes:
>> maybe this is what you need (untested):
>>
>> http://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html
>
> No, an indirect buffer shares its parent's text properties.

It's true: the indirect buffer shares its parent's text properties.

But, the visibility cycling is applied only in the active window: either in
the main buffer or in the indirect buffer but not in both windows at the same
time. So, it works as expected to me. Thanks for the trick!

But this trick seems like a workaround to me : using visibility cycling in one
window should not affect another window, isn't it?

Thanks for your help.

 Francesco



[O] [PATCH] Normalize the construction of outline-container DIV ID

2013-04-09 Thread Francesco Pizzolante
Hi,

I found that, when exporting to HTML, outline-container IDs are not always
built the same way:

- if the headline has an Org ID it is build using that ID:
  outline-container-ID;

- if the headline does not have an Org ID, then the outline-container DIV will
  use the headline number instead (outline-container-X) while the ID of the
  inner headline is sec-X.

I propose a patch to always build the outline-container DIV ID the same way by
using the inner headline ID (when exporting to HTML).

Regards,
 Francesco

>From 0e84e6ce8b808f15b0b84cc575b6d9eeb9e374b4 Mon Sep 17 00:00:00 2001
From: Francesco Pizzolante 
Date: Tue, 9 Apr 2013 13:38:19 +0200
Subject: [PATCH] Normalize the construction of outline-container DIV ID

* ox-html.el (org-html-headline): Normalize the construction of
  outline-container DIVs by always using the inner headline ID.

TINYCHANGE
---
 lisp/ox-html.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 39b0ec9..fe7b822 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2194,7 +2194,7 @@ holding contextual information."
  "div")
(format "outline-container-%s"
(or (org-element-property :CUSTOM_ID headline)
-   section-number))
+   (concat "sec-" section-number)))
(concat (format "outline-%d" level1) (and extra-class " ")
extra-class)
(format "\n%s%s\n"
--
1.7.9



[O] Indentation of code blocks within lists

2013-05-13 Thread Francesco Pizzolante
Hi All,

I'd like to let you know about issues I'm having while trying to put source
code blocks within lists.

Here's my example and how I indent it:

--8<---cut here---start->8---
* First situation

- My first bullet

  We need to do this:

  #+begin_src emacs-lisp
  (message "this is a string")
  (defun x()
"Doc..."
(interactive)
(message "hello"))
  #+end_src

- My second bullet

  #+begin_src emacs-lisp
  "test"
  #+end_src

  #+results:
  : test

  - Sub-point of second bullet

We need to do this as well:

#+begin_src emacs-lisp
(sort)
#+end_src
--8<---cut here---end--->8---

This way if indenting code blocks has the following advantages:

- it looks nice;

- thanks to the indentation, you directly know at which list level the code
  block belongs to;

- you can easily use Emacs commands (like `C-x TAB') on regions or Org
  promote/demote commands on items or subtrees to edit and reorganize your
  text: "relative" indentation is preserved in all cases.

But, I have 2 issues with it:

- when using `C-c '' (`org-edit-special'), I see spaces before my code, while
  I would expect to see my code starting at column 0 in the edit buffer (the
  "reference" column for the "margin" being, here, the column with the '#'
  from '#+begin_src';

- when exporting, the spaces from column 0 to the start of my code are also
  exported, while I would again expect these spaces to be ignored for the
  export.

The only way I found to fix these issues is to edit my text like this (and
make any code to start in column 0):

--8<---cut here---start->8---
- My first bullet

  We need to do this:

  #+begin_src emacs-lisp
(message "this is a string")
(defun x()
  "Doc..."
  (interactive)
  (message "hello"))
  #+end_src

- My second bullet

  #+begin_src emacs-lisp
"test"
  #+end_src

  #+results:
  : test

  - Sub-point of second bullet

We need to do this as well:

#+begin_src emacs-lisp
(sort)
#+end_src
--8<---cut here---end--->8---

But:

- as you can see, the text does not look anymore as nice as in the previous
  example;

- I'm no longer able to edit and reorganize the text using Emacs `C-x TAB'
  command. That command becomes "forbidden" as it can't correctly respect the
  indentation requirements:

  + starting at column 0 for code;

  + relative for list items (depending on their depth);

- even Org promote/demote commands are buggy in this case: as a simple
  example, when I try to promote (with M-Shift-Left) the last point "Sub-point
  of second bullet" I get an error ("indent-line-to: Wrong type argument:
  wholenump, -2" ) and the following half-baked result:

--8<---cut here---start->8---
  - Sub-point of second bullet

We need to do this:

#+begin_src emacs-lisp
(sort)
  #+end_src
--8<---cut here---end--->8---

  The "#+end_src" line got misaligned.

So, my question is the following: is there a way to edit my text as shown in
the first example and edit/export it ignoring the "margin" spaces?

Any help is welcome.

Thanks a lot,
 Francesco



Re: [O] Indentation of code blocks within lists

2013-05-21 Thread Francesco Pizzolante
Hi,

May I bump up this thread?

Thanks,
 Francesco

"Francesco Pizzolante" wrote:
> Hi All,
>
> I'd like to let you know about issues I'm having while trying to put source
> code blocks within lists.
>
> Here's my example and how I indent it:
>
> * First situation
>
> - My first bullet
>
>   We need to do this:
>
>   #+begin_src emacs-lisp
>   (message "this is a string")
>   (defun x()
> "Doc..."
> (interactive)
> (message "hello"))
>   #+end_src
>
> - My second bullet
>
>   #+begin_src emacs-lisp
>   "test"
>   #+end_src
>
>   #+results:
>   : test
>
>   - Sub-point of second bullet
>
> We need to do this as well:
>
> #+begin_src emacs-lisp
> (sort)
> #+end_src
>
> This way if indenting code blocks has the following advantages:
>
> - it looks nice;
>
> - thanks to the indentation, you directly know at which list level the code
>   block belongs to;
>
> - you can easily use Emacs commands (like `C-x TAB') on regions or Org
>   promote/demote commands on items or subtrees to edit and reorganize your
>   text: "relative" indentation is preserved in all cases.
>
> But, I have 2 issues with it:
>
> - when using `C-c '' (`org-edit-special'), I see spaces before my code, while
>   I would expect to see my code starting at column 0 in the edit buffer (the
>   "reference" column for the "margin" being, here, the column with the '#'
>   from '#+begin_src';
>
> - when exporting, the spaces from column 0 to the start of my code are also
>   exported, while I would again expect these spaces to be ignored for the
>   export.
>
> The only way I found to fix these issues is to edit my text like this (and
> make any code to start in column 0):
>
> - My first bullet
>
>   We need to do this:
>
>   #+begin_src emacs-lisp
> (message "this is a string")
> (defun x()
>   "Doc..."
>   (interactive)
>   (message "hello"))
>   #+end_src
>
> - My second bullet
>
>   #+begin_src emacs-lisp
> "test"
>   #+end_src
>
>   #+results:
>   : test
>
>   - Sub-point of second bullet
>
> We need to do this as well:
>
> #+begin_src emacs-lisp
> (sort)
> #+end_src
>
> But:
>
> - as you can see, the text does not look anymore as nice as in the previous
>   example;
>
> - I'm no longer able to edit and reorganize the text using Emacs `C-x TAB'
>   command. That command becomes "forbidden" as it can't correctly respect the
>   indentation requirements:
>
>   + starting at column 0 for code;
>
>   + relative for list items (depending on their depth);
>
> - even Org promote/demote commands are buggy in this case: as a simple
>   example, when I try to promote (with M-Shift-Left) the last point "Sub-point
>   of second bullet" I get an error ("indent-line-to: Wrong type argument:
>   wholenump, -2" ) and the following half-baked result:
>
>   - Sub-point of second bullet
>
> We need to do this:
>
> #+begin_src emacs-lisp
> (sort)
>   #+end_src
>
>   The "#+end_src" line got misaligned.
>
> So, my question is the following: is there a way to edit my text as shown in
> the first example and edit/export it ignoring the "margin" spaces?
>
> Any help is welcome.
>
> Thanks a lot,
>  Francesco



Re: [O] Indentation of code blocks within lists

2013-05-24 Thread Francesco Pizzolante


Hi Nicolas,

> I also cannot reproduce OP's problem. It may be related to
> `org-src-preserve-indentation' value.

Thanks for your answer.

I checked the `org-src-preserve-indentation' variable and saw that it was non
`nil'.

Setting this variable to `nil' fixes the demonstrated issue. But, even then, I
still have an indentation problem.

In the following example (with `org-src-preserve-indentation' set to `nil'):

- in the first headline, I have a code block in a list which is correctly
  exported ignoring the spaces due to the indentation of the Org list;

- in the second headline, I have the same source code but it is split in
  several code blocks in order to better document it. The last 2 blocks are
  not correctly exported as *all spaces before the code* (even those I
  manually added) are ignored.

--8<---cut here---start->8---
* First situation

My list:

- Example which works

  #+begin_src emacs-lisp
  (if complex-condition
  then-block
else-block)
  #+end_src

* Second situation

My list:

- Example which does not work anymore

  #+begin_src emacs-lisp
  (if complex-condition
  #+end_src

  The "then" block does this:

  #+begin_src emacs-lisp
  then-block
  #+end_src

  The else-block does that:

  #+begin_src emacs-lisp
else-block)
  #+end_src
--8<---cut here---end--->8---

I think that only the spaces due to the Org indentation (here the number of
spaces before the `#' which delimits the source block, hence 2 spaces) should
be ignored.

IOW, just the "margin" should be removed, and the margin is (IMO) defined as
the spaces from column 0 up to the `#' character.

Thanks for your help.

Regards,
 Francesco





Re: [O] Indentation of code blocks within lists

2013-05-27 Thread Francesco Pizzolante


Hi Nicolas,

> I have pushed a fix on maint (at least for the export part, the source
> editing one is another story). Could you confirm it behaves as expected?

Thanks a lot for your fix: it now works as expected.

Regards,
 Francesco




[O] ATTR_LATEX not being applied on dynamic blocks

2013-09-03 Thread Francesco Pizzolante
Hi,

I have an issue with ATTR_LATEX attributes not being applied to the clocktable
dynamic block.

This issue is similar to the one exposed by Sebastien in his post [1], so I took
his ECM and modified it a little bit.

Here's it is:

--8<---cut here---start->8---
#+LATEX_HEADER: \usepackage{tabularx}

* Tasks

Some tasks with CLOCK lines.

** Design

*** TODO Do this
:LOGBOOK:
CLOCK: [2013-06-19 Wed 09:00]--[2013-06-19 Wed 10:11] =>  1:11
:END:
:PROPERTIES:
:Effort:   2:00
:END:

** Develop

*** TODO Do that
:LOGBOOK:
CLOCK: [2013-06-19 Wed 10:00]--[2013-06-19 Wed 12:22] =>  2:22
CLOCK: [2013-06-20 Thu 10:01]--[2013-06-20 Thu 12:35] =>  2:34
:END:

* Reporting

** Summary

#+ATTR_LATEX: :environment tabularx :width \linewidth :align Xrrr
#+BEGIN: clocktable :maxlevel 4 :scope file :block 2013-06 :lang "en" :narrow 
80! :indent t
Clock summary at [2013-09-03 Tue 17:16], for June 2013.

| Headline| Time |  |  |
|-+--+--+--|
| Total time  | 6:07 |  |  |
|-+--+--+--|
| Tasks   | 6:07 |  |  |
| \__ Design  |  | 1:11 |  |
| \_ TODO Do this |  |  | 1:11 |
| \__ Develop |  | 4:56 |  |
| \_ TODO Do that |  |  | 4:56 |
#+END:

--8<---cut here---end--->8---

This issue is a regression compared to Org 7 as this example works perfectly
with Org 7 (with this tiny change):

--8<---cut here---start->8---
#+ATTR_LATEX: tabularx width=\linewidth align=Xrrr
--8<---cut here---end--->8---

Any help is welcome.

Regards,
 Francesco

[1] http://lists.gnu.org/archive/html/emacs-orgmode/2013-07/msg00089.html



[O] [PATCH] Add support for `ltablex'

2013-09-03 Thread Francesco Pizzolante
Hello,

Please find here a patch to support the tabularx table environment when used
in conjunction with the ltablex LaTeX package.

ltablex combines the advantages of longtable and tabularx packages: it enables
splitting of table across pages, and have fixed-width tables with
auto-adjusted columns.

Like longtable, it does not require a float table environment around.

I added a ltablex environment name which will be exported as a tabularx LaTeX
environment without a table float environment (this is the exact same behavior
as for longtable).

Usage is the same as tabularx (except that you use ltablex as :environment
name in the ATTR_LATEX specification):

- you need to specify a :width attribute, and
- an :align attribute.

In this case, like for longtable, the :float attribute is also ignored.

Best regards,
 Francesco

* ox-latex.el (org-latex--org-table): Add support for `ltablex'.

From: Francesco Pizzolante 
Date: Tue, 3 Sep 2013 16:44:24 +0200
Subject: [PATCH] Add support for `ltablex'

---
 lisp/ox-latex.el |   17 -
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index e66c717..6af3acf 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2350,7 +2350,7 @@ This function assumes TABLE has `org' as its `:type' 
property and
org-latex-default-table-environment))
 ;; If table is a float, determine environment: table, table*
 ;; or sidewaystable.
-(float-env (unless (member table-env '("longtable" "longtabu"))
+(float-env (unless (member table-env '("longtable" "longtabu" 
"ltablex"))
  (let ((float (plist-get attr :float)))
(cond
 ((and (not float) (plist-member attr :float)) nil)
@@ -2401,6 +2401,21 @@ This function assumes TABLE has `org' as its `:type' 
property and
   (concat caption "\n"))
  "\\end{longtabu}\n"
  (and fontsize "}")))
+ ;; Ltablex (Tabularx without float).
+ ((equal "ltablex" table-env)
+  (concat (and fontsize (concat "{" fontsize))
+ (format "\\begin{tabularx}{%s}{%s}\n"
+ width
+ alignment)
+ (and org-latex-table-caption-above
+  (org-string-nw-p caption)
+  (concat caption "\n"))
+ contents
+ (and (not org-latex-table-caption-above)
+  (org-string-nw-p caption)
+  (concat caption "\n"))
+ "\\end{tabularx}\n"
+ (and fontsize "}")))
  ;; Others.
  (t (concat (cond
 (float-env
--
1.7.9



Re: [O] ATTR_LATEX not being applied on dynamic blocks

2013-09-04 Thread Francesco Pizzolante


Hi Nicolas,

> Attributes are correctly applied to the block, but you want them to
> apply on the inner table instead, which is different.

Indeed, this is a better expression of what I want.


>  Correct syntax should be something along the lines of:
>
>   #+BEGIN: clocktable :maxlevel 4 :scope file :block 2013-06 :lang "en" 
> :narrow 80! :indent t
>   Clock summary at [2013-09-03 Tue 17:16], for June 2013.
>   #+ATTR_LATEX: :environment tabularx :width \linewidth :align Xrrr
>   | Headline| Time |  |  |
>   |-+--+--+--|
>   | Total time  | 6:07 |  |  |
>   |-+--+--+--|
>   | Tasks   | 6:07 |  |  |
>   | \__ Design  |  | 1:11 |  |
>   | \_ TODO Do this |  |  | 1:11 |
>   | \__ Develop |  | 4:56 |  |
>   | \_ TODO Do that |  |  | 4:56 |
>   #+END:

Well, you're probably right.

But if I try what you suggest and move the #+ATTR_LATEX line inside the
dynamic block (after the #+BEGIN: clocktable and just before the generated
table), then this line gets lost as soon as the dynamic block is regenerated,
which is not what I expect.

With Org 7, having the #+ATTR_LATEX line just before the #+BEGIN: clocktable
line applies the attributes to the inner table of the dynamic block and the
#+ATTR_LATEX line is not lost each time I regenerate the dynamic block.

Any other hint/solution for me?

Thanks a lot for your help.

Regards,
 Francesco




  1   2   >