[O] special blocks require whitespace

2016-04-13 Thread prayner
This is probably documented somewhere but I was surprised that I
needed to add some white space in order to get special blocks
recognized as such.
Here is a simple example:

#+Options: num:nil toc:nil
#+TITLE: 
#+AUTHOR: 

#+BEGIN_CENTER
this is not handled correctly
#+END_CENTER
#+BEGIN_CENTER 
but this is
#+END_CENTER
--
Here is the generated LaTeX
% Created 2016-04-13 Wed 22:25
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\date{\today}
\title{}
\hypersetup{
 pdfauthor={},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 24.5.1 (Org mode 8.3.3)}, 
 pdflang={English}}
\begin{document}

\#+BEGIN\(_{\text{CENTER}}\)
this is not handled correctly
\#+END\(_{\text{CENTER}}\)
\begin{center}
but this is
\end{center}
\end{document}
--
It's hard to see but the difference between the two examples is that
the 2nd has a single space after the #+BEGIN_CENTER

The behaviour arises from
((looking-at "\\+BEGIN_\\(\\S-+\\)")

This is with org version 8.3.3

Should this be considered a bug?
Please respond directly as well as to the list since I'm way behind with this 
list
regards
Peter



-- 
Peter Rayner
Leader, Clean Air and Urban Landscapes NESP hub 
room 343 
School of Earth Sciences, University of Melbourne, 3010, Vic, Australia
tel: work: +61 (0)3 8344 9708; fax: +61 (0)3 8344 7761 
mobile +61 402 752 379, skype: petermorag 
mail-to: pray...@unimelb.edu.au TWITTER: @raynerstrings
google scholar profile 




Re: [O] exporting just timestamped entries from an agenda

2015-12-30 Thread prayner
Hi John, almost solves the problem, the catch is entries like:
**  Norton my office <2015-03-11 Wed 10:00 +1w>
The date range searches in either the sparse tree or the tag-property
match searches don't seem to calculate out repeating dates ... fair
enough that's probably quite an overhead. I'll look at adding a filter
for active timestamps to  agenda filtering.
regards
Peter

John Hendy writes:
>On Wed, Dec 30, 2015 at 12:44 AM,   wrote:
>> I keep my diary, action items, scheduled tasks etc in a single
>> org-mode file. It contains things like:
>>
>> **  Norton my office <2015-03-11 Wed 10:00 +1w>
>> ** TODO power  bill:home:
>>DEADLINE: <2015-12-29 Tue>
>> ** TODO review business manager PD
>>SCHEDULED: <2015-12-27 Sun>
>>
>> and lots of others.
>> I would like to share a version of my agenda for each week with colleagues, 
>> perhaps
>> even interface it with the exchange web services used by my
>> organization. The first task is to select only those entries with
>> active timestamps that fall within the week.
>> My first attempt is a tag-search query like:
>> TIMESTAMP>"<-1d>"<"<+7d>"
>> but that doesn't pick up the repeated entries.
>>
>> The other approach I can see is agenda filtering. I can filter by tag
>> and hence remove the entry with :home: but I can't see how to remove
>> the item with a SCHEDULED date but no specific time to happen. Is
>> there a simple workaround or should I use a richer set of tags to
>> accomplish this?
>> thanks again
>> Peter
>
>Your request reminded me of something I was trying to do at one point.
>I thought it was something simlar for a custom agenda view, but after
>a fair bit of searching, it was for a sparse tree filter for inactive
>time stamps (active already existed). So, maybe there's a 3rd way you
>could get the format/data you want from an org file?
>
>Perhaps you could try the following on your file?
>- C-c / (opens sparse tree search)
>- press =c= to toggle to "only active timestamps"
>- press =D= to trigger the date range search
>- select your start/end range
>
>If that works, maybe someone could help you automate it as some sort
>of query function.
>
>For a test, I created the following:
>
>#+begin_example
>* tasks
>** todo 1
>   SCHEDULED: <2015-12-23 Wed>
>** todo 2
>   DEADLINE: <2015-12-23 Wed>
>** todo 3
>[2015-12-23 Wed]
>** todo 4
>   SCHEDULED: <2015-12-30 Wed>
>** todo 5
>   DEADLINE: <2015-12-30 Wed>
>** todo 6
>[2015-12-30 Wed]
>** todo 7
>   SCHEDULED: <2016-01-06 Wed>
>** todo 8
>   DEADLINE: <2016-01-06 Wed>
>** todo 9
>[2016-01-06 Wed]
>** todo 10
>   SCHEDULED: <2016-01-13 Wed>
>** todo 11
>   DEADLINE: <2016-01-13 Wed>
>** todo 12
>[2016-01-13 Wed]
>#+end_example
>
>
>Using the method above and selecting 12/30 -> 1/6 yields:
>
>#+begin_example
>* tasks
>** todo 4
>   SCHEDULED: <2015-12-30 Wed>
>** todo 5
>   DEADLINE: <2015-12-30 Wed>
>...
>#+end_example
>
>
>If I extend to 1/7, I get:
>
>#+begin_example
>* tasks
>** todo 4
>   SCHEDULED: <2015-12-30 Wed>
>** todo 5
>   DEADLINE: <2015-12-30 Wed>
>...
>** todo 7
>   SCHEDULED: <2016-01-06 Wed>
>** todo 8
>   DEADLINE: <2016-01-06 Wed>
>...
>#+end_example
>
>
>Would that work? I used =C-c C-x v= (copy visible text) to produce the
>above. It doesn't actually copy the ellipses; I just added them to
>reproduce what I see.
>
>
>Hope that helps!
>John
>
>
>>
>> --
>> Peter Rayner
>> Leader, Clean Air and Urban Landscapes NESP hub 
>> room 343
>> School of Earth Sciences, University of Melbourne, 3010, Vic, Australia
>> tel: work: +61 (0)3 8344 9708; fax: +61 (0)3 8344 7761
>> mobile +61 402 752 379, skype: petermorag
>> mail-to: pray...@unimelb.edu.au TWITTER: @raynerstrings
>> google scholar profile 
>> 
>>

-- 
Peter Rayner
Leader, Clean Air and Urban Landscapes NESP hub 
room 343 
School of Earth Sciences, University of Melbourne, 3010, Vic, Australia
tel: work: +61 (0)3 8344 9708; fax: +61 (0)3 8344 7761 
mobile +61 402 752 379, skype: petermorag 
mail-to: pray...@unimelb.edu.au TWITTER: @raynerstrings
google scholar profile 




[O] exporting just timestamped entries from an agenda

2015-12-29 Thread prayner
I keep my diary, action items, scheduled tasks etc in a single
org-mode file. It contains things like:

**  Norton my office <2015-03-11 Wed 10:00 +1w>
** TODO power  bill:home:
   DEADLINE: <2015-12-29 Tue>
** TODO review business manager PD
   SCHEDULED: <2015-12-27 Sun>

and lots of others.
I would like to share a version of my agenda for each week with colleagues, 
perhaps
even interface it with the exchange web services used by my
organization. The first task is to select only those entries with
active timestamps that fall within the week. 
My first attempt is a tag-search query like:
TIMESTAMP>"<-1d>"<"<+7d>"
but that doesn't pick up the repeated entries. 

The other approach I can see is agenda filtering. I can filter by tag
and hence remove the entry with :home: but I can't see how to remove
the item with a SCHEDULED date but no specific time to happen. Is
there a simple workaround or should I use a richer set of tags to
accomplish this?
thanks again
Peter

-- 
Peter Rayner
Leader, Clean Air and Urban Landscapes NESP hub 
room 343 
School of Earth Sciences, University of Melbourne, 3010, Vic, Australia
tel: work: +61 (0)3 8344 9708; fax: +61 (0)3 8344 7761 
mobile +61 402 752 379, skype: petermorag 
mail-to: pray...@unimelb.edu.au TWITTER: @raynerstrings
google scholar profile 




[O] capture template for .ics invitation in vm

2015-12-18 Thread prayner
In reality probably an embarrassing emacs-lisp error on my part.

I'm trying to make a capture template for turning the very frequent
invitations I get in .ics format (I think) into org agenda items.
The basis is the ical2org awk script maintained by Eric Fraga.
My template is defined as follows:
("i" "invite" entry (file+headline "~/.org/todo.org" "Tasks")
 "* TODO %(org-capture-vm-invite)\n" :immediate-finish t)

And org-capture-vm-invite is defined as

(defun org-capture-vm-invite ()
  (interactive)
  (with-temp-buffer
(insert-buffer (org-capture-get :original-buffer 1))
(shell-command-on-region (point-min) (point-max) "ical2org" nil t)
(buffer-substring-no-properties (point-min) (point-max

A problem seems to be the line
(insert-buffer (org-capture-get :original-buffer 1))
since :original-buffer doesn't seem to be defined in
org-capture-plist. I've verified that by printing it.
It's likely I'm going about this completely the wrong way so does
anyone have the right way to get information from the buffer where
capture was called during an embedded sexp?
Please reply directly as well as to the list since I'm a loong way
behind on reading.
Thanks in advance
Peter


-- 
Peter Rayner
Leader, Clean Air and Urban Landscapes NESP hub 
room 343 
School of Earth Sciences, University of Melbourne, 3010, Vic, Australia
tel: work: +61 (0)3 8344 9708; fax: +61 (0)3 8344 7761 
mobile +61 402 752 379, skype: petermorag 
mail-to: pray...@unimelb.edu.au TWITTER: @raynerstrings
google scholar profile 




[O] patch to add org-table-previous-row to org-table

2015-07-04 Thread prayner
I am working with the accessibility system emacspeak to improve
eyes-free access to org-mode tables. Most of this can be done outside
the org-mode tree by advising existing functions but I've run into a
need for a new function. I need org-table-previous-row analogous to
org-table-next-row. Below is a patch to add this. The behaviour is
almost identical to org-table-next-row except that
org-table-previous-row in the first row of the table is a no-op.
Please consider adding this to the repository. Comments and
corrections welcome but please send them to me directly as well as the
list.
regards
Peter

--
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 8a6e22b..f17d84d 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -1092,6 +1092,30 @@ Before doing so, re-align the table if necessary.
   (if (looking-at  ) (forward-char 1)
 
 ;;;###autoload
+(defun org-table-previous-row ()
+  Go to the previous row (same column) in the current table.
+Before doing so, re-align the table if necessary.
+  (interactive)
+  (org-table-maybe-eval-formula)
+  (org-table-maybe-recalculate-line)
+  (if (or (looking-at [ \t]*$)
+ (save-excursion (skip-chars-backward  \t) (bolp)))
+  (newline)
+(if (and org-table-automatic-realign
+org-table-may-need-update)
+   (org-table-align))
+(let ((col (org-table-current-column)))
+  (beginning-of-line 0)
+  (if (or (not (org-at-table-p))
+ (org-at-table-hline-p))
+ (progn
+   (beginning-of-line 1)))
+  (org-table-goto-column col)
+  (skip-chars-backward ^|\n\r)
+  (if (looking-at  ) (forward-char 1)
+
+
+;;;###autoload
 (defun org-table-copy-down (n)
   Copy the value of the current field one row below.
-- 
 


-- 
Peter Rayner
Leader, Clean Air and Urban Landscapes NESP hub.
room 343 
School of Earth Sciences, University of Melbourne, 3010, Vic, Australia
tel: work: +61 (0)3 8344 9708; fax: +61 (0)3 8344 7761 
mobile +61 402 752 379, skype: petermorag 
mail-to: pray...@unimelb.edu.au
google scholar profile 
http://scholar.google.com.au/citations?user=H3up71wJhl=en



[O] org-mode and eww

2014-09-05 Thread prayner
I'm moving from using emacs-w3 to eww as my text-mode browser within
emacs. org-mode doesn't seem to integrate eww very well yet (e.g.
org-store-link). Most of the required changes seem within my elisp
capability so I'll try to add them ... provided noone else has done
it.  Please let me know if someone is working on this or if I've
missed a package to include.
Please reply directly as well as to the list (I'm way behind).
thanks in advance
Peter


-- 
Peter Rayner
room 343 
School of Earth Sciences, University of Melbourne, 3010, Vic, Australia
tel: work: +61 (0)3 8344 9708; fax: +61 (0)3 8344 7761 
mobile +61 402 752 379, skype: petermorag 
mail-to: pray...@unimelb.edu.au
google scholar profile 
http://scholar.google.com.au/citations?user=H3up71wJhl=en