Re: [O] Way to replace normal tabular env with booktabs?

2012-02-08 Thread Niels Giesen
I say: go for it!

On Saturday, February 4, 2012, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Hello,

 John Hendy jw.he...@gmail.com writes:

 On Fri, Jan 13, 2012 at 9:39 AM, Carsten Dominik
 carsten.domi...@gmail.com wrote:

 On Jan 13, 2012, at 3:52 PM, Niels Giesen wrote:

 There is a patch from me waiting to be incorporated into org mode that
lets one use booktabs as export for normal org tables.

 You can find it @ http://patchwork.newartisans.com/patch/1016/

 Hi NIels,

 I am looking now at this patch, and maybe it would be better to
implement these three variables as one, holding a property or association
list?  Makes it easily extendable.

 Equally important - it would be great if you could try to implement
this same change in the new exporter engine from Nicolas, to ensure that
the new exporter will not lag behind.

 Regards

 - Carsten


 Any new thoughts on this? It would be great if this could be adjusted
 as mentioned and merged into org-mode! I'm still using the current
 patch from Niels in a separate branch because I like it so much!

 I looked at the patch. I think the three variables expose too much Org
 internals to the user.  It would be simpler to make use of
 `org-export-latex-tabular-environment' with a booktabs value. Also
 and #+attr_latex: booktabs should transform the table into
 a booktab-table locally.

 If Niels Giesen (CC'ed) doesn't mind, I will implement a modified
 version of his changes for the new exporter, in a couple of days.


 Regards,

 --
 Nicolas Goaziou


-- 
http://pft.github.com


Re: [O] Way to replace normal tabular env with booktabs?

2012-01-13 Thread Niels Giesen
There is a patch from me waiting to be incorporated into org mode that lets
one use booktabs as export for normal org tables.

You can find it @ http://patchwork.newartisans.com/patch/1016/



On Fri, Jan 13, 2012 at 2:21 PM, John Hendy jw.he...@gmail.com wrote:

 On Thu, Jan 12, 2012 at 6:01 PM, Thomas S. Dye t...@tsdye.com wrote:

 Hi John,

 The Library of Babel comes with your Org-mode distribution.

 You'll find it at /contrib/babel/library-of-babel.org


 I guess you learn something new every day!


 In the org file, look for
 * Tables
 ** LaTeX Table Export

 There should be functions booktabs and booktabs-notes.

 One way to use booktabs is described here:

 http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-13-2


 I'll check these out. Looked at the worg howto. Not a huge fan of the
 method, especially with hiding my tables, but I'll give it a shot. I figure
 there's got to be a simpler way; just change the first \hline - \toprule
 and the bottom one to \bottomrule; \midrules in between.

 Thanks again,
 John


 hth,
 Tom

 John Hendy jw.he...@gmail.com writes:

  On Thu, Jan 12, 2012 at 2:12 PM, Thomas S. Dye t...@tsdye.com wrote:
 
  Hi John,
 
  Agreed, booktabs makes good looking tables.
 
  Check out your Library of Babel.  There should  be a couple of
 functions
  there that will help you go from Org mode to booktabs.
 
 
  Haven't done much with babel other than writing code blocks. Do you mean
  this page?
  --- http://orgmode.org/worg/org-contrib/babel/library-of-babel.html
 
  Thanks for the suggestion. Feeling a bit lost, but am happy to look
 around
  for something that seems similar. I have no elisp-fu, so it'll need to
 be
  pretty darn similar :)
 
 
  John
 
 
  hth,
  Tom
 
  John Hendy jw.he...@gmail.com writes:
 
   Greetings,
  
  
   I was using wikibooks for some formatting assistance on tables the
 other
   day and ran into mention of the booktabs package in the Professional
   tables section. [1] [2]
  
   I really, really liked it's formatting, especially since one of my
 column
   headers was a fraction. The standard tabular package places the
 \hlines
   extremely close to the top and bottom of my header row vs., as the
  booktabs
   package says, having extremely nice looking spacing for the table. I
  ended
   up doing the table manually inside #+begin_latex block.
  
   Would there be any way to specify that booktabs should be used? The
   formatting is literally identical except for 1) including the
 booktabs
   package and 2) using \toprule, \midrule and \bottomrule instead of
  \hlines.
   In fact, even with booktabs included, if you use \hlines instead of
 the
   booktab specific lines, you'll get a regular tabular table.
  
   Any thoughts on this?
  
  
   Best regards,
   John
  
   -
   [1] http://en.wikibooks.org/wiki/LaTeX/Tables#Professional_tables
   [2] http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/
   Greetings,I was using wikibooks for some formatting assistance on
 tables
  the other day and ran into mention of the booktabs package in the
  Professional tables section. [1] [2]
   I really, really liked it#39;s formatting, especially since one of
 my
  column headers was a fraction. The standard tabular package places the
  \hlines extremely close to the top and bottom of my header row vs., as
 the
  booktabs package says, having extremely nice looking spacing for the
 table.
  I ended up doing the table manually inside #+begin_latex block.
   Would there be any way to specify that booktabs should be used? The
  formatting is literally identical except for 1) including the booktabs
  package and 2) using \toprule, \midrule and \bottomrule instead of
 \hlines.
  In fact, even with booktabs included, if you use \hlines instead of the
  booktab specific lines, you#39;ll get a regular tabular table.
   Any thoughts on this?Best regards,John-[1]
  http://en.wikibooks.org/wiki/LaTeX/Tables#Professional_tables
   [2] http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/
 
  --
  Thomas S. Dye
  http://www.tsdye.com
 
  On Thu, Jan 12, 2012 at 2:12 PM, Thomas S. Dye span dir=ltrmailto:
 t...@tsdye.com/span wrote:
  Hi John,
 
  Agreed, booktabs makes good looking tables.
 
  Check out your Library of Babel.  There should  be a couple of functions
  there that will help you go from Org mode to booktabs.
  Haven#39;t done much with babel other than writing code blocks. Do you
 mean this page?---
 http://orgmode.org/worg/org-contrib/babel/library-of-babel.html
  Thanks for the suggestion. Feeling a bit lost, but am happy to look
 around for something that seems similar. I have no elisp-fu, so it#39;ll
 need to be pretty darn similar :)
  John
  hth,
  Tom
 
  John Hendy mailto:jw.he...@gmail.com writes:
 
  Greetings,
 
 
  I was using wikibooks for some formatting assistance on tables the
 other
  day and ran into mention of the booktabs package in the Professional
  tables section. [1] [2]
 
  I really, really 

Re: [O] [PATCH] customize latex table export

2011-12-02 Thread Niels Giesen
Hi Christophe,

Could you provide us with a minimal example of how this new functionality
can be used?

I am trying to test it and see if there are any conflicts with my patch of
late to supports the booktabs package @
http://patchwork.newartisans.com/patch/1016/  (aside from one of the two
patches not applying without some minor human intervention around line
1998).

Besides that, it would in general be good to have an example for
documentation purposes.

On Tue, Nov 29, 2011 at 6:44 PM, Christophe Rhodes cs...@cantab.net wrote:

 Carsten Dominik carsten.domi...@gmail.com writes, a long time ago:

  On May 19, 2011, at 2:34 PM, Christophe Rhodes wrote:
 
  To produce documents in something approaching my organization's house
  style, I need to be able to style the headers of tables.  It's nice that
  orgtbl has the functionality for this, but the call to orgtbl-to-latex
  has a hard-coded list of parameters with no possibility for extension.
  With the attached patch, I am able to put e.g.
 
  #+BIND: org-export-latex-tables-orgtbl-extra-parameters (:hfmt
 \\multicolumn{1}{c}{\\bf\\color{white}\\cellcolor{blue}%s})
 
  in the header of my document, and tables throughout the document all
  pick up this style.
 
  I daresay that this is not the optimal way of doing things; while this
  solves my immediate problem there is likely to be a more general way of
  doing things.
 
  would it be better to be able to set these parameters on a per-table
 basis with ATTR_LaTeX ?
  Would you like to try to prepare a patch to this effect?

 Find attached a patch to this effect.  It is the combination of two
 changes which I consider tiny: one is the support for hfmt itself as an
 ATTR_LaTeX attribute; the other is the consolidation of the
 word-matching on the attributes into local macros, which I needed
 because my use case (as above) includes the string multicolumn, which
 was otherwise confusing the attribute parser into thinking that I needed
 a table* LaTeX environment.

 Please let me know if this suits better.



 Christophe




-- 
http://pft.github.com


Re: [O] More specific LaTeX output classes

2011-12-02 Thread Niels Giesen
Ken Williams ken.willi...@windlogics.com writes:


[...]

 Would it be possible for the export process to define various classes
 that default to being exactly like 'verbatim', but could be
 customized? After that, a next step might be to provide nice defaults
 that do things like syntax-highlighting (through the 'minted' package,
 perhaps), or at least add a visual marker distinguishing between input
  output.

 Or of course it's possible some of this is already implemented and I've 
 missed it. =)

Yes it is:

#+begin_src emacs-lisp
  (setq org-export-latex-listings 'minted)
  (add-to-list 'org-export-latex-packages-alist '( minted)
#+end_src

See also `org-export-latex-listings-langs' for a mapping of Emacs modes
to languages known to pygmentize.

Also see

C-h v org-export-latex-listings RET

for more information (e.g. about the --shell-escape option you'll have
to pass to the LaTeX process).

Regards, Niels.
-- 
http://pft.github.com/



Re: [O] Org-mode latex-export minted problem

2011-11-16 Thread Niels Giesen
Piotr Kaźmierczak p.h.kazmierc...@gmail.com writes:

 Hi, 

 I'm having a hard time configuring org-mode LaTeX export to work with minted 
 package for code listings. I put 

 #+LaTeX_HEADER: \usepackage{minted}
 #+LaTeX_HEADER: \usemintedstyle{emacs}

 in the header of my org mode file, and then 

 #+BEGIN_SRC haskell :exports code
 some haskell code here
 #+END_SRC

 when I wanted to put the code listing. My .emacs has a proper minted 
 configuration for org-mode set, too:

 ; minted latex export
 (setq org-export-latex-listings 'minted)
 (setq org-export-latex-minted-options
   '((frame lines)
 (fontsize \\scriptsize)
 (linenos )))
 (setq org-latex-to-pdf-process
   '(pdflatex -shell-escape -interaction nonstopmode %s
 pdflatex -shell-escape -interaction nonstopmode %s
 pdflatex -shell-escape -interaction nonstopmode %s))

Hi Piotr,

Try and narrow down the problem:

1. Start Emacs with the -q option,
2. Open test.org, which is

* Test minted export

#+begin_src emacs-lisp
;; minted latex export
(setq org-export-latex-listings 'minted
  org-export-latex-minted-options
  '((frame lines)
(fontsize \\scriptsize)
(linenos )))
#+end_src


3. Evaluate the emacs-lisp block in test.org
4. Press C-c C-e L

With me, this outputs the src block correctly, namely as

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{common-lisp}
; minted latex export
(setq org-export-latex-listings 'minted
  org-export-latex-minted-options
  '((frame lines)
(fontsize \\scriptsize)
(linenos )))
\end{minted}

If you get the same output, something else in your .emacs or custom.el
or so must play you parts, if not, you may have to check your org mode
version.

Regards, Niels.

-- 
http://pft.github.com/



Re: [O] Formatting clock tables in the agenda

2011-11-09 Thread Niels Giesen
You should probably check org-agenda-clockreport-parameter-plist

On Wed, Nov 9, 2011 at 4:30 PM, Tommy Kelly tommy.ke...@verilab.com wrote:

 I have a clock table in my agendas -- I got it there by setting
 org-agenda-start-with-clockreport-mode. I'm trying to control its
 format. I've tried using org-clock-clocktable-default-properties but
 that seems to have no effect. For example, this from my
 custom-set-variables:

  '(org-agenda-start-with-clockreport-mode t)
  '(org-clock-clocktable-default-properties (quote (:maxlevel 2 :scope
 file :indent t :link t)))

 The presence/absence of that second line makes no difference to how my
 agenda clocktable looks.

 How do I control that particular table's format?

 thanks
 Tommy




-- 
http://pft.github.com


[O] Patch to customize output of tables in LaTeX exporter.

2011-10-28 Thread Niels Giesen
Dear list,

Attached is a patch that allows some customization of tables in LaTeX
export.

It adds three new customizable with default values:

  org-export-latex-tables-tstart : nil
  org-export-latex-tables-hline  : \\hline
  org-export-latex-tables-tend   : nil

These variables allows users to use e.g. the booktabs package (use
\\toprule, \\midrule and \\bottomrule for the respective variables above
- these are options you'll find in the defcustoms too) and create more
beautiful tables in LaTeX documents.

The patch also fixes the double rule after the table head when using a
longtable environment, as this 1) is ugly and 2) caused booktabs
longtables to go quite awry.

The patch does - save for the longtable fix - bring no change to the
export of existing code as long as the defaults are not changed.

From f2d9cf34b1b95c7e6941c8f9129ae9e32ba33444 Mon Sep 17 00:00:00 2001
From: Niels Giesen niels.gie...@gmail.com
Date: Thu, 27 Oct 2011 09:23:16 +0200
Subject: [PATCH] Add defcustoms for LaTeX export of table rules :tstart, :hline and :tend
 Fix double rule in longtable.

This allows users to use e.g. the booktabs package and create more
beautiful tables in LaTeX documents. Also fix double headline rules
when using a longtable environment, as this caused booktabs longtables
to go quite awry.

* lisp/org-latex.el:
New defcustoms and default values:

  org-export-latex-tables-tstart : nil
  org-export-latex-tables-hline  : \\hline
  org-export-latex-tables-tend   : nil

* lisp/org-table.el (orgtbl-to-generic): add check for :skipheadrule.
When present, the :hline following the head will be skipped. This is
necessary to avoid doubling of horizontal rules in LaTeX longtable
environments and consequent width problems.
---
 lisp/org-latex.el |   38 ++
 lisp/org-table.el |3 ++-
 2 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 649e4a7..3e47359 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -369,6 +369,30 @@ When nil, grouping causes only separation lines between groups.
   :group 'org-export-latex
   :type 'boolean)
 
+(defcustom org-export-latex-tables-tstart nil
+  LaTeX command for top rule for tables.
+  :group 'org-export-latex
+  :type '(choice
+  (const :tag Nothing nil)
+  (string :tag String)
+  (const  :tag Booktabs default: \\toprule \\toprule)))
+
+(defcustom org-export-latex-tables-hline \\hline
+  LaTeX command to use for a rule somewhere in the middle of a table.
+  :group 'org-export-latex
+  :type '(choice
+  (string :tag String)
+  (const  :tag Standard: \\hline \\hline)
+  (const  :tag Booktabs default: \\midrule \\midrule)))
+
+(defcustom org-export-latex-tables-tend nil
+  LaTeX command for bottom rule for tables.
+  :group 'org-export-latex
+  :type '(choice
+  (const :tag Nothing nil)
+  (string :tag String)
+  (const  :tag Booktabs default: \\bottomrule \\bottomrule)))
+
 (defcustom org-export-latex-low-levels 'itemize
   How to convert sections below the current level of sectioning.
 This is specified by the `org-export-headline-levels' option or the
@@ -1998,14 +2022,20 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER.
 align))
 (orgtbl-to-latex
  lines
- `(:tstart nil :tend nil
+ `(:tstart ,org-export-latex-tables-tstart
+   :tend ,org-export-latex-tables-tend
+   :hline ,org-export-latex-tables-hline
+   :skipheadrule ,longtblp
:hlend ,(if longtblp
(format 
-\\hline
+%s
 \\endhead
-\\hline\\multicolumn{%d}{r}{Continued on next page}\\
+%s\\multicolumn{%d}{r}{Continued on next page}\\
 \\endfoot
-\\endlastfoot (length org-table-last-alignment))
+\\endlastfoot
+   org-export-latex-tables-hline
+   org-export-latex-tables-hline
+   (length org-table-last-alignment))
  nil)))
 (if (not longtblp) (format \n\\end{%s} tabular-env))
 (if longtblp \n (if org-export-latex-tables-centered
diff --git a/lisp/org-table.el b/lisp/org-table.el
index edcdbe1..247f585 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -4460,6 +4460,7 @@ directly by `orgtbl-send-table'.  See manual.
 
   (let* ((splicep (plist-get params :splice))
 	 (hline (plist-get params :hline))
+ (skipheadrule (plist-get params :skipheadrule))
 	 (remove-nil-linesp (plist-get params :remove-nil-lines))
 	 (remove-newlines (plist-get params :remove-newlines))
 	 (*orgtbl-hline* hline)
@@ -4505,7 +4506,7 @@ directly by `orgtbl-send-table'.  See manual.
 		 (*orgtbl-sep* (or (plist-get

Re: [O] Patch for bug in adjusting time ranges in Agenda

2011-10-22 Thread Niels Giesen
Same here.

By the way, you don't necessarily have to mark the patch as a TINYCHANGE: I
have signed the papers with the FSF, but I just have problems updating
http://orgmode.org/worg/org-contribute.html.

(problem is: error: unable to create temporary sha1 filename ./objects/3e:
Permission denied
I mailed Matt about this a fortnight ago, but haven't heard from him yet).

On Fri, Oct 21, 2011 at 10:54 AM, Christian Egli christian.e...@sbs.chwrote:

 Hi Carsten

 Carsten Dominik carsten.domi...@gmail.com writes:

  I have just checked in a slightly modified patch.

 I think there is a problem with this checkin. The variable
 org-agenda-move-date-from-past-immediately-to-today is not defined.
 Should this be a defcustom somewhere?

 Debugger entered--Lisp error: (void-variable
 org-agenda-move-date-from-past-immediately-to-today)
  org-agenda-date-later(1)
  org-agenda-do-date-later(nil)
  call-interactively(org-agenda-do-date-later nil nil)

 Thanks
 --
 Christian Egli
 Swiss Library for the Blind, Visually Impaired and Print Disabled
 Grubenstrasse 12, CH-8045 Zürich, Switzerland





-- 
http://pft.github.com


Re: [O] direct link to mails in gmail

2011-10-22 Thread Niels Giesen

 Since any mail can be found under the All label by definition the
 simplest solution is extracting the message id from the end of
 the current url and then creating a new url pointing to All.
 This URL should always work unless the mail is deleted:

 https://mail.google.com/mail/?shva=1#all/msgid


 So this would work too:

#+LINK: gmail https://mail.google.com/mail/?shva=1#all/

[[gmail:1331f3490dff1205][conversation about gmail links]]

Too bad I have set up Emacs to use emacs-w3m, in which this does not work --
probably the hash part is handled by client-side JavaScript.


-- 
http://pft.github.com


Re: [O] direct link to mails in gmail

2011-10-22 Thread Niels Giesen
suvayu ali fatkasuvayu+li...@gmail.com writes:

 On Sat, Oct 22, 2011 at 13:43, Niels Giesen niels.gie...@gmail.com wrote:
 suvayu ali fatkasuvayu+li...@gmail.com writes:

 On Sat, Oct 22, 2011 at 8:48 AM, Niels Giesen niels.gie...@gmail.com 
 wrote:
 Too bad I have set up Emacs to use emacs-w3m, in which this does not work 
 --
 probably the hash part is handled by client-side JavaScript.

 You can try this:

 https://mail.google.com/mail/h/

 That link simply visits the HTML-version of gmail, but does not let one
 select an article via the URL - as far as I know.


 In that case you can try the Message text garbled? or Show original link.

Ok. This one seems to do the trick to show the original of a single
message:

https://mail.google.com/mail/h/?v=omth=MESSAGE-ID

And this one can be used for conversation view:

https://mail.google.com/mail/h/?v=cs=lth=MESSAGE-ID

It seems v=c means view=conversation. But this is not enough by and of
itself, s=l is necessary too, whatever that means. Left out, your Inbox
will be presented.

Summing up, if you want to visit gmails articles without using
JavaScript, you may use this:

#+LINK: gmail https://mail.google.com/mail/h/?v=cs=lth=
for HTML-only browsers/settings or
#+LINK: gmail https://mail.google.com/mail/?shva=1#all/
for JS-enabled browsers

or something like

#+begin_src emacs-lisp
  (org-add-link-type
   gmail
   (lambda (link)
 (browse-url
  ;; or https://mail.google.com/mail/?shva=1#all/; for js-browser
  (concat https://mail.google.com/mail/h/?v=cs=lth=; link
#+end_src

to have the link type globally.

Then use this in an Org file:

[[gmail:1331f3490dff1205][conversation about gmail links]]

This way, if Google decides to change it's url structure, all you have
to do is redefine your link type, instead of all email links.


 Hope that helps.

-- 
http://pft.github.com/



Re: [O] Patch for bug in adjusting time ranges in Agenda

2011-10-17 Thread Niels Giesen
On Sun, Oct 16, 2011 at 6:43 PM, Nick Dokos nicholas.do...@hp.com wrote:

 Niels Giesen niels.gie...@gmail.com wrote:

  *bump*
 
  Has this one slipped through (as I were posting two other patches round
 the same date, one also
  having to do with date/time ranges in the agenda -- which were both
 accepted), or am I just
  impatient?
 

 I tried to check patchwork (
 http://patchwork.newartisans.com/project/org-mode/)
 but the server seems to be having problems right now. However, that's the
 first
 place to check when it comes back: if it's there, somebody will get to it
 sooner
 or later.


Ok, I checked today (server is up again) and it's not there. But I've been a
fool. Should've submitted as an attachment as per
http://orgmode.org/worg/org-contribute.html . Should I try and resubmit?



 Nick

  On Sun, Oct 2, 2011 at 12:24 PM, Niels Giesen niels.gie...@gmail.com
 wrote:
 
  Hi Orgers,
 
  The discussion in the recent thread Time range end in agenda view
 not
  displayed prompted me to take a closer look at time/date ranges in
 the
  Agenda view. I noticed that the commands `org-agenda-do-date-later'
 and
  `org-agenda-do-date-earlier' do not work correctly on timestamp
 ranges,
  in that they only shift the rightmost timestamp in the range. The
 patch
  below should fix this.
 
  #+begin_src diff
   From 2e6b64dc8dcae0fd312729af96ab10d8d2e9d91b Mon Sep 17 00:00:00
 2001
   From: Niels Giesen niels.gie...@gmail.com
   Date: Sun, 2 Oct 2011 09:15:21 +0200
   Subject: [PATCH] Fix shift-adjusting time and date ranges from
 within Agenda.
 
   ,* org-mode/lisp/org-agenda.el (org-agenda-date-later): Adjust both
 start and end timestamp for a range, and set
 `org-last-changed-timestamp' to a representation of the new range.
   ---
lisp/org-agenda.el |8 +++-
1 files changed, 7 insertions(+), 1 deletions(-)
 
   diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
   index b1fa5f5..e4c1053 100644
   --- a/lisp/org-agenda.el
   +++ b/lisp/org-agenda.el
   @@ -7517,7 +7517,13 @@ the same tree node, and the headline of the
 tree node in the Org-mode
  file.
   (goto-char pos)
   (if (not (org-at-timestamp-p))
  (error Cannot find time stamp))
   -   (org-timestamp-change arg (or what 'day)))
   +   (org-timestamp-change arg (or what 'day))
   +   (when (org-at-date-range-p)
   + (let ((end org-last-changed-timestamp))
   +   (re-search-backward org-tr-regexp-both)
   +   (org-timestamp-change arg (or what 'day))
   +   (setq org-last-changed-timestamp
   +(concat org-last-changed-timestamp -- end)
 (org-agenda-show-new-time marker org-last-changed-timestamp))
(message Time stamp changed to %s
 org-last-changed-timestamp)))
 
   --
   1.7.2.5
 
  #+end_src
 
  Regards,
  niels
  --
  http://pft.github.com
 
  --
  http://pft.github.com
 
 
  
  Alternatives:
 
  




-- 
http://pft.github.com


Re: [O] Patch for bug in adjusting time ranges in Agenda

2011-10-16 Thread Niels Giesen
*bump*

Has this one slipped through (as I were posting two other patches round the
same date, one also having to do with date/time ranges in the agenda --
which were both accepted), or am I just impatient?

On Sun, Oct 2, 2011 at 12:24 PM, Niels Giesen niels.gie...@gmail.comwrote:

 Hi Orgers,

 The discussion in the recent thread Time range end in agenda view not
 displayed prompted me to take a closer look at time/date ranges in the
 Agenda view. I noticed that the commands `org-agenda-do-date-later' and
 `org-agenda-do-date-earlier' do not work correctly on timestamp ranges,
 in that they only shift the rightmost timestamp in the range. The patch
 below should fix this.

 #+begin_src diff
  From 2e6b64dc8dcae0fd312729af96ab10d8d2e9d91b Mon Sep 17 00:00:00 2001
  From: Niels Giesen niels.gie...@gmail.com
  Date: Sun, 2 Oct 2011 09:15:21 +0200
  Subject: [PATCH] Fix shift-adjusting time and date ranges from within
 Agenda.

  ,* org-mode/lisp/org-agenda.el (org-agenda-date-later): Adjust both
start and end timestamp for a range, and set
`org-last-changed-timestamp' to a representation of the new range.
  ---
   lisp/org-agenda.el |8 +++-
   1 files changed, 7 insertions(+), 1 deletions(-)

  diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
  index b1fa5f5..e4c1053 100644
  --- a/lisp/org-agenda.el
  +++ b/lisp/org-agenda.el
  @@ -7517,7 +7517,13 @@ the same tree node, and the headline of the tree
 node in the Org-mode file.
  (goto-char pos)
  (if (not (org-at-timestamp-p))
 (error Cannot find time stamp))
  -   (org-timestamp-change arg (or what 'day)))
  +   (org-timestamp-change arg (or what 'day))
  +   (when (org-at-date-range-p)
  + (let ((end org-last-changed-timestamp))
  +   (re-search-backward org-tr-regexp-both)
  +   (org-timestamp-change arg (or what 'day))
  +   (setq org-last-changed-timestamp
  +(concat org-last-changed-timestamp -- end)
(org-agenda-show-new-time marker org-last-changed-timestamp))
   (message Time stamp changed to %s org-last-changed-timestamp)))

  --
  1.7.2.5


 #+end_src

 Regards,
 niels
 --
 http://pft.github.com




-- 
http://pft.github.com


Re: [O] Put result output in different type of code block than original

2011-10-11 Thread Niels Giesen
To all people in this thread,

Thank you for all the responses.

The echoing of #+begin_src and #end_src is indeed a workaround that I
had not thought of myself, though it is not that general, and puts stuff
in the source that really oughtn't be there.

In the mean time I came up with a piece of advise to
`org-babel-insert-result' that does the trick in a general way.

#+begin_src emacs-lisp
  (defadvice org-babel-insert-result (around pft/output-type)
(let* ((all-params (caddr info))
   (lang (or (cdr (assoc :out all-params)) lang)))
  ad-do-it))

(ad-activate 'org-babel-insert-result)
#+end_src

Use it with :out your-choice-of-lang

And while I was at it, I added indentation:

#+begin_src elisp
(defadvice org-babel-insert-result (around pft/output-indent)
  (let* ((all-params (caddr info))
 (indent-after (assoc :indent-after all-params)))
ad-do-it
(when indent-after
 (save-excursion
   (when (re-search-forward
  #\\+begin_src  nil t)
 (beginning-of-line)
 (org-edit-special)
 (indent-region (point-min) (point-max))
 (org-edit-src-exit))
#+end_src

so... this it what it does:

#+begin_src sh :results output code :out json :indent-after
  echo {\peul\:\erwt\,\n\graan\:\rijst\}
#+end_src

#+results:
#+BEGIN_SRC json
  {peul:erwt,
   graan:rijst}
#+END_SRC

I do not know whether it plays nice with all other input forms and
:result parameters, as there seem to be some special handlers for e.g.
LaTeX and emacs-lisp, but I guess this would help the AWK-SQL case too.

If this works well enough, these pieces of advise may serve as a basis
for a patch to `org-babel-insert-result'. What do you think?

-- 
http://pft.github.com/



[O] Put result output in different type of code block than original

2011-10-10 Thread Niels Giesen
Hi,

Say I've got a sh code block invoking curl to some json api, is it possible
some way to specify that the format of the output when :results output code
is in a json code block and *not* a sh code block?

#+begin_src sh :results output code :exports both
curl
https://our-service.org/getstuff?username=dirk\password=catsbrithday\fmt=json
#+end_src

#+results:
#+BEGIN_SRC sh
{userinfo : {id : QNCNFQUKKBCTTMAOIUFNOQVLDUFAJV, fullname : Gekke
Dirk, role : user}}
#+END_SRC

whereas I'd like it to be

#+results:
#+BEGIN_SRC json
{userinfo : {id : QNCNFQUKKBCTTMAOIUFNOQVLDUFAJV, fullname : Gekke
Dirk, role : user}}
#+END_SRC

Any thoughts on how to go about this? Do other people have this same issue
and should there come an option in babel that handles this (one language
outputting source code for another?), or is there a way to specify ones own
outputter?

-- 
http://pft.github.com


Re: [O] Patch for numbering continuation in source blocks.

2011-10-08 Thread Niels Giesen
Carsten Dominik carsten.domi...@gmail.com writes:

 Hi Niels,

 is the purpose of this patch to be able to insert an unnumbered code block
 between two numbered ones and to continue the numbering from the first in the 
 third?

Yes, that is the precise purpose. How concise you can put it!

-- 
http://pft.github.com/



Re: [O] [BUG] Re: Time range end in agenda view not displayed

2011-10-05 Thread Niels Giesen

 Thanks, this patch has been accepted.

 - Carsten


Thank you.

niels
-- 
http://pft.github.com


[O] Patch for bug in adjusting time ranges in Agenda

2011-10-02 Thread Niels Giesen
Hi Orgers,

The discussion in the recent thread Time range end in agenda view not
displayed prompted me to take a closer look at time/date ranges in the
Agenda view. I noticed that the commands `org-agenda-do-date-later' and
`org-agenda-do-date-earlier' do not work correctly on timestamp ranges,
in that they only shift the rightmost timestamp in the range. The patch
below should fix this.

#+begin_src diff
  From 2e6b64dc8dcae0fd312729af96ab10d8d2e9d91b Mon Sep 17 00:00:00 2001
  From: Niels Giesen niels.gie...@gmail.com
  Date: Sun, 2 Oct 2011 09:15:21 +0200
  Subject: [PATCH] Fix shift-adjusting time and date ranges from within Agenda.
  
  ,* org-mode/lisp/org-agenda.el (org-agenda-date-later): Adjust both
start and end timestamp for a range, and set
`org-last-changed-timestamp' to a representation of the new range.
  ---
   lisp/org-agenda.el |8 +++-
   1 files changed, 7 insertions(+), 1 deletions(-)
  
  diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
  index b1fa5f5..e4c1053 100644
  --- a/lisp/org-agenda.el
  +++ b/lisp/org-agenda.el
  @@ -7517,7 +7517,13 @@ the same tree node, and the headline of the tree node 
in the Org-mode file.
  (goto-char pos)
  (if (not (org-at-timestamp-p))
 (error Cannot find time stamp))
  -   (org-timestamp-change arg (or what 'day)))
  +   (org-timestamp-change arg (or what 'day))
  +   (when (org-at-date-range-p)
  + (let ((end org-last-changed-timestamp))
  +   (re-search-backward org-tr-regexp-both)
  +   (org-timestamp-change arg (or what 'day))
  +   (setq org-last-changed-timestamp
  +(concat org-last-changed-timestamp -- end)
(org-agenda-show-new-time marker org-last-changed-timestamp))
   (message Time stamp changed to %s org-last-changed-timestamp)))
   
  -- 
  1.7.2.5
  
  
#+end_src

Regards,
niels
--
http://pft.github.com



[O] Patch for numbering continuation in source blocks.

2011-10-02 Thread Niels Giesen
NOTE: I have tried earlier to send this patch with git send-email,
  but apparently failed; here's a new, inlined attempt.

  The documentation for numbering source code blocks says:

#+begin_quote
If you use a `+n' switch, the numbering from the previous
numbered snippet will be continued in the current one.
#+end_quote

  But that is not exactly what happens; what happens is that the
numbering from the previous snippet will be continued in the current
one. That is, when the previous snippet is numbered its numbering will
continue, but if there is a previous numbered snippet A with, say, 14
lines followed by an unnumbered snippet B followed by a numbered
snippet C, then the numbers for C will start at 1, regardless of the +
in the +n switch, whereas my reading of the documentation leads me to
think it ought to continue at 15, disregarding the presence any
unnumbered sections in between.

Reason for me for the +n switch to comply with (my reading of) the
documentation is that I would like to document a long, line-numbered,
function but intersperse it with short code samples without line
numbering that explain parts of the long function.

This patch of course may break existing org files where +n was
specified but -n intended.

#+begin_src diff
  From 4d34d5f2fe10a956d3359dfd40f19de25202df5f Mon Sep 17 00:00:00 2001
  From: Niels Giesen niels.gie...@gmail.com
  Date: Fri, 16 Sep 2011 17:22:47 +0200
  Subject: [PATCH] Continue numbering from any previous numbered snippet with 
+n, even when previous numbered snippet does not immediately precede it.
  
  ,* org-mode/lisp/org-exp.el (org-export-number-lines):
  
Check whether number parameter (this is a numbered block!) is
non-nil as well as whether cont is nil (this numbered block should
*not* continue numbering where we left off before!) before resetting
the count to zero.
  
From the docs:
  
  If you use a `+n' switch, the numbering from the previous
  numbered snippet will be continued in the current one.
  
With this change I believe the code complies with the docs.
  ---
   lisp/org-exp.el |2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)
  
  diff --git a/lisp/org-exp.el b/lisp/org-exp.el
  index 9884a31..12590e1 100644
  --- a/lisp/org-exp.el
  +++ b/lisp/org-exp.el
  @@ -2731,7 +2731,7 @@ INDENT was the original indentation of the block.
   (defun org-export-number-lines (text optional skip1 skip2 number cont
   replace-labels label-format)
 (setq skip1 (or skip1 0) skip2 (or skip2 0))
  -  (if (not cont) (setq org-export-last-code-line-counter-value 0))
  +  (if (and number (not cont)) (setq org-export-last-code-line-counter-value 
0))
 (with-temp-buffer
   (insert text)
   (goto-char (point-max))
  -- 
  1.7.4.1
  
  
#+end_src

Regards,
niels
--
http://pft.github.com



Re: [O] [BUG] Re: Time range end in agenda view not displayed

2011-09-30 Thread Niels Giesen
Giovanni Ridolfi giovanni.rido...@yahoo.it writes:

 michael holzer michi_holzer_n...@gmx.at writes:

 When I have an entry that contains a time range, for example:

 * timerange
   2011-09-30 Fri 14:00--2011-09-30 Fri 18:00

 this shows up in the agenda view as:

   uni:14:00.. timerange

 while I would expect something like:

   uni:14:00-18:00 timerange


 |the manual says:
 |Time ranges can be specified with two timestamps, 
 |like ‘2005-05-10 Tue 20:30--2005-05-10 Tue 22:15’.
 |
 | 20:30-22:15 Marvin escorts the Hitchhikers to the bridge

 I confirm this bug.

 Org-mode version 7.7 0e9d401519c020af29a7e35da7acfca25e6c3be4
 GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600) of 2011-03-10 on 3249CTO

 Giovanni



Funny enough, I noticed this too last week, so I whipped up this patch.
It inserts the range when start date is the same as the end date. Please
test (it's still young)  include in Org if you so please.
  
#+begin_src diff
From dcf81753aa5cab311f2a3a0272e4691e4bc6ea38 Mon Sep 17 00:00:00 2001
From: Niels Giesen niels.gie...@gmail.com
Date: Mon, 26 Sep 2011 11:43:55 +0200
Subject: [PATCH] Show timestamp ranges in agenda

* lisp/org-agenda.el (org-agenda-get-blocks): Show timestamp ranges in
  agenda if start day is same as end day
---
 lisp/org-agenda.el |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index b1fa5f5..e8effd5 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5396,7 +5396,9 @@ FRACTION is what fraction of the head-warning time has 
passed.
 org-agenda-timerange-leaders)
(1+ (- d0 d1)) (1+ (- d2 d1)))
   head category tags
-  (cond ((= d1 d0)
+  (cond ((and (= d1 d0) (= d2 d0))
+ (concat  start-time -- end-time 
))
+ ((= d1 d0)
  (concat  start-time ))
 ((= d2 d0)
  (concat  end-time ))
-- 
1.7.4.1
#+end_src

Regards, Niels.
-- 
http://pft.github.com/



[O] [PATCH] Continue numbering from any previous numbered snippet with +n, even when previous numbered snippet does not immediately precede it.

2011-09-16 Thread Niels Giesen
* org-mode/lisp/org-exp.el (org-export-number-lines):

  Check whether number parameter (this is a numbered block!) is
  non-nil as well as whether cont is nil (this numbered block should
  *not* continue numbering where we left off before!) before resetting
  the count to zero.

  From the docs:

If you use a `+n' switch, the numbering from the previous
numbered snippet will be continued in the current one.

  With this change I believe the code complies with the docs.
---
 lisp/org-exp.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 9884a31..12590e1 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -2731,7 +2731,7 @@ INDENT was the original indentation of the block.
 (defun org-export-number-lines (text optional skip1 skip2 number cont
 replace-labels label-format)
   (setq skip1 (or skip1 0) skip2 (or skip2 0))
-  (if (not cont) (setq org-export-last-code-line-counter-value 0))
+  (if (and number (not cont)) (setq org-export-last-code-line-counter-value 0))
   (with-temp-buffer
 (insert text)
 (goto-char (point-max))
-- 
1.7.4.1




Re: [O] Is it possible to markup one character in a word?

2011-08-28 Thread Niels Giesen
 The whitespace module seems not to support this kind of spaces.
 Is there any centralized feature to show/hide those things?


The whitespace module does support this, see the variable
`whitespace-display-mappings'.

Something like this should do the trick (if not done via M-x
customize-variable RET whitespace-display-mappings RET):

(add-to-list
 'whitespace-display-mappings
 '(space-mark 8203 [?|] [?-]))

You'll have to M-x whitespace-mode after evaluating this to update the
buffer display.

Ciau,
Niels.


-- 
http://pft.github.com


Re: [O] Underline ONLY the first character of a word?

2011-08-28 Thread Niels Giesen
What about using something well-structured like a table or a (definition)
list and CSS :first-letter pseudoselector and text-decoration: underline?

e.g.

td:first-child {
  font-weight:bold;
}
td~td:first-letter {
  text-decoration:underline;
}

for a two-column table.

On Fri, Aug 26, 2011 at 10:35 AM, Carsten Dominik carsten.domi...@gmail.com
 wrote:

 Hi,

 I don't think the following trick has come up yet.  If you are
 only exporting to HTML, you can do:

 @ue@/uvent

 HTH

 - Carsten

 On 25.8.2011, at 01:34, Nick Dokos wrote:

  Nick Dokos nicholas.do...@hp.com wrote:
 
  Not without some code I think.
 
 
  D'oh - as John Hendy points out, you can do it by hand:
 
  --8---cut here---start-8---
 
  #+begin_html
  ba/b  ua/uctionablebr/
  bb/b  ub/uibulousbr/
  bc/b  uc/ualifragilisticbr/
  #+end_html
  --8---cut here---end---8---
 
  It always amazes me how fixated I can get on the wrong approach.
 
  Nick
 





-- 
http://pft.github.com


Re: [O] Calendar-like view of the org-agenda

2011-07-05 Thread Niels Giesen
SAKURAI Masashi m.saku...@kiwanami.net writes:

[...]

 Just yesterday in JST, I released calfw v1.0.

This is just awesome!

[...]

 I have not used orgmode so far, so I'm not good at the schedule management in 
 the orgmode. Comments and patches are welcome.

Ok. Here you go:

1. I have just send you a patch off-list to deal with bad sexps caused by
unbound `span' variable (this appears e.g. in diary-sunset and friends -- see
http://orgmode.org/worg/org-hacks.html). And while writing this email,
you notified me you have applied it... thanks!

2. For people using org-google-weather and using icons to spicen up
their agenda views for the weather, there is a problem with the grid as
the icons do not fit well inside a grid.

The simplest way to get around this I guess is advising
`cfw:org-collect-schedules-period' (I use a similar strategy for
`org-mobile-push' where one would otherwise only see the text icon).

#+begin_src emacs-lisp
  (defadvice cfw:org-collect-schedules-period (around no-icon activate)
(let (org-google-weather-display-icon-p)
  ad-do-it))
#+end_src

3. I'd like to select items with my keyboard, but the normal emacs
navigation bindings are not available. Maybe tabbing to items in
`cfw:details-mode' (but preferably also in cfw:calendar-mode) would do
it for me, where it would be nice if the mouse echo was also shown when
entering an item by way of keyboard navigation.

4. I do not know whether it is possible due to the dynamic construction
of mode maps in calfw.el, but it would be nice if you could take
advantage of the self-documenting nature of Emacs by including a
reference to the keymap in the docstring for the various modes. For
cfw:calendar-mode this would be st. like:

#+begin_src diff
   This hook is called at end of setting up major mode `cfw:calendar-mode'.)
 
 (defun cfw:calendar-mode (optional custom-map)
-  Set up major mode `cfw:calendar-mode'.
+  Set up major mode `cfw:calendar-mode'.
+
+\\{cfw:calendar-mode-map}
   (kill-all-local-variables)
   (setq truncate-lines t)
   (use-local-map (cfw:calendar-mode-map custom-map))
#+end_src

This way users have a quick overview of keybindings by pressing C-h m.

5. (perhaps slightly OT) From your screenshots I see you have no problem
with putting multibyte (japanese) characters inside a grid, something
with which I always have problems (e.g. in org tables but also in your
calendar). Do you do anything special to make that work?

Regards and many thanks for such a nice addition to Emacs and Org Mode,
Niels.

-- 
http://pft.github.com/



Re: [O] Jambunathan's ODT exporter now in contrib/

2011-07-01 Thread Niels Giesen
Using latest org-mode, with org-odt included.

C-c C-e O complained about not finding OrgOdtAutomaticStyles.xml.
I patched org-odt.el to the following so that it could find it:

Could someone look into this? (e.g. I do not know whether this would break
non-integrated org-odt (or whether that matters at all at this stage)

diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el
index ad53204..2857bf9 100644
--- a/contrib/lisp/org-odt.el
+++ b/contrib/lisp/org-odt.el
@@ -70,7 +70,7 @@

 (defconst org-odt-lib-dir (file-name-directory load-file-name))
 (defconst org-odt-data-dir
-  (let ((dir1 (expand-file-name .. org-odt-lib-dir)); git
+  (let ((dir1 (expand-file-name ../odt org-odt-lib-dir));
git
(dir2 (expand-file-name ./contrib/odt org-odt-lib-dir))) ; elpa
 (cond
  ((file-directory-p dir1) dir1)




On Fri, Jul 1, 2011 at 11:37 AM, Bastien b...@altern.org wrote:

 Dear all,

 I'm please to announce that Jambunathan's ODT exporter is now in the
 contrib/ directory (in latest git repo) -- the files are here:

  contrib/odt/
  contrib/lisp/org-odt.el
  contrib/lisp/org-lparse.el
  contrib/lisp/org-xhtml.el

 Jambunathan and I are still actively tuning this major addition, please
 bare with us while we are making sure everything works as expected.

 We still need to update the documentation and a few things.

 Again, thanks a lot to Jambunathan for this wonderful addition and for
 his patience, and also thanks to Lennart who contributed to the initial
 effort and helped make this come true.

 The ODT exporter will live in contrib/ for Org 7.6 -- then we will work
 on integrating it to the core, so that it can safely move to Emacs one
 day.

 Happy hacking and testing to everyone!

 --
  Bastien




-- 
http://pft.github.com


Re: [O] Status google calendar sync

2011-06-11 Thread Niels Giesen
 When going from org - google, do I need to do anything about using
 org-icalendar-store-UID?  I'd rather not have to populate my org files
 with :ID: entries.

You do not strictly need to, but this is the only way you do not
create double events when exporting an org file to .ics and importing
it into google calendar. If you do use them, a change in a date in
org-mode will be reflected as such in google calendar.

Note that if you /do/ want to store uids for the reason I just wrote,
/and/ if you use diary sexps, you'll need an up-to-date Emacs (from
bazaar) and below patch to org-icalendar.el (this has not been applied
yet to org-mode, alas). Otherwise icalendar.el creates a new uid every
time you export anyway.

--- a/lisp/org-icalendar.el
+++ b/lisp/org-icalendar.el
@@ -412,7 +412,10 @@ When COMBINE is non nil, add the category to each line.
  (if scheduledp (setq summary (concat S:  summary)))
  (if (string-match \\`%% ts)
  (with-current-buffer sexp-buffer
-   (insert (substring ts 1 -1)   summary \n))
+   (let ((entry (substring ts 1 -1)))
+ (put-text-property 0 1 'uid
+(concat   prefix uid) entry)
+ (insert entry   summary \n)))
(princ (format BEGIN:VEVENT
 UID: %s
 %s


-- 
http://pft.github.com



Re: [O] understanding the function outline-level

2011-06-07 Thread Niels Giesen
Hi Michael,

match data get set by searches. One can inhibit match-data being
cluttered by using the `save-match-data' macro (you should probably do
so when using searches in a lisp program).

Outline.el seems to make very frequent use of this 'global' data;
instead of passing this data on via function arguments or so, it
depends on this dynamically set data, which makes it very hard to see
who does what.

Some prodding about led me to believe the searching in
`outline-back-to-heading' is your suspect (but I have not investigated
this further). At least

(progn
  (outline-back-to-heading)
  (outline-level))

Returns a reasonable answer each time I run it.

(info (Elisp)Match Data)

May be of interest to you.

On Tue, Jun 7, 2011 at 6:23 PM, Michael Brand
michael.ch.br...@gmail.com wrote:
 Hi all

 I am on the way of tracking down an (Org?) buglet and now
 outline-level tries to strike me with my lack of experience with
 Match Data of Emacs search and I would like to ask for some help to
 understand.

 M-: (outline-level) returns a value that I don't understand yet. The
 number does not correspond to the amount of stars and is independent
 of at the beginning of which line the point was before. And when I
 look at the implementation of outline-level I am missing a function
 that initializes the Match Data. Where is that last search or match
 operation?

 Michael





-- 
http://pft.github.com



Re: [O] Org Mode Calendar UID Mismatch.

2011-05-20 Thread Niels Giesen
Ghanashyam mail.ghanashyam.pra...@gmail.com writes:


[...]

 
 
 
 I check the ics file and I can perfectly see that the UIDs were
 replicated.(exactly same). Also all my events were scheduled but there
 is one parameter which said, SCHEDULED or unSCHEDULED, you export
 events. 

Ok. I assume this is `org-icalendar-use-scheduled'. I did not know of it.

 Its not about being exported or missing in export. The problem is the
 ics file has all the entries but multiple entries have the same UID
 which is my issue.

Could you please provide a minimal example of an org file + provide info
on your system setup (os, emacs version, org version, relevant
org-icalendar-* vars) so that we might be able to reproduce this?

Regards,
Niels



Re: [O] Org Mode Calendar UID Mismatch.

2011-05-20 Thread Niels Giesen
On Fri, May 20, 2011 at 11:40 AM, Ghanashyam
mail.ghanashyam.pra...@gmail.com wrote:
 Hi Niels,

 I had faced this issue quite a couple of weeks back and I kept on trying to
 export the calendar the whole day
 doing adjustments to the UID format, and I could get the UID format to have
 only 7 to 8 characters.

 I was suprised to see long UIDs being generated today with like
 SC-7ea97bae-a785-4455-8af7-6688cb8f7170 and
 looks like these are unique. I had never checked the export after that whole
 day of struggle. May be following a
 restart the changes might have taken place.

 This sounds so silly now. I apologize for wasting your time and effort. I am
 really sorry about this.

Oh well, this happens to all of us sometimes. Glad that it works now!



Re: [O] Org Mode Calendar UID Mismatch.

2011-05-19 Thread Niels Giesen
Greg Troxel g...@ir.bbn.com writes:

 Ghanashyam mail.ghanashyam.pra...@gmail.com writes:

 I have had a problem with the org mode calendar export with emacs.
 It looks like org mode uses some uid generation exe which
 generates non unique UIDs. I am not sure why this is to. Even when I
 set the UID format to include the date format. Because of this, the ics
 file import into google calendar or a thunderbird import fails to import all
 tasks that were reported as Scheduled in the org mode document.

 Anyone with similar experiences.? I put this up on stack overflow but
 there was no response.

 I'm haing the inverse problem, but I hadn't tracked it down enough to
 post.   I find that after importing into Apple iCal (mac 10.6), and
 doing another import, I end up with two events.

@Greg: 

Org-mode UIDs are ignored if they are for entries with diary sexps, as
calendar.el creates its own ids for them. This may be the cause for
double entries when you export your org file  import the ical file
multiple times and you use diary sexps. 

A while ago I submitted some patches, one to calendar.el and one to
org-icalendar.el, that - besides adding export of diary-float sexps -
fixed this (i.e. org-icalendar puts a UID text-property on the entry,
picked up by calendar.el when creating the ical entries).

The patches to calendar.el were applied, but I believe the one to
org-icalendar.el should still be applied. However, I believe Bastien has
had little time lately, or maybe he's forgotten or overseen that those
patches to Emacs have already been applied. I put Bastien in the CC of
this mail, just as a reminder.

See
http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg00668.html if
you want to try out the UID patch to org-icalendar.el. Note that you
also need a recent development Emacs (from bazaar, later than april 27th
2011) to have the other patches applied as well.

@Ghanashyam:

Above story aside, no entry should be without UID, and I think a
non-unique UID is highly improbable. Did you
check inside the ical file to see whether the entries you talk about
were eported at all? If I create a simple test file, e.g.

#+begin_src org
* test
  SCHEDULED: 2011-05-19 Thu 11:00
#+end_src

... and call C-c C-e i this entry does not get exported, but this entry would:

#+begin_src org
* test2
  2011-05-19 Thu 12:00
#+end_src

i.e., SCHEDULED entries aren't exported, while others are, but this does
not seem to have anything to do with UIDs.

Regards,
Niels.



-- 
http://pft.github.com/



Re: [O] lisp/org-clock.el: Add param :properties to list properties in clocktable

2011-05-18 Thread Niels Giesen
Hi Carsten,

thanks for merging, but today, pulling origin master (from
git://orgmode.org/org-mode.git) to start work on such a tutorial 
checkout the new documentation, I did not see the patch applied.
Should be somewhere near 5 days ago on
http://orgmode.org/w/org-mode.git.

Am I missing something here?

Regards,
Niels.

On Fri, May 13, 2011 at 2:20 PM, Carsten Dominik
carsten.domi...@gmail.com wrote:
 Hi Niels, I have merged your patch thanks.
 A tutorial on Worg for your use case would be really helpful.

 - Carsten

 On May 13, 2011, at 10:00 AM, Niels Giesen wrote:

 Carsten Dominik carsten.domi...@gmail.com writes:

 Dear Niels,

 I am confused by the three patch pieces applied to the same file.

 Hi Carsten. Sorry for the confusion; I thought atomic commits were the
 proper thing to do, but apparently they are not.

 Can you please resubmit, with a single patch, and a proper
 changelog-like entry?

 I hope my current attachment is in the appropriate form.

 0001-org-clock-Implement-columns-of-arbitrary-properties.patch
 Thanks.

 - Carsten

 On Mar 26, 2011, at 9:29 PM, Niels Giesen wrote:


 Here are a few patches to add property columns in clocktables. These
 allow me e.g. to freely set different cost centers which is wanted @
 my work, and also possibly small descriptions. It is generically set
 up so I reckon other people may find use in this too.

 The patches together add two parameters to the dynamic block line:

 : :properties (prop-this prop-other) :inherit-props t

 The property columns will be added at the left side of the existing
 columns; I did experiment with adding them to the right, but because
 of the variable number of levels (being defined both by :maxlevel and
 the actual number of found levels), that did not work out well.

 I used the parameter =:inherit-props= to set inheritance for
 properties, as I have learned in the past that
 =org-use-property-inheritance= should be used very sparingly.

 #+begin_src diff
 From 20346cf661e2b9ba0b4a66b705809e6100d9e8e0 Mon Sep 17 00:00:00 2001
 From: Niels Giesen niels.gie...@gmail.com
 Date: Sat, 26 Mar 2011 10:19:08 +0100
 Subject: [PATCH 1/3] org-clock: Add properties param handling to 
 `org-clock-get-table-data'

 This param should be a list of strings referring to properties. Those
 properties will be returned in an alist when found in an entry.
 ---
 lisp/org-clock.el |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

 diff --git a/lisp/org-clock.el b/lisp/org-clock.el
 index c567a26..df096d1 100644
 --- a/lisp/org-clock.el
 +++ b/lisp/org-clock.el
 @@ -1,6 +1,6 @@
 ;;; org-clock.el --- The time clocking code for Org-mode

 -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
 +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   Free Software Foundation, Inc.

 ;; Author: Carsten Dominik carsten at orgmode dot org
 @@ -2335,6 +2335,7 @@ TIME:      The sum of all time spend in this tree, 
 in minutes.  This time
      (block (plist-get params :block))
      (link (plist-get params :link))
      (tags (plist-get params :tags))
 +    (properties (plist-get params :properties))
      (matcher (if tags (cdr (org-make-tags-matcher tags
      cc range-text st p time level hdl props tsp tbl)

 @@ -2388,8 +2389,15 @@ TIME:      The sum of all time spend in this tree, 
 in minutes.  This time
                       (or (cdr (assoc SCHEDULED props))
                           (cdr (assoc DEADLINE props))
                           (cdr (assoc TIMESTAMP props))
 -                         (cdr (assoc TIMESTAMP_IA props)
 -         (when ( time 0) (push (list level hdl tsp time) tbl))
 +                         (cdr (assoc TIMESTAMP_IA props
 +       props (when properties
 +               (remove nil
 +                       (mapcar
 +                        (lambda (p)
 +                          (when (org-entry-get (point) p)
 +                            (cons p (org-entry-get (point) p
 +                        properties
 +         (when ( time 0) (push (list level hdl tsp time props) tbl))
      (setq tbl (nreverse tbl))
      (list file org-clock-file-total-minutes tbl

 --
 1.7.1
 #+end_src

 #+begin_src diff
 From a5da80e0b42256e1a1ea07e213bcae3685786589 Mon Sep 17 00:00:00 2001
 From: Niels Giesen niels.gie...@gmail.com
 Date: Sat, 26 Mar 2011 11:05:33 +0100
 Subject: [PATCH 2/3] org-clock: Add properties param handling to 
 `org-clocktable-write-default'

 Each property specified in properties will get a column in the clocktable.
 ---
 lisp/org-clock.el |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

 diff --git a/lisp/org-clock.el b/lisp/org-clock.el
 index df096d1..a330db0 100644
 --- a/lisp/org-clock.el
 +++ b/lisp/org-clock.el
 @@ -2052,6 +2052,7 @@ from the dynamic block defintion.
      (emph (plist-get params :emphasize))
      (level-p (plist-get params :level))
      (timestamp (plist-get params :timestamp

Re: [O] lisp/org-clock.el: Add param :properties to list properties in clocktable

2011-05-13 Thread Niels Giesen
Carsten Dominik carsten.domi...@gmail.com writes:

 Dear Niels,

 I am confused by the three patch pieces applied to the same file.

Hi Carsten. Sorry for the confusion; I thought atomic commits were the
proper thing to do, but apparently they are not.

 Can you please resubmit, with a single patch, and a proper
 changelog-like entry?

I hope my current attachment is in the appropriate form.

From 9065d22f5e41d73a47c72e6ee3f70bd974bee9ff Mon Sep 17 00:00:00 2001
From: niels giesen niels.gie...@gmail.com
Date: Fri, 13 May 2011 09:43:15 +0200
Subject: [PATCH] org-clock: Implement columns of arbitrary properties for clocktables.

* org-mode/lisp/org-clock.el (org-clocktable-write-default): List
  properties in their own columns.
  (org-clock-get-table-data): Return alist of properties specified in
  a clocktable's `BEGIN' line under :properties, inherited when
  :inherit-props is non-nil.

Each property specified in :properties parameter of a clocktable's
`BEGIN' line will get a column in the clocktable, at the left side of
that table. When :inherit-props is specified, such properties will be
inherited.
---
 lisp/org-clock.el |   25 ++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index efeb72f..127f041 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1,6 +1,6 @@
 ;;; org-clock.el --- The time clocking code for Org-mode
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik carsten at orgmode dot org
@@ -2059,6 +2059,7 @@ from the dynamic block defintion.
 	 (emph (plist-get params :emphasize))
 	 (level-p (plist-get params :level))
 	 (timestamp (plist-get params :timestamp))
+	 (properties (plist-get params :properties))
 	 (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
 	 (rm-file-column (plist-get params :one-file-with-archives))
 	 (indent (plist-get params :indent))
@@ -2122,6 +2123,7 @@ from the dynamic block defintion.
 	 (if multifile | )  ; file column, maybe
 	 (if level-p   | )  ; level column, maybe
 	 (if timestamp | )  ; timestamp column, maybe
+	 (if properties (make-string (length properties) ?|) )  ;properties columns, maybe
 	 (format %d| |\n narrow)))  ; headline and time columns
 
   ;; Insert the table header line
@@ -2130,6 +2132,7 @@ from the dynamic block defintion.
(if multifile (concat (nth 1 lwords) |) )  ; file column, maybe
(if level-p   (concat (nth 2 lwords) |) )  ; level column, maybe
(if timestamp (concat (nth 3 lwords) |) )  ; timestamp column, maybe
+   (if properties (concat (mapconcat 'identity properties |) |) ) ;properties columns, maybe
(concat (nth 4 lwords) | 
 	   (nth 5 lwords) |\n)) ; headline and time columns
 
@@ -2141,6 +2144,7 @@ from the dynamic block defintion.
  ; file column, maybe
(if level-p   |  ); level column, maybe
(if timestamp |  ); timestamp column, maybe
+   (if properties (make-string (length properties) ?|) )  ;properties columns, maybe
(concat * (nth 7 lwords) *| ) ; instead of a headline
*
(org-minutes-to-hh:mm-string (or total-time 0)) ; the time
@@ -2164,6 +2168,7 @@ from the dynamic block defintion.
 		   (file-name-nondirectory (car tbl))
 		   (if level-p   |  ) ; level column, maybe
 		   (if timestamp |  ) ; timestamp column, maybe
+		   (if properties (make-string (length properties) ?|) )  ;properties columns, maybe
 		   (org-minutes-to-hh:mm-string (nth 1 tbl) ; the time
 
 	;; Get the list of node entries and iterate over it
@@ -2188,6 +2193,11 @@ from the dynamic block defintion.
 	   (if multifile | ); free space for file name column?
 	   (if level-p (format %d| (car entry)) )   ; level, maybe
 	   (if timestamp (concat (nth 2 entry) |) ) ; timestamp, maybe
+	   (if properties
+		   (concat
+		(mapconcat
+		 (lambda (p) (or (cdr (assoc p (nth 4 entry))) ))
+		 properties |) |) )  ;properties columns, maybe
 	   (if indent (org-clocktable-indent-string level) ) ; indentation
 	   hlc headline hlc |; headline
 	   (make-string (min (1- ntcol) (or (- level 1))) ?|)
@@ -2342,6 +2352,8 @@ TIME:  The sum of all time spend in this tree, in minutes.  This time
 	 (block (plist-get params :block))
 	 (link (plist-get params :link))
 	 (tags (plist-get params :tags))
+	 (properties (plist-get params :properties))
+	 (inherit-property-p (plist-get params :inherit-props))
 	 (matcher (if tags (cdr (org-make-tags-matcher tags
 	 cc range-text st p time level hdl props tsp tbl)
 
@@ -2395,8 +2407,15 @@ TIME:  The sum of all time spend in this tree, in minutes.  This time
 			  (or (cdr (assoc SCHEDULED props))
 			  (cdr (assoc

Re: [O] Re: How to display a diary entry in agenda week view only today

2011-04-11 Thread Niels Giesen
date is a dynamically bound variable at the time of evaluation.

On Mon, Apr 11, 2011 at 1:57 PM, Rainer Stengele
rainer.steng...@diplan.de wrote:
 Am 11.04.2011 10:36, schrieb Suvayu Ali:
 On Mon, 11 Apr 2011 08:52:52 +0200
 Rainer Stengele rainer.steng...@diplan.de wrote:

 Hi!

 In one of my org agenda files I have

 #+CATEGORY: Sunrise
 %%(diary-sunrise-sunset)

 Now, when I am in weekly agenda view the sunrise-sunset shows under
 every day. This is kind of too much line noise and distracting for me
 - I would like to only see the entry for today.

 Is there a way to restrict the display of such a diary entry in the
 weekly agenda view to only today?


 How about this,

 %%(if (calendar-date-equal date (calendar-current-date)) 
 (diary-sunrise-sunset))

 Regards,
 Rainer


 Perfect, thanks.

 I can find the other functions in calendar.el,
 but where is date from?

 Best,
 Rainer





-- 
http://pft.github.com



Re: [O] Re: How to display a diary entry in agenda week view only today

2011-04-11 Thread Niels Giesen
Or something like the following (not bullet-proof I guess):

(defmacro test-diary-sexp (date rest body)
  `(let ((date ,date))
 ,@body))

(test-diary-sexp
 (calendar-current-date)
 (org-google-weather De Bilt nl))

... and in calendar-current-date lies your answer to the format question.

I do not know however whether or not `date' is the only variable that
is bound dynamically for sexps though; this is something that make me
go crazy too, so (better) documentation might be in order for one.


On Mon, Apr 11, 2011 at 4:55 PM, Nick Dokos nicholas.do...@hp.com wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com wrote:

 On Mon, 11 Apr 2011 14:55:24 +0200
 Niels Giesen niels.gie...@gmail.com wrote:

  On Mon, Apr 11, 2011 at 1:57 PM, Rainer Stengele
  rainer.steng...@diplan.de wrote:
   Am 11.04.2011 10:36, schrieb Suvayu Ali:
   On Mon, 11 Apr 2011 08:52:52 +0200
  
   %%(if (calendar-date-equal date (calendar-current-date))
   (diary-sunrise-sunset))
  
   Perfect, thanks.
  
   I can find the other functions in calendar.el,
   but where is date from?
  
 
  date is a dynamically bound variable at the time of evaluation.
 

 I have a question I have been meaning to ask for a long time. How does
 one test sexps with variables like these? I have tried the scratch
 buffer but it gives errors like (void-variable date). I found the only
 way I could test is to put it on one of the agenda files.

 Any suggestions?


 Bind date explicitly in the scratch buffer and then evaluate:

 (setq date '(4 11 2011))

 ...

 I think the format is (month day year) but be sure to check.

 Nick




-- 
http://pft.github.com



[O] Re: lisp/org-clock.el: Add param :properties to list properties in clocktable

2011-03-28 Thread Niels Giesen

 Bernt Hansen be...@norang.ca writes:

 Thanks for the example.  That helps a lot.  I think posting this to Worg
 would be very useful.

Hi Bernt, I will do so if/when these patches get accepted ;)



-- 
http://pft.github.com/



[O] Re: lisp/org-clock.el: Add param :properties to list properties in clocktable

2011-03-27 Thread Niels Giesen
Bernt Hansen be...@norang.ca writes:

[...]

 Could you provide a sample clock report using this patch to get a
 better idea of why you find this useful?

Yes, here you are, along with the contents of a sample file, so that you
may get a gist of my need for inheritance.

* Clocktables
  #+BEGIN: clocktable :maxlevel 2 :scope file :properties (Costcenter 
Billable) :inherit-props t
  Clock summary at [2011-03-27 Sun 12:04]
  
  | Costcenter| Billable | Headline 
   |   Time |  |
  
|---+--+-++--|
  |   |  | *Total time* 
   | *3:08* |  |
  
|---+--+-++--|
  | A-102: General Administration |  | TODO Travel cost declaration 
   |   0:42 |  |
  | A-102: General Administration |  | TODO December 2007-2009  
   || 0:37 |
  | O-100: General overhead   |  | Making coffee for the lot of 
us |   0:06 |  |
  | C-100: Customer relations general |  | Helpdesk 
   |   1:10 |  |
  | C-100: Customer relations general |  | Categorize our helpdesk 
e-mails || 0:20 |
  | C-101: Customer A | [X]  | Help out customer a  
   || 0:10 |
  | C-102: Customer B | [?]  | Help out customer b on issue 
x  || 0:20 |
  | C-100: Customer relations general |  | Help out potential customer 
c   || 0:20 |
  | W-100: Web Development|  | Develop our main web app 
   |   1:10 |  |
  | W-100: Web Development|  | that 
   || 0:41 |
  | C-102: Customer B | [?]  | something only customer b 
wants || 0:29 |
  #+END:

Actually, my boss needs something more like the table below, which I
can export to something that Outlook Times also spits out (some
clocking plugin for MS Outlook that the rest of us uses, and I was
supposed to use too, you may understand that that is just a silly idea
for someone used to org-mode).

Patches 1 and 3 allowed me to get this specific output using a custom
formatter and a #+TBLFM: line, which I may post to Worg if people are
interested.

#+BEGIN: clocktable :formatter org-clocktable-write-outlook-times-style 
:maxlevel 2 :scope file :inherit-props t :properties (Costcenter Billable) 
:date t :block day
Clock summary at [2011-03-27 Sun 12:04], for Sunday, March 27, 2011.

|   Date | Headline  |   
Time | Costcenter| Billable |
|+---++---+--|
|| *Total time*  | 
*3.05* |   |  |
|+---++---+--|
| 27-03-2011 | TODO Travel cost declaration  |   
0.00 | A-102: General Administration |  |
| 27-03-2011 | TODO Travel cost declaration, TODO December 2007-2009 |   
0.62 | A-102: General Administration |  |
|+---++---+--|
| 27-03-2011 | Making coffee for the lot of us   |   
0.10 | O-100: General overhead   |  |
|+---++---+--|
| 27-03-2011 | Helpdesk  |   
0.00 | C-100: Customer relations general |  |
| 27-03-2011 | Helpdesk, Categorize our helpdesk e-mails |   
0.33 | C-100: Customer relations general |  |
| 27-03-2011 | Helpdesk, Help out customer a |   
0.17 | C-101: Customer A | [X]  |
| 27-03-2011 | Helpdesk, Help out customer b on issue x  |   
0.33 | C-102: Customer B | [?]  |
| 27-03-2011 | Helpdesk, Help out potential customer c   |   
0.33 | C-100: Customer relations general |  |
|+---++---+--|
| 27-03-2011 | Develop our main web app  |   
0.00 | W-100: Web Development|  |
| 27-03-2011 | Develop our main web app, that|   
0.68 | W-100: Web Development|  |
| 27-03-2011 | Develop our main web app, something only customer b wants |   
0.48 | C-102: 

[O] lisp/org-clock.el: Add param :properties to list properties in clocktable

2011-03-26 Thread Niels Giesen

Here are a few patches to add property columns in clocktables. These
allow me e.g. to freely set different cost centers which is wanted @
my work, and also possibly small descriptions. It is generically set
up so I reckon other people may find use in this too.

The patches together add two parameters to the dynamic block line:

: :properties (prop-this prop-other) :inherit-props t

The property columns will be added at the left side of the existing
columns; I did experiment with adding them to the right, but because
of the variable number of levels (being defined both by :maxlevel and
the actual number of found levels), that did not work out well.

I used the parameter =:inherit-props= to set inheritance for
properties, as I have learned in the past that
=org-use-property-inheritance= should be used very sparingly.

#+begin_src diff
From 20346cf661e2b9ba0b4a66b705809e6100d9e8e0 Mon Sep 17 00:00:00 2001
From: Niels Giesen niels.gie...@gmail.com
Date: Sat, 26 Mar 2011 10:19:08 +0100
Subject: [PATCH 1/3] org-clock: Add properties param handling to 
`org-clock-get-table-data'

This param should be a list of strings referring to properties. Those
properties will be returned in an alist when found in an entry.
---
 lisp/org-clock.el |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index c567a26..df096d1 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1,6 +1,6 @@
 ;;; org-clock.el --- The time clocking code for Org-mode
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik carsten at orgmode dot org
@@ -2335,6 +2335,7 @@ TIME:  The sum of all time spend in this tree, in 
minutes.  This time
 (block (plist-get params :block))
 (link (plist-get params :link))
 (tags (plist-get params :tags))
+(properties (plist-get params :properties))
 (matcher (if tags (cdr (org-make-tags-matcher tags
 cc range-text st p time level hdl props tsp tbl)
 
@@ -2388,8 +2389,15 @@ TIME:  The sum of all time spend in this tree, in 
minutes.  This time
  (or (cdr (assoc SCHEDULED props))
  (cdr (assoc DEADLINE props))
  (cdr (assoc TIMESTAMP props))
- (cdr (assoc TIMESTAMP_IA props)
- (when ( time 0) (push (list level hdl tsp time) tbl))
+ (cdr (assoc TIMESTAMP_IA props
+   props (when properties
+   (remove nil
+   (mapcar
+(lambda (p)
+  (when (org-entry-get (point) p)
+(cons p (org-entry-get (point) p
+properties
+ (when ( time 0) (push (list level hdl tsp time props) tbl))
   (setq tbl (nreverse tbl))
   (list file org-clock-file-total-minutes tbl
 
-- 
1.7.1
#+end_src

#+begin_src diff
From a5da80e0b42256e1a1ea07e213bcae3685786589 Mon Sep 17 00:00:00 2001
From: Niels Giesen niels.gie...@gmail.com
Date: Sat, 26 Mar 2011 11:05:33 +0100
Subject: [PATCH 2/3] org-clock: Add properties param handling to 
`org-clocktable-write-default'

Each property specified in properties will get a column in the clocktable.
---
 lisp/org-clock.el |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index df096d1..a330db0 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2052,6 +2052,7 @@ from the dynamic block defintion.
 (emph (plist-get params :emphasize))
 (level-p (plist-get params :level))
 (timestamp (plist-get params :timestamp))
+(properties (plist-get params :properties))
 (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
 (rm-file-column (plist-get params :one-file-with-archives))
 (indent (plist-get params :indent))
@@ -2115,6 +2116,7 @@ from the dynamic block defintion.
 (if multifile | )  ; file column, maybe
 (if level-p   | )  ; level column, maybe
 (if timestamp | )  ; timestamp column, maybe
+(if properties (make-string (length properties) ?|) )  ;properties 
columns, maybe
 (format %d| |\n narrow)))  ; headline and time columns
 
   ;; Insert the table header line
@@ -2123,6 +2125,7 @@ from the dynamic block defintion.
(if multifile (concat (nth 1 lwords) |) )  ; file column, maybe
(if level-p   (concat (nth 2 lwords) |) )  ; level column, maybe
(if timestamp (concat (nth 3 lwords) |) )  ; timestamp column, maybe
+   (if properties (concat (mapconcat 'identity properties |) |) ) 
;properties columns, maybe
(concat (nth 4 lwords) | 
   (nth 5 lwords

Re: [O] Release 7.5

2011-03-07 Thread Niels Giesen
Congratulations and a lot of thanks for the great work!

Niels.
-- 
http://pft.github.com/



Re: [Orgmode] More entries able to export to icalendar format

2011-02-12 Thread Niels Giesen
Hi Bastien,

 Both attaching and quoting patches should be fine.

Alright, I will quote the patches, so that readers of the list can also
easily access them. The details are described in the patches. By the
way, I have made some changes since I last sent my redefinitions of
these functions, as a few things did not work correctly. They do now.

First, a tiny change to org-icalendar, adding the uid as a text-property:
   
#+begin_src diff
From 4ed18aa7aa13ac02784ad536fff5d5719f2942b9 Mon Sep 17 00:00:00 2001
From: Niels Giesen niels.gie...@gmail.com
Date: Fri, 11 Feb 2011 13:59:12 +0100
Subject: [PATCH] Add uid text property to diary entries

* lisp/org-icalendar.el (org-print-icalendar-entries): Add 'uid text
  property based on the ID property of the org entry to the first
  character of the diary entry.

This text property can be used by `icalendar--create-uid', instead
of creating a uid by itself.

NOTE: `icalendar--create-uid' should be patched to pick up this uid.

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

diff --git a/lisp/org-icalendar.el b/lisp/org-icalendar.el
index 3583e6a..093ff93 100644
--- a/lisp/org-icalendar.el
+++ b/lisp/org-icalendar.el
@@ -412,7 +412,10 @@ When COMBINE is non nil, add the category to each line.
  (if scheduledp (setq summary (concat S:  summary)))
  (if (string-match \\`%% ts)
  (with-current-buffer sexp-buffer
-   (insert (substring ts 1 -1)   summary \n))
+   (let ((entry (substring ts 1 -1)))
+ (put-text-property 0 1 'uid
+(concat   prefix uid) entry)
+ (insert entry   summary \n)))
(princ (format BEGIN:VEVENT
 UID: %s
 %s
-- 
1.7.1

#+end_src   

Then, in icalendar.el, pick up that uid:

#+begin_src diff
From 9958d2783887dde8bcd6d50a28ecbafca31eb7c1 Mon Sep 17 00:00:00 2001
From: Niels Giesen niels.gie...@gmail.com
Date: Fri, 11 Feb 2011 14:23:33 +0100
Subject: [PATCH 1/2] Pick up uid that may have been set by another application, 
e.g.
 org-mode.

* lisp/calendar/icalendar.el (icalendar--create-uid): get a value for
uid from 'uid text-property from first character of the entry, if
existing, otherwise create the uid as before.
---
 lisp/calendar/icalendar.el |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index ca88548..b1d2bba 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -925,7 +925,10 @@ ENTRY-FULL is the full diary entry string.  CONTENTS is the
 current iCalendar object, as a string.  Increase
 `icalendar--uid-count'.  Returns the UID string.
   (let ((uid icalendar-uid-format))
-
+(if
+   ;;Allow other apps (such as org-mode) to create its own uid
+   (get-text-property 0 'uid entry-full)
+   (setq uid (get-text-property 0 'uid entry-full))
 (setq uid (replace-regexp-in-string
   %c
   (format %d icalendar--uid-count)
@@ -945,7 +948,7 @@ current iCalendar object, as a string.  Increase
 (let ((dtstart (if (string-match ^DTSTART[^:]*:\\([0-9]*\\) contents)
(substring contents (match-beginning 1) (match-end 1))
DTSTART)))
-  (setq uid (replace-regexp-in-string %s dtstart uid t t)))
+  (setq uid (replace-regexp-in-string %s dtstart uid t t
 
 ;; Return the UID string
 uid))
-- 
1.7.1

#+end_src

And finally, the largest change, as it implements exports of `diary-float':

#+begin_src diff
From a2db198dae5210fa3d2a4353667f2c75d28cd16a Mon Sep 17 00:00:00 2001
From: Niels Giesen niels.gie...@gmail.com
Date: Sat, 12 Feb 2011 18:12:16 +0100
Subject: [PATCH 2/2] Export `diary-float' entries.

* lisp/calendar/icalendar.el (require 'diary-lib): diary-lib required
by code now used in `icalendar--convert-float-to-ical'.
* lisp/calendar/icalendar.el (icalendar--convert-float-to-ical):
Implement the body of this function instead of backing out.

This change implements the export of `diary-float' entries save for
those with the optional day entry.

The current date is used as the start date (but excluded if the
current date does not match the `diary-float' arguments).

The use of the current date as the start date is quite arbitrary, in
the same way as the start dates for weekly and yearly events are
arbitrary. It might be wise to bring the behaviour for these different
entries more in line with each other, perhaps leaving the user a
choice via customization.
---
 lisp/calendar/icalendar.el |   74 ---
 1 files changed, 62 insertions(+), 12 deletions(-)

diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index b1d2bba..38a74df 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -34,6 +34,8 @@
 ;;   week of the year 2000 when they are exported.
 ;; - Yearly diary entries

Re: [Orgmode] More entries able to export to icalendar format

2011-02-11 Thread Niels Giesen

Hi Bastien,

 Can you submit your changes in the form of a patch, precisely describing
 your changes?  This way I can more easily try to understand/test them.

I will do so. What is the preferred way to do so: attaching those patches or 
quoting them
in-line?

Niels
-- 
http://pft.github.com/

___
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] More entries able to export to icalendar format

2011-02-04 Thread Niels Giesen

When exporting to icalendar format, not all of the %%(diary-* )
style entries are supported.  

It concerns the functions =icalendar--convert-float-to-ical= and
=icalendar--convert-date-to-ical= in icalendar.el. 

I took a stab at ameliorating =icalendar--convert-float-to-ical=, and
would like your early comments before going further.

Some issues arised when implementing:

1. What start date should be used? It now uses todays date, and
   EXDATEs that date again when it does not conform to the given rule.
   This means that when updating a calendar via this method, all past
   days are lost. This is probably what I would want, as I would be
   more interested in the reminders than in history. An alternative
   might be to set a date in the past, e.g. 1-1-1970. I believe there
   is no way in the diary entry itself to set start and end days for
   this. In the comments in =icalendar.el= it says
   #+begin_src emacs-lisp
 ;;   Please note:
 ;; - Diary entries which have a start time but no end time are assumed to
 ;;   last for one hour when they are exported.
 ;; - Weekly diary entries are assumed to occur the first time in the first
 ;;   week of the year 2000 when they are exported.
 ;; - Yearly diary entries are assumed to occur the first time in the year
 ;;   1900 when they are exported.
   #+end_src
   It seems all options are a bit arbitrary. Too bad one cannot
   specify the start (and end) date in the sexp itself.
2. I do not see a way in the icalendar specs to implement the day
   argument to =diary-float=.
3. UIDs are generated by icalendar.el while we probably would like to
   use the UIDs org-mode generates, as that would allow
   synchronization. This problem holds true for other already working
   diary-* entries as well. To tackle this, I also hacked at
   =org-print-icalendar-entries= to add the UID as a text property and
   =icalendar--create-uid= to read it out if existing. Although it
   works, it does feel kinda hackish.
4. Above UID solution leaves a problem when there are multiple
   timestamps set for an entry. For instance, part my job is to act
   as a helpdesk every week on wednesday *and* on each third thursday
   of the month (yes, sad sad me), so I like an entry like
   #+begin_src org
 ,** Helpdesk
 ,  :PROPERTIES:
 ,  :ID:   4705-5861-79a741ea-8408-c3236f5a472b
 ,  :END:
 ,  2011-02-02 wo +1w
 ,  %%(diary-float t 4 3)
   #+end_src
  To overcome this problem one could
   - use two separate entries (ugly, but effective and easy
 (out-of-the-box), also probably the best way to go for a two-way
 sync),
   - find some way to merge ical entries with the same UID, or
   - add something (an index or so for each date entry) to the UID
   - 
5. I wouldn't know if or how to accomodate for timezones.

As I have been doing my hacks via litterate programming style in an
org-mode file, true patches are lacking at the moment. I hope you'll
excuse me the ensuing longevity of this post.

I am interested in your thoughts, especially on how this may best work
with a two-way sync system.

The function that started it: =icalendar--convert-float-to-ical=

#+begin_src emacs-lisp :tangle yes
  (defun icalendar--convert-float-to-ical (nonmarker entry-main)
Convert float diary entry to icalendar format -- partially unsupported!

FIXME! DAY from diary-float yet unimplemented.

NONMARKER is a regular expression matching the start of non-marking
entries.  ENTRY-MAIN is the first line of the diary entry.
(if (string-match (concat nonmarker
  %%\\((diary-float \\([^)]+\\))\\s-*\\(.*?\\)\\) 
?$)
  entry-main)
(with-temp-buffer
  (insert (match-string 1 entry-main))
  (goto-char (point-min))
  (let* ((sexp (read (current-buffer)))
 (month (nth 1 sexp))
 (dayname (nth 2 sexp))
 (n (nth 3 sexp))
 (day (nth 4 sexp))
 (summary (buffer-substring (point) (point-max
(list sexp month dayname n day summary)

(when day
  (progn
(icalendar--dmsg diary-float %s entry-main)
(error Don't know if or how to implement day in 
`diary-float')))
  
(list (concat
   ;;Start today:
   \nDTSTART;
   VALUE=DATE:
   (format-time-string %Y%m%d (current-time))
   ;;BUT remove today if diary-float
   ;;expression does not hold true for today:
   (when
   (null (let ((date (calendar-current-date)))
   (diary-float month dayname n)))
 (concat 
  \nEXDATE;
  VALUE=DATE:
  (format-time-string %Y%m%d (current-time
   \nRRULE:
 

Re: [Orgmode] $0 replaced with ampersand () when invoking `org-edit-special'

2011-01-31 Thread Niels Giesen
On 30-1-2011 17:32, David Maus wrote:
 At Sun, 09 Jan 2011 14:36:45 +0100,
 David Maus wrote:
 I can reproduce this with

 Org-mode version 7.4 (release_7.4.135.g84087)

 GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
  of 2010-12-11 on raven, modified by Debian

 And it sure looks like a bug to me.
 I did a first shot on a fix but are currently stuck with the question
 how to represent a reference to the current cell ($0) in the
 alphabetical notation.  Any suggestions?


Great to hear you are working on this. Perhaps simply keep $0, that
would mean no changes to the documentation are needed. Or maybe the
single ampersand () that is currently substituted for $0...

Thing is, of course, that whatever is the substitution should work in
calculations.

Anyone else wanting to chime in?

Regards,
Niels.

 Best,
   -- David
 --
 OpenPGP... 0x99ADB83B5A4478E6
 Jabber dmj...@jabber.org
 Email. dm...@ictsoc.de


 ___
 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] Property inheritance for MAIL_FMT, MAIL_TO, MAIL_CC and MAIL_BCC

2011-01-13 Thread niels giesen
Hi Eric,

Please see the patch below, it adds property inheritance for all
MAIL_* properties, based on the value of
`org-use-property-inheritance'.

#+begin_src diff
  diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el
  index 68a3498..ae430fb 100644
  --- a/contrib/lisp/org-mime.el
  +++ b/contrib/lisp/org-mime.el
  @@ -232,9 +232,9 @@ export that region, otherwise export the entire body.
   (run-hooks 'org-mime-send-subtree-hook)
   (let* ((file (buffer-file-name (current-buffer)))
 (subject (nth 4 (org-heading-components)))
  -  (to (org-entry-get nil MAIL_TO))
  -  (cc (org-entry-get nil MAIL_CC))
  -  (bcc (org-entry-get nil MAIL_BCC))
  +  (to (org-entry-get nil MAIL_TO org-use-property-inheritance))
  +  (cc (org-entry-get nil MAIL_CC org-use-property-inheritance))
  +  (bcc (org-entry-get nil MAIL_BCC org-use-property-inheritance))
 (body (buffer-substring
(save-excursion (goto-char (point-min))
(forward-line 1)
  @@ -311,6 +311,8 @@ export that region, otherwise export the entire body.
 exported to a org format or to the format specified by the
 MAIL_FMT property of the subtree.
 (interactive)
  -  (org-mime-send-subtree (or (org-entry-get nil MAIL_FMT) 'org)))
  +  (org-mime-send-subtree (or (org-entry-get nil MAIL_FMT
  +   org-use-property-inheritance)
  +'org)))
   
   (provide 'org-mime)
#+end_src

The current mail was sent with it, where some parent tree has the
mail_cc set to this list, but the mail_to set to your email address in
the subtree. I believe this functionality can be quite handy.

niels
--
http://pft.github.com


pgpoEcaCdnUzG.pgp
Description: PGP signature
___
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] Default directory in org-agenda-mode

2011-01-12 Thread niels giesen
Hi all,

I would like `default-directory' in `org-agenda-mode' to be the
value of `org-directory'. This is because I tend to start my
working day by opening the Agenda view, and then decide to open
some org file (which I all have inside `org-directory' and that
may or may not have items present in the specific Agenda view). 

To this end I tried doing the following:

#+begin_src emacs-lisp
  (add-to-list
   'default-directory-alist
   `(org-agenda-mode
 ,org-directory))
#+end_src

But this does not work. Any ideas?

Regards, Niels.

___
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] Default directory in org-agenda-mode

2011-01-12 Thread Niels Giesen
Hi Nick,

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

[...]

 AFAIK, there is no variable default-directory-alist - at least, my
 emacs does not know anything about it.

Ah, yes, I see it's provided by dired-x, which does ship with emacs, but
is not loaded by default.

Its documentation says

#+begin_example
Alist of major modes and their opinion on `default-directory'.
This is given as a Lisp expression to evaluate.  A resulting value of
nil is ignored in favor of `default-directory'.
#+end_example

Looking some more into the code, it looks like it is not meant to be a
generic replacement for `default-directory', although its name would
suggest that (to me at least).

[...]

(eval-after-load org-agenda
  (quote
(progn 
   ...
   (add-hook 'org-agenda-mode-hook (function (lambda () (setq 
 default-directory org-directory)))

That is a great solution, thanks!

[...]


-- 
http://pft.github.com/

___
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-mode table with backslash inside fails to export to DocBook

2011-01-07 Thread niels giesen
Hi Baoqiu,

  A file with the following contents fails to export to Docbook:

#+begin_src org
  ,* Table with a backslash in it
  
  ,  | \ |
  
#+end_src

It gives the following error 

#+begin_example
  Invalid use of `\' in replacement text
#+end_example

The following changes (replace-match literally in
`org-export-docbook-finalize-table') solves this problem for me, but I
would not know whether this would break anything else.

#+begin_src diff
diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el
index 91ebb97..ed835b0 100644
--- a/lisp/org-docbook.el
+++ b/lisp/org-docbook.el
@@ -1367,7 +1367,7 @@ TABLE is a string containing the HTML code generated by
 (match-string 1 table)
 (match-string 4 table)
 /table)
-nil nil table)
+nil t table)
table))
 ;; Change table into informaltable if caption does not exist.
 (if (string-match
@@ -1377,7 +1377,7 @@ TABLE is a string containing the HTML code generated by
   (match-string 1 table-with-label)
   (match-string 3 table-with-label)
   /informaltable)
-  nil nil table-with-label)
+  nil t table-with-label)
   table-with-label)))
 
 ;; Note: This function is very similar to
#+end_src

Regards,
Niels.

--

http://pft.github.com


pgplH6vDsyEZK.pgp
Description: PGP signature
___
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-mode table with backslash inside fails to export to DocBook (now right)

2011-01-07 Thread niels giesen
Hi list, Baoqiu,

A file with the following contents fails to export to Docbook:

#+begin_src org
  ,* Table with a backslash in it
  
  ,  | \ |
#+end_src

It gives the following error 

#+begin_example
  Invalid use of `\' in replacement text
#+end_example

The following changes (replace-match literally in
`org-export-docbook-finalize-table') solves this problem for me, but I
would not know whether this would break anything else.

#+begin_src diff
diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el
index 91ebb97..ed835b0 100644
--- a/lisp/org-docbook.el
+++ b/lisp/org-docbook.el
@@ -1367,7 +1367,7 @@ TABLE is a string containing the HTML code generated by
 (match-string 1 table)
 (match-string 4 table)
 /table)
-nil nil table)
+nil t table)
table))
 ;; Change table into informaltable if caption does not exist.
 (if (string-match
@@ -1377,7 +1377,7 @@ TABLE is a string containing the HTML code generated by
   (match-string 1 table-with-label)
   (match-string 3 table-with-label)
   /informaltable)
-  nil nil table-with-label)
+  nil t table-with-label)
   table-with-label)))
 
 ;; Note: This function is very similar to
#+end_src

Regards,
Niels.

(note: i inadvertently posted a multi-mime message before this one, playing with
org-mime-subtree, please forget that one)

--

http://pft.github.com

___
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: Sending org buffer as mail?

2010-12-27 Thread Niels Giesen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Sorry list for the last two mails (the ones with attachments), I messed
things up there. Below the mail I sent to Eric, but forgot to copy
carbonically to the list.

Eric Schulte schulte.e...@gmail.com writes:

 Niels Giesen niels.gie...@gmail.com writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Niels Giesen niels.gie...@gmail.com writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Thanks, I've just pushed up a new version of org-mime which makes use of
 this function.


 Hi Eric, thanks for implementing this.

 However, I see a problem in the solution for when html-ascii is
 specified as the MAIL_FMT, being that the same hook will be run for both
 parts of the message. I think it better not to have a html-ascii hook
 and run the html hook for the html part and the ascii hook for the ascii
 part. Otherwise the ascii hook may for instance delete a =BEGIN_SRC=
 line and insert cut lines not needed by html.

 Same goes for html (which is in fact html-org). Although I cannot really
 think of any hooks I might want to run there.


 Thanks for pointing this out.  I've just pushed up a fix which
 implements a single hook for each format, and (as you suggested) runs
 each hook over only the related mime part of the message.


Thanks. I think I noticed a bug though, being that
`org-mime-pre-html-hook' is run for the ascii and org parts of
html-ascii and org. The code below should fix this:

#+begin_src diff
  Changes in HEAD
  Modified contrib/lisp/org-mime.el
  diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el
  index 48c898e..68a3498 100644
  --- a/contrib/lisp/org-mime.el
  +++ b/contrib/lisp/org-mime.el
  @@ -293,7 +293,8 @@ export that region, otherwise export the entire body.
 (html (org-mime-apply-html-hook (car html-and-images
(insert (org-mime-multipart
 (org-export-string
  -   (org-babel-trim (bhook body 'html))
  +   (org-babel-trim
  +(bhook body (if (eq fmt 'html) 'org 'ascii)))
  (if (eq fmt 'html) 'org 'ascii))
 html)
(mapconcat 'identity images \n
#+end_src


 I'll take a look at the link you gave for Org-mode block fontification
 in gnus, although that seems like a solution for the receiving side, and
 most of my peers do not run gnus and org, or emacs for that matter, but
 many do want to receive mail in plain text.


 I like the 'html option for situations like this, as a fontified html
 version of the email is sent for normal users, however an org format
 exports is supplied as a mime alternative, so users who have instructed
 their email clients to prefer plain text will be presented with the
 plain text org syntax.  In my wildest of dreams the org-mode begin_src
 syntax could be adopted as a plain-text standard for setting off source
 code, so that email clients other than gnus could begin providing for
 their own fontification of such blocks.


Now that would be something wild indeed. Of course the upside of org
syntax is that even if nothing is done with it automatically, the human
reader at least has a hint as to what language is used in the code
block, and in that regard it is better than ascii with nondescript
scissor lines. I just might have to revisit my earlier stance on this...


 On the subject of encouraging so-called code blocks brought to our
 attention by Samuel, encouraging this was not my intention, I should
 have thought better before posting and I will never in my life post such
 immoral examples anymore.


 Your consideration is much appreciated. :)


 Regards,

 Niels

 [...]

 Hi Eric,

 I love the org-mime-subtree function! It makes writing good-looking
 mails very easy.

 Now for a proposal:

 For ascii export used for mail, it would be cool if SRC and EXAMPLE
 blocks be surrounded by cut here scissor lines. They look well in gnus
 for example:


 For even better looking code in gnus, I personally prefer to use org as
 my export target (rather than ascii), and with Org-mode code block
 fontification configuration from
 http://eschulte.github.com/emacs-starter-kit/starter-kit-gnus.html
 code blocks inside org-mode markup will be correctly fontified in gnus
 messages.


 code or example here

 Maybe the best way to achieve this is to define a hook before the string
 is sent to `org-export-string' with the FMT arg set to 'ascii, so that
 people can define their own functions. For instance, there are also
 people who prefer a block like


 good idea, I've just added a series of hooks to org-mime which will be
 called in a temporary buffer holding the text to be exported, so you
 could add a function here to add scissor lines around code blocks.  Like
 Sam I would discourage the use of boxquotes for anything that users may
 want to cut and paste.  For ascii use the `org-mime-pre-ascii-hook'.

 If you come up with useful hooks it may be nice to share them on worg at
 http://orgmode.org/worg

Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-21 Thread Niels Giesen
Eric Schulte schulte.e...@gmail.com writes:

 Niels Giesen niels.gie...@gmail.com writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Thanks, I've just pushed up a new version of org-mime which makes use of
 this function.


Hi Eric, thanks for implementing this.

However, I see a problem in the solution for when html-ascii is
specified as the MAIL_FMT, being that the same hook will be run for both
parts of the message. I think it better not to have a html-ascii hook
and run the html hook for the html part and the ascii hook for the ascii
part. Otherwise the ascii hook may for instance delete a =BEGIN_SRC=
line and insert cut lines not needed by html.

Same goes for html (which is in fact html-org). Although I cannot really
think of any hooks I might want to run there.

I'll take a look at the link you gave for Org-mode block fontification
in gnus, although that seems like a solution for the receiving side, and
most of my peers do not run gnus and org, or emacs for that matter, but
many do want to receive mail in plain text.

On the subject of encouraging so-called code blocks brought to our
attention by Samuel, encouraging this was not my intention, I should
have thought better before posting and I will never in my life post such
immoral examples anymore.

Regards,

Niels

 [...]

 Hi Eric,

 I love the org-mime-subtree function! It makes writing good-looking
 mails very easy.

 Now for a proposal:

 For ascii export used for mail, it would be cool if SRC and EXAMPLE
 blocks be surrounded by cut here scissor lines. They look well in gnus
 for example:


 For even better looking code in gnus, I personally prefer to use org as
 my export target (rather than ascii), and with Org-mode code block
 fontification configuration from
 http://eschulte.github.com/emacs-starter-kit/starter-kit-gnus.html
 code blocks inside org-mode markup will be correctly fontified in gnus
 messages.


 code or example here

 Maybe the best way to achieve this is to define a hook before the string
 is sent to `org-export-string' with the FMT arg set to 'ascii, so that
 people can define their own functions. For instance, there are also
 people who prefer a block like


 good idea, I've just added a series of hooks to org-mime which will be
 called in a temporary buffer holding the text to be exported, so you
 could add a function here to add scissor lines around code blocks.  Like
 Sam I would discourage the use of boxquotes for anything that users may
 want to cut and paste.  For ascii use the `org-mime-pre-ascii-hook'.

 If you come up with useful hooks it may be nice to share them on worg at
 http://orgmode.org/worg/org-contrib/org-mime.php


 ,[ emacs-lisp ]
 | source here
 `

 What do you think?

 Regards,

 Niels.

 Thanks for the suggestion -- Eric



-- 
http://pft.github.com/

___
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] $0 replaced with ampersand () when invoking `org-edit-special'

2010-12-19 Thread niels giesen

According to [ (info (org) Formula syntax for Calc) ], $0
references the current cell. Pressing C-c C-c on the #+TBLFM line
below does indeed work, but C-c ' (`org-edit-special') changes the
$0 reference into a single ampersand (). Is this a bug?

| Thing  | Amount |
|+|
| Apples |  2 |
| Pears  |1.3 |
#+TBLFM: $2=$0;%.2f

Regards,

Niels.

Using: Org-mode version 7.4 (latest from git)


pgpQlauKa3Qmm.pgp
Description: PGP signature
___
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: extremely weird bad sexp errors with org-google-weather [was: extremely weird bad sexp errors]

2010-11-03 Thread Niels Giesen
Friedrich Delgado wrote:
 Oh... and I just tried to set the language back to DE and the
 problem disappeared.

 It can only guess that there might have been some problem going on
 behind the curtain (e.g. on the google servers?), which has now been
 resolved.

 I'd appreciate if Org/org-google-weather could handle such conditions
 more gracefully, and/or some instructions how to provide debug
 information for those cases.

 Friedrich Delgado Friedrichs schrieb:
   
 It just occured to me, that I could have include org-google-weather in
 the subject.

 *bump*

 Friedrich Delgado Friedrichs schrieb:
 
 For some strange reason, as of today, the combination

 %%(org-google-weather Hamburg DE)

 seems to be deeply offending, as I get a bad sexp error for it.
   
 [...]

 
 ---Zitatende---

   
Hi Friedrich,

I ran into the same problem when I had no network. My work-around was to
put something like this in my org-file:

%%(condition-case nil (org-google-weather Tokyo jp) (error
connection failed))

Of course, having this error intercepted in org-google-weather or in the
general handling by org-mode would be preferable.



___
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] scope of properties in a narrowed buffer, links in certain environments etc.

2007-10-16 Thread Niels Giesen

Hi Carsten and list,

due to all the traffic on the list (Good Thing) and too much traffic on 
the railroad to work this morning (Bad Thing), I went reading up on the 
org-mode mailing list and installed the latest version today (was coming 
from 4.56), and trying to use column view and properties. Which are 
great. In my enthousiasm however, I discovered some bugs, especially 
after an `org-narrow-to-subtree'-call.


Column view on a narrowed subtree does take into account the file-wide 
#+COLUMNS directive,  but *not* the :COLUMNS: property of a parent tree 
outside of the narrowing.
Actually, this issue seems to be larger: `org-set-property' does scan 
the whole file for properties, but prop_ALL from a parent tree outside 
of the narrowing does not have any effect on the values shown.


In column view links are not propertised as links, so the full text 
shows. Also, C-c C-o does not work here to follow a link in a line (or 
rather: column).


Whilst on the subject of links, in the agenda buffer, for some reason 
C-c C-o has trouble when a link is not on the end of a line. The 
following in org-agenda-open-link patch fixes this:

(however, it will still just follow the /first/ link on the line)

diff -w c:/tmp/org-5.12c/org.el c:/tmp/org-5.12c/org2.el
20251a20252
   (beginning-of-line)
20255c20256,20258
   (call-interactively 'org-open-at-point)
---
   (progn
 (beginning-of-line)
 (call-interactively 'org-open-at-point))

Diff finished.  Tue Oct 16 14:08:55 2007

Using Org-mode version 5.12c on GNU Emacs 23.0.0.1 
(i386-mingw-nt5.1.2600) of 2007-01-01 on DTOP


Greetings to you all!

Niels Giesen



___
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] Timestamp increment inside tables

2007-05-03 Thread Niels Giesen
Hi Carsten,

Please consider this patch to `org-table-copy-down', serving to increment 
timestamps in
an org-table while copying down, similar to integer icrements:

--- org.el  2007-04-25 08:26:21.0 -0100
+++ org2.el 2007-05-03 19:24:00.776923788 -0100
@@ -6495,7 +6495,11 @@
 column to be filled row-by-row.
 If the variable `org-table-copy-increment' is non-nil and the field is an
-integer, it will be incremented while copying.
+integer or a timestamp, it will be incremented while copying.  In the case of
+a timestamp, if the cursor is on the year, change the year.  If it is on the
+month or the day, change that.  Point will stay on the current date field
+in order to easily repeat the interval.
   (interactive p)
   (let* ((colpos (org-table-current-column))
+(column (- (point) (point-at-bol)))
 (field (org-table-get-field))
 (non-empty (string-match [^ \t] field))
@@ -6526,5 +6530,8 @@
  (insert txt)
  (org-table-maybe-recalculate-line)
- (org-table-align))
+ (org-table-align)
+ (when (and org-table-copy-increment (org-at-timestamp-p t))
+   (goto-char (+ (point-at-bol) column))
+   (org-timestamp-up 1)))
   (error No non-empty field found
 
Table alignment does not seem to pose any problems, but this is one thing that 
might
require some critical looking into.

Regards,

Niels Giesen

PS: its use? Making expenses claims for train tickets without having to fire up 
OOo.
-- 
It's always darkest just before the lights go out.
-- Alex Clark


___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode