Re: [O] Macros or properties in source blocks

2015-08-12 Thread Sebastien Vauban
"Charles C. Berry"  writes:
> On Tue, 11 Aug 2015, Gary Oberbrunner wrote:
>
>> I'd like to have either a macro or a property that controls some behavior
>> of an org-mode babel file:
>>
>> #+PROPERTY: report_type All
>>
>> and use that property inline: {{{property(report_type)}}} and in a source
>> block:
>>
>> #+NAME: rtype
>> #+BEGIN_SRC emacs-lisp :results value
>> {{{property(report_type)}}}
>> #+END_SRC
>>
>> And use that source block:
>>
>> The report type is call_rtype()[:results raw]
>>
>> But this doesn't work,
>
> BUT THIS DOES:
>
> #+NAME: rtype
> #+header: :var prop=(org-entry-get (point) "report_type" t)
> #+BEGIN_SRC emacs-lisp
> prop
> #+END_SRC
>
> And use that source block:
>
> The report type is call_rtype()[:results raw]

Though, I don't understand either why your example did not work, as --
during the export process -- macros are supposed to be expanded before
Babel code be evaluated.

There must be some restriction, then, on which part of a document
a macro can reside in.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] org-block-background in 8.3.1?

2015-08-12 Thread Sebastien Vauban
Kyle Meyer  writes:
> Luke Crook  wrote:
>> I'm not sure if I still need to set "org-block-background" in 8.3.1.
>>
>> But if I do need to continue setting this, what is the new name for "org-
>> block-background"?
>>
>> (set-face-attribute 'org-block-background nil
>> :height (round (* 0.9 (face-attribute 'fixed-pitch
>> :height
>> (set-face-attribute 'org-block nil
>> :height (round (* 0.9 (face-attribute 'fixed-pitch
>> :height
>
> org-block-background was removed in f8b42e8 ("Don't use an overlay for
> src blocks backgrounds", 2014-07-28) for performance reasons.

IIRC, we never saw a profiler report showing that it slowed down buffer
fontification in a visible way.  Correct me if I'm wrong.

Really, it has been removed because of a problem when ps-print'ing an
Org buffer -- though the bug was to find in `ps-def.el' and not in Org,
as reported by Stefan Monnier [1].  It should have been fixed there
instead.

> I'm not aware of anything that has been introduced in its place.

I'm planning to reintroduce it as an optional feature.  At least in my
personal Git repository, if that's not accepted in Org core.

Best regards,
  Seb

[1] http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00403.html

-- 
Sebastien Vauban




Re: [O] A bug with expanding headlines of the sparse tree?

2015-08-12 Thread Meir Goldenberg
Is there an alternative to TAB when I want to work only with the sparse
tree and all the other entries only distract me? If not, can I somehow open
the sparse tree in a separate buffer?

On Wed, Aug 12, 2015 at 1:56 AM, Nicolas Goaziou 
wrote:

> Meir Goldenberg  writes:
>
> > I do not quite understand. You wrote: "TAB discloses the entry and all
> > children. It also leaves the entry in an editable state." However, Task2
> is
> > not a child of the entry being disclosed (Task1).
>
> I explained why hiding Task2 leaves entry in an uncomfortable state,
> where you could edit near ellipsis.
>
> > Furthermore, by constructing the sparse tree, I am telling org-mode
> > that I am only interested to see the sub-trees under the tasks marked
> > as TODO!
>
> TAB ignores you want to keep a sparse tree. Note that it is also used to
> get out of parse trees, i.e., get a normal view again.
>
>
> Regards,
>


Re: [O] [OFF TOPIC] almost giving up on emacs email..looking for advice?

2015-08-12 Thread Rasmus
Eric Abrahamsen  writes:

> Peter Salazar  writes:
>
>> Like Fabrice, I also still process my email using the Gmail web
>> interface. The only reason I want email within Emacs is so I can
>> compose replies in a proper editor with all my keybindings. I tried
>> Chrome's Edit with Emacs, but it loses line breaks when it sends the
>> output from Emacs back to Gmail. So I prefer to write replies within
>> Emacs.
>>
>> Since I only need a small fraction of my emails to go through Emacs, I
>> set up mbsync to pull only my starred messages:
>>
>> Channel gmail-starred
>> Master :gmail-remote:"[Gmail]/Starred" 
>> Slave :gmail-local:starred
>> Create Both
>> Expunge Both
>> SyncState *
>>
>> If this is of interest to you I can share my setup. 
>
> I agree that having email accessible locally is key to making Gnus
> usable. All my email is synced to local dovecot server, and Gnus
> accesses that -- no lag at all. Sending messages is still a big pain,
> though. I send using msmtp, and there's an add-on called msmtp-queue
> that would apparently allow Gnus to hand off messages instantly, but
> I've never spent the time to get it set up. I sure wish IMAP could
> handle both sending and receiving messages!

Sending messages in Gnus is trival these days.  It works out of the box
when you add a X-Message-SMTP-Method header (and GCC for saving a copy to
Sent).  I use smtp server from GMX, my own mail server and Outlook (I've
used google mail in the past).

Rasmus

-- 
It was you, Jezebel, it was you




Re: [O] Block level specification for tex code html export method

2015-08-12 Thread Andreas Leha
Hi Haochen,

You can render svg from latex through org directly.  Here is a complete
example including a tikz diagram that that works on my system (once I
tackle a bug in PGF [1]).
It renders
- png by default (and for inlining the image into the org document)
- nothing for latex (directly include the tikz code into the tex document)
- svg for html


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

First execute the second code block, to define the convenience macro
and to set the required new variables in ob-latex.el.  Then export to
HTML and to pdf to see the tree exported as an SVG image and as
embedded tikz respectively.

* Tikz test
Here's a tree, exported to both html and pdf.

#+header: :file (by-backend (html "tree.svg") (latex "tree.tikz") (t 
"tree.png"))
#+header: :imagemagick :iminoptions -density 600 :imoutoptions -geometry 800
#+header: :results file raw
#+header: :fit yes
#+begin_src latex
  \usetikzlibrary{trees}
  \begin{tikzpicture}
\node [circle, draw, fill=red!20] at (0,0) {1}
child { node [circle, draw, fill=blue!30] {2}
  child { node [circle, draw, fill=green!30] {3} }
  child { node [circle, draw, fill=yellow!30] {4} }};
  \end{tikzpicture}
#+end_src

#+results:
[[file:tree.png]]

* COMMENT setup
#+begin_src emacs-lisp :results silent
  (setq org-babel-latex-htlatex "htlatex")
  (defmacro by-backend (&rest body)
`(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body))
#+end_src
--8<---cut here---end--->8---


Regards,
Andreas

[1] http://tex.stackexchange.com/a/232739


Haochen Xie  writes:
> Hi Fabrice,
>
> Thank you for mentioning dvisvgm. I did some researches on it, and it seems 
> that as for now, the only way to invoke dvisvgm is to first export the latex 
> part to dvi, and call dvisvgm
> manually to convert it to svg, then include it in the org file, which, is too 
> troublesome for me. Is there any plan to add dvisvgm as an alternative to 
> dvipng and imagemagick? IMO svg
> images will look much better than png (well, in browsers supporting it), so 
> that's a nice option to have.
>
> Regards,
>
> Haochen
>
> --
>
> Mail from Haochen Xie
>
> On Tue, Aug 11, 2015 at 5:53 PM, Fabrice Popineau 
>  wrote:
>
>
>  2015-08-11 10:47 GMT+02:00 Haochen Xie :
>
>
>  Hi Andreas,
>
>  Thank you for your reply. I've read the whole thread, and found your
>  example (the second link) very useful. Although for some reason, SVG
>  image is not working well on my machine (not being displayed in
>  chrome, nor on IE. I don't have firefox installed), but since the SVG
>  image generated by imagemagick is indeed a raster image, I don't see
>  any benefit using SVG over PNG, and exporting to PNG works perfectly.
>
>  Use dvisvgm instead of imagemagick to generate the svg file.
>
>  Fabrice




Re: [O] [OFF TOPIC] almost giving up on emacs email..looking for advice?

2015-08-12 Thread Eric Abrahamsen
Rasmus  writes:

> Eric Abrahamsen  writes:
>
>> Peter Salazar  writes:
>>
>>> Like Fabrice, I also still process my email using the Gmail web
>>> interface. The only reason I want email within Emacs is so I can
>>> compose replies in a proper editor with all my keybindings. I tried
>>> Chrome's Edit with Emacs, but it loses line breaks when it sends the
>>> output from Emacs back to Gmail. So I prefer to write replies within
>>> Emacs.
>>>
>>> Since I only need a small fraction of my emails to go through Emacs, I
>>> set up mbsync to pull only my starred messages:
>>>
>>> Channel gmail-starred
>>> Master :gmail-remote:"[Gmail]/Starred" 
>>> Slave :gmail-local:starred
>>> Create Both
>>> Expunge Both
>>> SyncState *
>>>
>>> If this is of interest to you I can share my setup. 
>>
>> I agree that having email accessible locally is key to making Gnus
>> usable. All my email is synced to local dovecot server, and Gnus
>> accesses that -- no lag at all. Sending messages is still a big pain,
>> though. I send using msmtp, and there's an add-on called msmtp-queue
>> that would apparently allow Gnus to hand off messages instantly, but
>> I've never spent the time to get it set up. I sure wish IMAP could
>> handle both sending and receiving messages!
>
> Sending messages in Gnus is trival these days.  It works out of the box
> when you add a X-Message-SMTP-Method header (and GCC for saving a copy to
> Sent).  I use smtp server from GMX, my own mail server and Outlook (I've
> used google mail in the past).

It's not trivial when you live in China :)

I can make it work, between alternate IP addresses and ssh tunnels, but
it involves a lot of cursing and grinding my teeth. In a hostile network
environment any client will face the same problems, but the lack of
threading becomes pretty apparent here.

Someday I will set up my own mail server, when I'm in bed with a broken
leg, maybe. I have so many "broken-leg" projects waiting, I hate to
think of what sort of accident I'd have to be in to get them all
completed.




Re: [O] [OFF TOPIC] almost giving up on emacs email..looking for advice?

2015-08-12 Thread Rasmus
Eric Abrahamsen  writes:

> It's not trivial when you live in China :)
>
> I can make it work, between alternate IP addresses and ssh tunnels, but
> it involves a lot of cursing and grinding my teeth. In a hostile network
> environment any client will face the same problems, but the lack of
> threading becomes pretty apparent here.

I don't know what the great firewall is like, but for "hostile networks"
around here (universities blocking git, airports blocking smtp/imap etc),
I use openvpn.  Are commercial openvpn provides blocked in China?

Rasmus

-- 
Dung makes an excellent fertilizer




[O] Emacspeak and org mode (fwd)

2015-08-12 Thread Jude DaShiell



--


-- Forwarded message --
Date: Wed, 12 Aug 2015 02:17:21
From: Tim Cross 
To: emacspeak 
Subject: Emacspeak and org mode
Resent-Date: Wed, 12 Aug 2015 02:29:40 -0400 (EDT)
Resent-From: emacsp...@cs.vassar.edu


--Apple-Mail=_18ED71E4-E2D1-47DE-8ACB-70E18271E9FB
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8

Dear All,

is anyone else experiencing signficant loss of functionality with =
emacspeak and org mode recently?

I=E2=80=99ve noticed that in the last week, a number of significant =
problems with org mode and emacspeak. Unfortunately, I upgraded both my =
emacspeak and org mode at about the same time, so I=E2=80=99m not sure =
whether the issue is with emacspeak or org mode.

I run the org-plus-contrib package from the org mode elpa repository. =
I=E2=80=99m running emacspeak from github.

Things I have noticed

1. When adding a note from an agenda view ie. after hittinng =E2=80=98z=E2=
=80=99, while entering the note, emacspeak just keeps repeating =
=E2=80=9Cbefore headline at position =E2=80=9D, which makes using =
the note feature near impossible
2. running org-babel-load-file to generate new code files from babel =
code is extremely slow
3. Clocking in/out in the agenda doesn=E2=80=99t seem to work correctly =
and I think is throwing an error (but it isn=E2=80=99t spoken, so I need =
to dig deeper).
4. When working in an *.org file, moving down lines withe either C-n or =
arrow down, every now and again, emacspeak speaks the top/first heading =
line instead of the line of text the cursor is at. You have to move up =
and down a few times before it will speak the line rather than the =
headline

plus a number of other issues.

I=E2=80=99m not looking for an angel to come and fix this. I=E2=80=99m =
just after any input to know if

1. anyone else seeing similar recently?
2. any clues as to whether this is due to changes in emacspeak or =
org-mode

and of course, if you have fixes/work-arounds, I=E2=80=99ll take them =
too!

regards,

Tim





Tim Cross

IT Security Manager
Information Technology Directorate

University of New England
Armidale N.S.W. 2351 Australia

Email: tcr...@une.edu.au
Phone: +61 2 6773 3210
Mobile: +61 428 212 217


--Apple-Mail=_18ED71E4-E2D1-47DE-8ACB-70E18271E9FB
Content-Type: multipart/related;
type="text/html";
boundary="Apple-Mail=_4F74C7D6-46E3-49C4-853B-8FD83E17012D"


--Apple-Mail=_4F74C7D6-46E3-49C4-853B-8FD83E17012D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=utf-8

Dear All,is anyone else experiencing signficant loss of functionality =
with emacspeak and org mode recently?I=E2=80=99ve noticed that in the last =
week, a number of significant problems with org mode and emacspeak. =
Unfortunately, I upgraded both my emacspeak and org mode at about the =
same time, so I=E2=80=99m not sure whether the issue is with emacspeak =
or org mode. I run the org-plus-contrib package from the org mode elpa =
repository. I=E2=80=99m running emacspeak from github.Things I have =
noticed1. =
When adding a note from an agenda view ie. after hittinng =E2=80=98z=E2=80=
=99, while entering the note, emacspeak just keeps repeating =E2=80=9Cbefo=
re headline at position =E2=80=9D, which makes using the note =
feature near impossible2. running =
org-babel-load-file to generate new code files from babel code is =
extremely slow3. Clocking in/out in the agenda =
doesn=E2=80=99t seem to work correctly and I think is throwing an error =
(but it isn=E2=80=99t spoken, so I need to dig deeper).4. When working in an *.org file, moving down lines withe =
either C-n or arrow down, every now and again, emacspeak speaks the =
top/first heading line instead of the line of text the cursor is at. You =
have to move up and down a few times before it will speak the line =
rather than the headline
plus a number of =
other issues. I=E2=80=99m not =
looking for an angel to come and fix this. I=E2=80=99m just after any =
input to know if1. anyone else seeing =
similar recently?2. any clues as =
to whether this is due to changes in emacspeak or =
org-modeand of course, if you =
have fixes/work-arounds, I=E2=80=99ll take them too!regards,TimTim CrossIT Security ManagerInformation Technology DirectorateUniversity of New EnglandArmidale N.S.W. 2351 AustraliaEmail: mailto:tcr...@une.edu.au"; class=3D"">tcr...@une.edu.auPhone: +61 2 6773 3210Mobile: +61 428 =
212 217

=

--Apple-Mail=_4F74C7D6-46E3-49C4-853B-8FD83E17012D
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename=une.png
Content-Type: image/png;
name="une.png"
Content-Id: 

iVBORw0KGgoNSUhEUgAAAFUAAABVCAY49ahaAAAD8GlDQ1BJQ0MgUHJvZmlsZQAAOI2N
Vd1v21QUP4lvXKQWP6Cxjg4Vi69VU1u5GxqtxgZJk6XpQhq5zdgqpMl1bhpT1za2021Vn/YCbwz4
A4CyBx6QeEIaDMT2su0BtElTQRXVJKQ9dNpAaJP2gqpwrq9Tu13GuJGvfznndz7v0TVAx1ea45hJ
GWDe8l01n5GPn5iWO1YhCc9BJ/RAp6Z7TrpcLgIuxoVH1sNfIcHeNwfa6/9zdVappwMknkJsVz19
HvFpgJSpO64PIN5G

[O] [gnorb] completion for `gnorb-gnus-incoming-do-todo'

2015-08-12 Thread Thomas Holst
Hello,

thanks for the gnorb package! I started using it and I like it a lot!

When I call `gnorb-gnus-incoming-do-todo' from gnus I'm prompted for a
headline. But completion is not working. Neither  nor M-j does
anything.

How can I get completion working? Completion is working for org-refile.

I have no settings customized. Only key bindings as suggested.

Thank you for looking into this!

--
Regards
  Thomas



Re: [O] Block level specification for tex code html export method

2015-08-12 Thread Haochen Xie
Hi Andreas,

Thank you for your code example. I've tried almost the same code which
I saw from the thread you referred (with the htlatex initialization,
which I'm doing in my .emacs), and indeed got a svg file as
expected. But the problem is that when I try to browse the HTML page
in chrome, the image is shown as broken. I check the HTML source code,
the image is presented in an img tag, pointing to the svg file. My
first though was that the svg file isn't recognized because it's not
served by a HTTP server instead of being a filesystem link. I then
tried to use python SimpleHTTPServer, then python3 -m http.server (the
python2 SimpleHTTPServer was serving svg with a wrong Content-Type)
but without luck.

Today, I tried svg again, and finally figured out the problem: the svg
file generated doesn't contain a proper xmlns in the svg tag, so both
chrome and internet explorer is interpreting it as a plain xml file
instead of rendering it.

I guess this is a bug with imagemagick, but when I tried to do some
research on this problem I found nothing. Maybe I could find something
with more researches, but I don't have time now, and PNG is fine for
me.

Still, Andreas, thank you very much for helping.

Regards,

Haochen



--

Mail from Haochen Xie

On Wed, Aug 12, 2015 at 5:50 PM, Andreas Leha <
andreas.l...@med.uni-goettingen.de> wrote:

> Hi Haochen,
>
> You can render svg from latex through org directly.  Here is a complete
> example including a tikz diagram that that works on my system (once I
> tackle a bug in PGF [1]).
> It renders
> - png by default (and for inlining the image into the org document)
> - nothing for latex (directly include the tikz code into the tex document)
> - svg for html
>
>
> --8<---cut here---start->8---
> #+LATEX_HEADER: \usepackage{tikz}
>
> First execute the second code block, to define the convenience macro
> and to set the required new variables in ob-latex.el.  Then export to
> HTML and to pdf to see the tree exported as an SVG image and as
> embedded tikz respectively.
>
> * Tikz test
> Here's a tree, exported to both html and pdf.
>
> #+header: :file (by-backend (html "tree.svg") (latex "tree.tikz") (t
> "tree.png"))
> #+header: :imagemagick :iminoptions -density 600 :imoutoptions -geometry
> 800
> #+header: :results file raw
> #+header: :fit yes
> #+begin_src latex
>   \usetikzlibrary{trees}
>   \begin{tikzpicture}
> \node [circle, draw, fill=red!20] at (0,0) {1}
> child { node [circle, draw, fill=blue!30] {2}
>   child { node [circle, draw, fill=green!30] {3} }
>   child { node [circle, draw, fill=yellow!30] {4} }};
>   \end{tikzpicture}
> #+end_src
>
> #+results:
> [[file:tree.png]]
>
> * COMMENT setup
> #+begin_src emacs-lisp :results silent
>   (setq org-babel-latex-htlatex "htlatex")
>   (defmacro by-backend (&rest body)
> `(case (if (boundp 'backend) (org-export-backend-name backend) nil)
> ,@body))
> #+end_src
> --8<---cut here---end--->8---
>
>
> Regards,
> Andreas
>
> [1] http://tex.stackexchange.com/a/232739
>
>
> Haochen Xie  writes:
> > Hi Fabrice,
> >
> > Thank you for mentioning dvisvgm. I did some researches on it, and it
> seems that as for now, the only way to invoke dvisvgm is to first export
> the latex part to dvi, and call dvisvgm
> > manually to convert it to svg, then include it in the org file, which,
> is too troublesome for me. Is there any plan to add dvisvgm as an
> alternative to dvipng and imagemagick? IMO svg
> > images will look much better than png (well, in browsers supporting it),
> so that's a nice option to have.
> >
> > Regards,
> >
> > Haochen
> >
> > --
> >
> > Mail from Haochen Xie
> >
> > On Tue, Aug 11, 2015 at 5:53 PM, Fabrice Popineau <
> fabrice.popin...@supelec.fr> wrote:
> >
> >
> >  2015-08-11 10:47 GMT+02:00 Haochen Xie :
> >
> >
> >  Hi Andreas,
> >
> >  Thank you for your reply. I've read the whole thread, and found your
> >  example (the second link) very useful. Although for some reason, SVG
> >  image is not working well on my machine (not being displayed in
> >  chrome, nor on IE. I don't have firefox installed), but since the SVG
> >  image generated by imagemagick is indeed a raster image, I don't see
> >  any benefit using SVG over PNG, and exporting to PNG works perfectly.
> >
> >  Use dvisvgm instead of imagemagick to generate the svg file.
> >
> >  Fabrice
>
>
>


Re: [O] BUG in columns view since 0f93638ce (Jun 2 2015)

2015-08-12 Thread Nicolas Goaziou
Johan Sandblom  writes:

> I read that passage differently. The second-level headline ** bli is
> in the tree that starts at the first-level headline * sum. The manual
> does not state that the column view table is established for the part
> of the tree that is between the entry that contains the ´:COLUMNS:´
> property and point. Since it does not mention partial trees at all
> I assumed the entire tree starting at the entry was intended.

You are right. This is fixed. Thank you.

Regards,



Re: [O] A bug with expanding headlines of the sparse tree?

2015-08-12 Thread Nicolas Goaziou
Meir Goldenberg  writes:

> Is there an alternative to TAB when I want to work only with the sparse
> tree and all the other entries only distract me?

With Org 8.3, you can use (untested)

  (save-excursion 
(forward-line)
(unless (org-at-heading-p) (org-show-set-visibility 'minimal)))

Regards,



Re: [O] Macros or properties in source blocks

2015-08-12 Thread Nicolas Goaziou


Hello,

Sebastien Vauban  writes:

> Though, I don't understand either why your example did not work, as --
> during the export process -- macros are supposed to be expanded before
> Babel code be evaluated.
>
> There must be some restriction, then, on which part of a document
> a macro can reside in.

According to the manual

  These references, called macros, can be inserted anywhere Org markup is
  recognized: paragraphs, headlines, verse blocks, tables cells and lists.

The innards of a source block do not belong to Org.

Regards,

-- 
Nicolas Goaziou




Re: [O] Help with export filter?

2015-08-12 Thread Samuel Loury
Hi all,
Rasmus  writes:

> Hi Tom,
>
> t...@tsdye.com (Thomas S. Dye) writes:
>
>> Aloha all,
>>
>> Inspired by discussions and code on the mailing list, I managed to
>> cobble together the headline filter below.  It "works" in that the
>> pdf output from LaTeX export is exactly what I want.  I'm thrilled!
>>
>> It has one unwanted side effect.  In the tex file, a headline tagged
>> with either :newpage: or :clearpage: includes some extra baggage, like
>> this:
>>
>>   \newpage
>>   \section*{Introduction\hfill{}\textsc{}}
>>   \label{sec-5}
>>
>> I tried setting the option tags:nil, but then my export tags had no
>> effect.  Can someone suggest how I can avoid the \hfill etc.?  Or, am I
>> picking nits here?
>>
>> * Filter headline tags
>>
>> #+name: filter-headline-tags
>> #+BEGIN_SRC emacs-lisp :results silent
>>
>>   (defun tsd-filter-headline-tags (contents backend info)
>> "Ignore headlines with tag `ignoreheading' and/or start LaTeX
>>   section with `newpage' or `clearpage' command."
>> (cond ((and (org-export-derived-backend-p backend 'latex)
>> (string-match "\\`.*newpage.*\n" (downcase contents))
>> (string-match "\\`.*ignoreheading.*\n" (downcase contents)))
>>(replace-match "newpage\n" nil nil contents))
>>   ((and (org-export-derived-backend-p backend 'latex)
>> (string-match "\\`.*clearpage.*\n" (downcase contents))
>> (string-match "\\`.*ignoreheading.*\n" (downcase contents)))
>>(replace-match "clearpage\n" nil nil contents))
>>   ((and (org-export-derived-backend-p backend 'latex 'html 'ascii)
>> (string-match "\\`.*ignoreheading.*\n" (downcase contents)))
>>(replace-match "" nil nil contents))
>>   ((and (org-export-derived-backend-p backend 'latex)
>> (string-match "\\(\\`.*\\)newpage\\(.*\n\\)" (downcase 
>> contents)))
>>(replace-match "newpage\n\\1\\2"  nil nil contents))
>>   ((and (org-export-derived-backend-p backend 'latex)
>> (string-match "\\(\\`.*\\)clearpage\\(.*\n\\)" (downcase 
>> contents)))
>>(replace-match "clearpage\n\\1\\2"  nil nil contents
>> #+END_SRC

This I just the feature I need today. Thank you for sharing. Do you know
what is missing to add the feature to org-mode instead of adding in each
user's .emacs file?

My best,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] [OFF TOPIC] almost giving up on emacs email..looking for advice?

2015-08-12 Thread Eric Abrahamsen
Rasmus  writes:

> Eric Abrahamsen  writes:
>
>> It's not trivial when you live in China :)
>>
>> I can make it work, between alternate IP addresses and ssh tunnels, but
>> it involves a lot of cursing and grinding my teeth. In a hostile network
>> environment any client will face the same problems, but the lack of
>> threading becomes pretty apparent here.
>
> I don't know what the great firewall is like, but for "hostile networks"
> around here (universities blocking git, airports blocking smtp/imap etc),
> I use openvpn.  Are commercial openvpn provides blocked in China?

Both commercial providers, and non-commercial providers! I set up my own
OpenVPN server on a US server, and that worked for a couple of years.
Then they caught it, and I switched to a non-standard port. That worked
for another four months or so, and now it doesn't work on any port. I'm
sure OpenVPN traffic is pretty easily sniffable.

My next project is ipsec (another broken-leg project). But I figure, if
I can google up these solutions, so can they, and the packet signatures
of all these different systems must be quite identifiable.

Using vanilla ssh seems fairly reliable: for the time being, I don't
think they'd go so far as to block ssh across the board. That would
really be declaring war on the internet. So sshuttle, tunnels, and the
built-in ssh SOCKS proxy are serving me well. Using dnscrypt-proxy
actually solves many of the problems -- in years past, it would have
solved everything, but they've started hell-banning IP ranges, and of
course that includes gmail. My own dumb fault for using gmail, I guess.

How off-topic can we get? :)





Re: [O] Stable releases

2015-08-12 Thread Nicolas Goaziou
Hello,

Scott Randby  writes:

> When I started using 8.3, I discovered that the behavior of commented
> headlines had been changed---a change with which I disagree, a change
> I could not find in the release notes, and one which forces me to
> alter a huge number of files. It seems I missed the discussion about
> commented headlines on the mailing list. This is due to my limited
> knowledge of elisp and programming in general, a gap which makes it
> difficult for me to follow the more technical discussions on the
> mailing list. While it has been explained to me that the change is
> a feature, I consider it to be a serious bug since it is not backwards
> compatible.

I think this change is good. COMMENT status of headlines was muddy
before. The only information about them was the following excerpt (from
Org 8.2.9's manual)

  Also entire subtrees starting with the word ‘COMMENT’ will never be
  exported.

which can mean many things. You extrapolated this definition to one of
its possible meanings, but your definition, AFAIU, was :noexport:
tags's.

Now there is a clearer definition of a COMMENT headline, and a clear
distinction between COMMENT and :noexport:.

Note that you don't have to alter any of your files. The following
function can do it for you on the fly, before each export. You can also
used it to effectively alter your files automatically for you.

  (defun my-comment-to-noexport (backend)
(interactive)
(goto-char (point-min))
(while (re-search-forward "^\\*+.*\\( COMMENT\\)" nil t)
  (when (save-match-data (org-in-commented-heading-p t))
(replace-match "" nil nil nil 1)
(org-set-tags-to (cons "noexport" (org-get-tags))

  (add-hook 'org-export-before-processing-hook #'my-comment-to-noexport)

I admit it could have been notified in ORG-NEWS.

> Another issue I had with 8.3 is the deletion of the
> org-latex-with-hyperref variable, something I could not find in the
> release notes (maybe I missed it). I understand that having Org insert
> \hypersetup{...} details is the most desirable situation, but I fail
> to see the harm in keeping org-latex-with-hyperref for those of us who
> needed it in the past. Yes, I figured out a fix, but this is a fix
> that forces me to stick with an outmoded way of doing things, and so
> I consider this deletion to be a bug.

I'm not sure to understand. What is wrong with setting
`org-latex-hyperref-template' to the empty string?

This change was introduced in Feb 2014. It is a step forward since we
move from an opt-in/opt-out to a full customizable template.

I overlooked the fact that this replacement wasn't signaled in ORG-NEWS,
tho. I will try to be more careful for next release.

> I do understand that all software has bugs, and that everyone working
> on Org is doing so voluntarily (thank you so much for your wonderful
> work). But I was very surprised to find that the evaluation of table
> formulas didn't work in 8.3.1. I could see something like this
> happening in the development version, but it is somewhat mysterious to
> me how such a bug could make its way into a stable release.

I introduced these changes a short time (three days) before release.
I made an announcement[fn:1] in order to warn there could be some
hiccups in that area. It may be obnoxious for you, but no bug was
reported before release.

Another example is the recent columns view bug report[fn:2]. The faulty
commit was pushed 2 months ago. Yet no one during development phase
complained about column view being broken. Even a feature freeze period
wouldn't have helped in that case.

You can't really avoid small glitches after a release.

> I guess what I want to know, and maybe there is no answer, is how long
> should I wait before upgrading to a stable release? Org is by far the
> most important piece of software I use (I hate it when I can't use
> Org), and bugs (which I know can't be avoided) make it hard, even
> impossible, for me to get my real work done. If there is a way for me
> to minimize encountering bugs, I will appreciate a description of that
> way.

I suggest to only do regularly minor updates (e.g. 8.3.1 -> 8.3.2). For
major updates, make sure you have some time to spare for bug reporting.
I think we are usually pretty responsive when it comes to bugs.


Regards,

[fn:1] 

[fn:2]  

-- 
Nicolas Goaziou



Re: [O] Block level specification for tex code html export method

2015-08-12 Thread Andreas Leha
Hi Haochen,

Sorry for not being clearer.  There is no imagemagick involved in the
svg generation if everything is setup correctly.  Instead the command
defined in org-babel-latex-htlatex is used.  My test file sets this to
to "htlatex" from tex4th [1].

At the time of the thread I linked to there was a bug in ob-latex,
though.  So, make sure to be on a "recent" version of org (containing at
least the commit 510e7037988d44151dea5b98631839fc8003dd57 from
2015-03-21)

Just for reference, here are the first lines of the svg that is produced
for me which look fine to me:
--8<---cut here---start->8---
 
 
http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; width="60.55959pt" 
height="103.23871pt" viewBox="-30.27975 -94.29848 60.55959 103.23871 "> 
--8<---cut here---end--->8---


Regards,
Andreas


[1] https://www.tug.org/applications/tex4ht/mn-commands.html




Haochen Xie  writes:
> Hi Andreas,
>
> Thank you for your code example. I've tried almost the same code which
> I saw from the thread you referred (with the htlatex initialization,
> which I'm doing in my .emacs), and indeed got a svg file as
> expected. But the problem is that when I try to browse the HTML page
> in chrome, the image is shown as broken. I check the HTML source code,
> the image is presented in an img tag, pointing to the svg file. My
> first though was that the svg file isn't recognized because it's not
> served by a HTTP server instead of being a filesystem link. I then
> tried to use python SimpleHTTPServer, then python3 -m http.server (the
> python2 SimpleHTTPServer was serving svg with a wrong Content-Type)
> but without luck.
>
> Today, I tried svg again, and finally figured out the problem: the svg
> file generated doesn't contain a proper xmlns in the svg tag, so both
> chrome and internet explorer is interpreting it as a plain xml file
> instead of rendering it.
>
> I guess this is a bug with imagemagick, but when I tried to do some
> research on this problem I found nothing. Maybe I could find something
> with more researches, but I don't have time now, and PNG is fine for
> me.
>
> Still, Andreas, thank you very much for helping.
>
> Regards,
>
> Haochen
>
> --
>
> Mail from Haochen Xie
>
> On Wed, Aug 12, 2015 at 5:50 PM, Andreas Leha 
>  wrote:
>
>
>  Hi Haochen,
>
>  You can render svg from latex through org directly. Here is a complete
>  example including a tikz diagram that that works on my system (once I
>  tackle a bug in PGF [1]).
>  It renders
>  - png by default (and for inlining the image into the org document)
>  - nothing for latex (directly include the tikz code into the tex document)
>  - svg for html
>
>  --8<---cut here---start->8---
>  #+LATEX_HEADER: \usepackage{tikz}
>
>  First execute the second code block, to define the convenience macro
>  and to set the required new variables in ob-latex.el. Then export to
>  HTML and to pdf to see the tree exported as an SVG image and as
>  embedded tikz respectively.
>
>  * Tikz test
>  Here's a tree, exported to both html and pdf.
>
>  #+header: :file (by-backend (html "tree.svg") (latex "tree.tikz") (t 
> "tree.png"))
>  #+header: :imagemagick :iminoptions -density 600 :imoutoptions -geometry 800
>  #+header: :results file raw
>  #+header: :fit yes
>  #+begin_src latex
>  \usetikzlibrary{trees}
>  \begin{tikzpicture}
>  \node [circle, draw, fill=red!20] at (0,0) {1}
>  child { node [circle, draw, fill=blue!30] {2}
>  child { node [circle, draw, fill=green!30] {3} }
>  child { node [circle, draw, fill=yellow!30] {4} }};
>  \end{tikzpicture}
>  #+end_src
>
>  #+results:
>  [[file:tree.png]]
>
>  * COMMENT setup
>  #+begin_src emacs-lisp :results silent
>  (setq org-babel-latex-htlatex "htlatex")
>  (defmacro by-backend (&rest body)
>  `(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body))
>  #+end_src
>  --8<---cut here---end--->8---
>
>  Regards,
>  Andreas
>
>  [1] http://tex.stackexchange.com/a/232739
>
>  Haochen Xie  writes:
>  > Hi Fabrice,
>  >
>  > Thank you for mentioning dvisvgm. I did some researches on it, and it 
> seems that as for now, the only way to invoke dvisvgm is to first export the 
> latex part to dvi, and call dvisvgm
>  > manually to convert it to svg, then include it in the org file, which, is 
> too troublesome for me. Is there any plan to add dvisvgm as an alternative to 
> dvipng and imagemagick? IMO svg
>  > images will look much better than png (well, in browsers supporting it), 
> so that's a nice option to have.
>  >
>  > Regards,
>  >
>  > Haochen
>  >
>  > --
>  >
>  > Mail from Haochen Xie
>  >
>  > On Tue, Aug 11, 2015 at 5:53 PM, Fabrice Popineau 
>  wrote:
>  >
>  >
>  > 2015-08-11 10:47 GMT+02:00 Haochen Xie :
>  >
>  >
>  > Hi Andreas,
>  >
>  > Thank you for your reply. I've read the whole thread, and found your
>  > example (the second link

Re: [O] [gnorb] completion for `gnorb-gnus-incoming-do-todo'

2015-08-12 Thread Eric Abrahamsen
Thomas Holst  writes:

> Hello,
>
> thanks for the gnorb package! I started using it and I like it a lot!
>
> When I call `gnorb-gnus-incoming-do-todo' from gnus I'm prompted for a
> headline. But completion is not working. Neither  nor M-j does
> anything.
>
> How can I get completion working? Completion is working for org-refile.
>
> I have no settings customized. Only key bindings as suggested.
>
> Thank you for looking into this!

Hi Thomas,

Glad to hear you're liking Gnorb! Can you tell me a few things about
your setup?

1. What versions of the packages are you using? Org and Gnorb?
2. Are you using any special completion packages (ido, iswitchb, helm)?
3. Can you confirm that the prompt where you're seeing failure is
   "Trigger heading:"?

I assume that putting point after this sexp and running "C-x C-e" gets
you a fully functional completion prompt, is that true?

(org-refile-get-location "Trigger heading" nil t)

Thanks for your help in tracking this down!

Eric




Re: [O] Help with export filter?

2015-08-12 Thread Nicolas Goaziou
Hello

Samuel Loury  writes:

> This I just the feature I need today. Thank you for sharing. Do you know
> what is missing to add the feature to org-mode instead of adding in each
> user's .emacs file?

This function apparently includes many features. Which one are you
talking about?

The :ignoreheading: part has been discussed already on this ML (and it's
a FAQ, IIRC). The major problem is that it is not clearly defined as
a parse tree operation.


Regards,

-- 
Nicolas Goaziou



Re: [O] Help with export filter?

2015-08-12 Thread Samuel Loury
Dear Nicolas,

Thank you for the prompt reply.
Nicolas Goaziou  writes:

> Samuel Loury  writes:
>
>> This I just the feature I need today. Thank you for sharing. Do you know
>> what is missing to add the feature to org-mode instead of adding in each
>> user's .emacs file?
>
> This function apparently includes many features. Which one are you
> talking about?

I used the clearpage and newpage features. The only other way I found
out was to add a bit of latex just before the heading.

--8<---cut here---start->8---
* My heading
  Some content with images.
@@latex:\clearpage@@
* My other heading, totally cleared
  some other content
--8<---cut here---end--->8---

What I dislike with this way of doing is that the latex fragment is
inside the heading above while I would prefer to associate it with the
second heading. The semantic in my case is "I am starting a brand new
topic, clear the floats from the last topic so that they won't pollute
my new topic".

I find the solution with the code of Thomas S. Dye very elegant:
--8<---cut here---start->8---
* My heading
  Some content with images.
* My other heading, totally cleared :clearpage:
  some other content
--8<---cut here---end--->8---

I hope I clarified the use and the what for.

Best regards,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Stable releases

2015-08-12 Thread Peter Salazar
Here here. I agree that the new clarified COMMENT vs. :noexport:
functionality makes more sense. And thanks to Nicolas and everyone else for
their amazing work.

On Wed, Aug 12, 2015 at 9:39 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> Scott Randby  writes:
>
> > When I started using 8.3, I discovered that the behavior of commented
> > headlines had been changed---a change with which I disagree, a change
> > I could not find in the release notes, and one which forces me to
> > alter a huge number of files. It seems I missed the discussion about
> > commented headlines on the mailing list. This is due to my limited
> > knowledge of elisp and programming in general, a gap which makes it
> > difficult for me to follow the more technical discussions on the
> > mailing list. While it has been explained to me that the change is
> > a feature, I consider it to be a serious bug since it is not backwards
> > compatible.
>
> I think this change is good. COMMENT status of headlines was muddy
> before. The only information about them was the following excerpt (from
> Org 8.2.9's manual)
>
>   Also entire subtrees starting with the word ‘COMMENT’ will never be
>   exported.
>
> which can mean many things. You extrapolated this definition to one of
> its possible meanings, but your definition, AFAIU, was :noexport:
> tags's.
>
> Now there is a clearer definition of a COMMENT headline, and a clear
> distinction between COMMENT and :noexport:.
>
> Note that you don't have to alter any of your files. The following
> function can do it for you on the fly, before each export. You can also
> used it to effectively alter your files automatically for you.
>
>   (defun my-comment-to-noexport (backend)
> (interactive)
> (goto-char (point-min))
> (while (re-search-forward "^\\*+.*\\( COMMENT\\)" nil t)
>   (when (save-match-data (org-in-commented-heading-p t))
> (replace-match "" nil nil nil 1)
> (org-set-tags-to (cons "noexport" (org-get-tags))
>
>   (add-hook 'org-export-before-processing-hook #'my-comment-to-noexport)
>
> I admit it could have been notified in ORG-NEWS.
>
> > Another issue I had with 8.3 is the deletion of the
> > org-latex-with-hyperref variable, something I could not find in the
> > release notes (maybe I missed it). I understand that having Org insert
> > \hypersetup{...} details is the most desirable situation, but I fail
> > to see the harm in keeping org-latex-with-hyperref for those of us who
> > needed it in the past. Yes, I figured out a fix, but this is a fix
> > that forces me to stick with an outmoded way of doing things, and so
> > I consider this deletion to be a bug.
>
> I'm not sure to understand. What is wrong with setting
> `org-latex-hyperref-template' to the empty string?
>
> This change was introduced in Feb 2014. It is a step forward since we
> move from an opt-in/opt-out to a full customizable template.
>
> I overlooked the fact that this replacement wasn't signaled in ORG-NEWS,
> tho. I will try to be more careful for next release.
>
> > I do understand that all software has bugs, and that everyone working
> > on Org is doing so voluntarily (thank you so much for your wonderful
> > work). But I was very surprised to find that the evaluation of table
> > formulas didn't work in 8.3.1. I could see something like this
> > happening in the development version, but it is somewhat mysterious to
> > me how such a bug could make its way into a stable release.
>
> I introduced these changes a short time (three days) before release.
> I made an announcement[fn:1] in order to warn there could be some
> hiccups in that area. It may be obnoxious for you, but no bug was
> reported before release.
>
> Another example is the recent columns view bug report[fn:2]. The faulty
> commit was pushed 2 months ago. Yet no one during development phase
> complained about column view being broken. Even a feature freeze period
> wouldn't have helped in that case.
>
> You can't really avoid small glitches after a release.
>
> > I guess what I want to know, and maybe there is no answer, is how long
> > should I wait before upgrading to a stable release? Org is by far the
> > most important piece of software I use (I hate it when I can't use
> > Org), and bugs (which I know can't be avoided) make it hard, even
> > impossible, for me to get my real work done. If there is a way for me
> > to minimize encountering bugs, I will appreciate a description of that
> > way.
>
> I suggest to only do regularly minor updates (e.g. 8.3.1 -> 8.3.2). For
> major updates, make sure you have some time to spare for bug reporting.
> I think we are usually pretty responsive when it comes to bugs.
>
>
> Regards,
>
> [fn:1] 
>
> [fn:2] 
>
> --
> Nicolas Goaziou
>
>


Re: [O] Help with export filter?

2015-08-12 Thread Nicolas Goaziou
Samuel Loury  writes:

> I find the solution with the code of Thomas S. Dye very elegant:
> * My heading
>   Some content with images.
> * My other heading, totally cleared :clearpage:
>   some other content
>
> I hope I clarified the use and the what for.

AFAICT, this is a very specific, cosmetic, feature targeting a single
family of export back-ends (i.e., LaTeX and derivatives).

I see nothing wrong to letting users implement it themselves, as they
see fit (e.g., one could prefer using a less visible node property for
that).

Regards,



Re: [O] couple questions about simple todo

2015-08-12 Thread Peter Salazar
This is great! It should be in the tutorial or something. I'm printing it
out to keep.

On Wed, Aug 12, 2015 at 12:45 AM, Eric Abrahamsen 
wrote:

> scraw...@gmail.com writes:
>
> > On Wed, Aug 12, 2015 at 10:27:29AM +0800, Eric Abrahamsen wrote:
> >>
> >> My take on what you've shown here is that you've got it a bit backwards.
> >> Apologies if you've tried many things and you settled on this on
> >> purpose, but it looks like you're trying to organize the Org file to
> >> look like the Agenda.
> >>
> >> It took me a while to get used to this, too. I think you'll find the Org
> >> tools work better if you forget about what the file itself looks like,
> >> and just look at the Agenda. So your Org file would look like:
> >>
> >> * All to Do [1/1]
> >> ** finished iron the cat <2015-08-11 Tue>
> >>
> >> And the Agenda will show you everything under its proper date heading.
> >>
> >> I've got scheduling Org files I hardly ever look at directly: todos go
> >> in with capture, and are examined, resolved and archived via the Agenda.
> >> It can be freeing, once you let the file itself go!
> >
> > I think you may be on to something. I use org every day, but I've been
> > using it for longer than I'd like to admit in underpowered and goofy
> > ways. I get inspired by power-user setups, go for it, get swamped by
> > complexity, throw up my hands.
> >
> > I'm trying something new here by going as dead-simple as I can. I can
> always add stuff as the need arises.
> >
> > I need to keep things reaaly easy while still doing things
> "the org way." I'll try to use an active timestamp and just try to remain
> calm.
> >
> > Oh, and while all the property drawers and options lines and everything
> are really cool and useful, all the junk that can fill up a buffer can sure
> get ugly and distracting.
> >
> > So I can avoid looking at all that?
>
> Sure, in principle you don't need that stuff at all! It depends on what
> you're using Org for, but if you're really trying to start simple and
> build up, then ignore properties etc for now.
>
> Starting off simple probably means just dumping all your TODOs under one
> heading. Use timestamps for events (going to the doctor), SCHEDULED for
> tasks you plan to do at a certain time ("iron the cat" above should
> probably have been a schedule, not a timestamp), and DEADLINE for tasks
> that need to be done by a certain time.
>
> An event should have a timestamp, but not a SCHEDULED or DEADLINE. A
> task should have one or both of SCHEDULED and DEADLINE (having both
> would mean "this has to be done by tomorrow morning, and I'm working on
> it this afternoon").
>
> Use two todo keywords: TODO and DONE.
>
> Then just stay in the Agenda. Use "t" to change todo status, and ">",
> "C-c C-s" and "C-c C-d" to manipulate the times. Nearly everything you
> want to do can be done using Agenda commands -- read that section of the
> manual a couple of times, and don't go to the file unless you have to.
>
> Stick with that until you really start to feel the need for more
> complexity. That might be more todo keywords, or maybe tag filtering. Or
> customizing how things are shown in the Agenda. My guess is you'll be
> able to go pretty far with just the above setup.
>
> Good luck,
> Eric
>
>
>


[O] Emacs/Org-mode at CCC Camp 15

2015-08-12 Thread Karl Voit
Hi!

I'm attending the CCC Camp in Mildenberg the following days:
https://events.ccc.de/camp/2015/wiki/Main_Page

Are there any Orgmoders as well?

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] Help with export filter?

2015-08-12 Thread Samuel Loury
Nicolas Goaziou  writes:

> Samuel Loury  writes:
>
>> I find the solution with the code of Thomas S. Dye very elegant:
>> * My heading
>>   Some content with images.
>> * My other heading, totally cleared :clearpage:
>>   some other content
>>
>> I hope I clarified the use and the what for.
>
> AFAICT, this is a very specific, cosmetic, feature targeting a single
> family of export back-ends (i.e., LaTeX and derivatives).
>
> I see nothing wrong to letting users implement it themselves, as they
> see fit (e.g., one could prefer using a less visible node property for
> that).

I agree with you.

Thank you for taking the time to answer.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] named python session

2015-08-12 Thread Andreas Leha
Hi python users,

I have a simple question to all python users.  I have a source block
with a named python session, e.g. 
 #+begin_src python :results output :session mypy
   x = 1
   print x
 #+end_src

Now I
- execute that source block and then I
- edit that block in its own buffer via C-c '.

My question:
How do I associate that with the python process in *mypy*?

I am asked to start python when I run python-shell-send-region.

Thanks,
Andreas




Re: [O] switch M-RET and C-RET in org mode with no sucess

2015-08-12 Thread Xebar Saram
Thx Peter

that did the trick, never know when to use RET or return :)

z

On Wed, Aug 12, 2015 at 6:22 AM, Peter Salazar 
wrote:

> Maybe try using  instead of RET? Something like this:
>
> (define-key org-mode-map (kbd "") 'org-insert-heading)
>
>
> On Tue, Aug 11, 2015 at 1:45 PM, Xebar Saram  wrote:
>
>> Hi guys
>>
>> im trying to switch between C-RET and M-RET (i use M-ret alot more but
>> C-RET is much more accessible for me :)) but i dont seem to have any
>> success in doing so
>>
>> this is what i have so far
>>
>> (with-eval-after-load "org"
>> (define-key org-mode-map (kbd "C-RET") 'org-insert-heading)
>> (define-key org-mode-map (kbd "M-RET")
>> 'org-insert-heading-respect-content)
>> )
>>
>> any ideas what im doing wrong? after reloading emacs C-RET still defaults
>> to org-insert-heading-respect-content
>>
>> best
>>
>> Z
>>
>
>


Re: [O] Stable releases

2015-08-12 Thread Scott Randby

On 08/12/2015 09:39 AM, Nicolas Goaziou wrote:

Hello,

Scott Randby  writes:


When I started using 8.3, I discovered that the behavior of commented
headlines had been changed---a change with which I disagree, a change
I could not find in the release notes, and one which forces me to
alter a huge number of files. It seems I missed the discussion about
commented headlines on the mailing list. This is due to my limited
knowledge of elisp and programming in general, a gap which makes it
difficult for me to follow the more technical discussions on the
mailing list. While it has been explained to me that the change is
a feature, I consider it to be a serious bug since it is not backwards
compatible.


I think this change is good. COMMENT status of headlines was muddy
before. The only information about them was the following excerpt (from
Org 8.2.9's manual)

   Also entire subtrees starting with the word ‘COMMENT’ will never be
   exported.

which can mean many things. You extrapolated this definition to one of
its possible meanings, but your definition, AFAIU, was :noexport:
tags's.

Now there is a clearer definition of a COMMENT headline, and a clear
distinction between COMMENT and :noexport:.

Note that you don't have to alter any of your files. The following
function can do it for you on the fly, before each export. You can also
used it to effectively alter your files automatically for you.

   (defun my-comment-to-noexport (backend)
 (interactive)
 (goto-char (point-min))
 (while (re-search-forward "^\\*+.*\\( COMMENT\\)" nil t)
   (when (save-match-data (org-in-commented-heading-p t))
 (replace-match "" nil nil nil 1)
 (org-set-tags-to (cons "noexport" (org-get-tags))

   (add-hook 'org-export-before-processing-hook #'my-comment-to-noexport)


This function won't work for me because I use COMMENT in two different 
ways. I didn't extrapolate the meaning of COMMENT, I copied its various 
uses from files that other people have posted in various places. It is 
more flexible for COMMENT to mean various things than it is for it to be 
pigeonholed to one narrow function. COMMENT wasn't broken until 8.3.




I admit it could have been notified in ORG-NEWS.


Another issue I had with 8.3 is the deletion of the
org-latex-with-hyperref variable, something I could not find in the
release notes (maybe I missed it). I understand that having Org insert
\hypersetup{...} details is the most desirable situation, but I fail
to see the harm in keeping org-latex-with-hyperref for those of us who
needed it in the past. Yes, I figured out a fix, but this is a fix
that forces me to stick with an outmoded way of doing things, and so
I consider this deletion to be a bug.


I'm not sure to understand. What is wrong with setting
`org-latex-hyperref-template' to the empty string?


I don't understand what is wrong with keeping org-latex-with-hyperref. 
It is easy enough for me to set the variable locally for old files while 
I can use the default \hypersetup{...} for new files. Making 
org-latex-hyperref-template an empty string means I cannot use the 
built-in default template.




This change was introduced in Feb 2014. It is a step forward since we
move from an opt-in/opt-out to a full customizable template.


I'm not sure why I didn't notice a problem before 8.3. Perhaps it is due 
to my irregular updating.




I overlooked the fact that this replacement wasn't signaled in ORG-NEWS,
tho. I will try to be more careful for next release.


I do understand that all software has bugs, and that everyone working
on Org is doing so voluntarily (thank you so much for your wonderful
work). But I was very surprised to find that the evaluation of table
formulas didn't work in 8.3.1. I could see something like this
happening in the development version, but it is somewhat mysterious to
me how such a bug could make its way into a stable release.


I introduced these changes a short time (three days) before release.
I made an announcement[fn:1] in order to warn there could be some
hiccups in that area. It may be obnoxious for you, but no bug was
reported before release.


I don't consider the bug to be obnoxious, I'm just trying to understand 
what is meant by a stable release.




Another example is the recent columns view bug report[fn:2]. The faulty
commit was pushed 2 months ago. Yet no one during development phase
complained about column view being broken. Even a feature freeze period
wouldn't have helped in that case.

You can't really avoid small glitches after a release.


Yes, I understand.




I guess what I want to know, and maybe there is no answer, is how long
should I wait before upgrading to a stable release? Org is by far the
most important piece of software I use (I hate it when I can't use
Org), and bugs (which I know can't be avoided) make it hard, even
impossible, for me to get my real work done. If there is a way for me
to minimize encountering bugs, I will appreciate a description of th

Re: [O] Stable releases

2015-08-12 Thread Scott Randby

On 08/11/2015 04:56 PM, Rasmus wrote:

Hi,

The definition of a major release is in README_maintainer:

 Main releases are made whenever Org is in a state where the feature
 set is consistent and we feel that the features that are implemented
 is something we want to support in the future.

AFAIK, Org 8.2.10 ships with Emacs 24.5 and you can use that.

I agree that the changes you mentioned should be in ORG-NEWS.

You can help by testing the master version against your files once in a
while and let us know of breakages.


This is very helpful. Thank you.



Rasmus





[O] 20150810 broke Android mobileorg synchronization?

2015-08-12 Thread Bingo UV
Hi,
Ever since I upgraded to 20150810 from orgmode elpa, mobileorg
synchronization with Android phone has stopped working[1]. Earlier
org version was from around 13 July. From my older mobileorg pushed
files, I see two important differences:

1. index.org with 20150810 contains extra header commented lines of TODO and 
DRAWERS, which are incorrect.

Pre 20150810
--
#+READONLY
#+TODO: TODO WAITING NEXT INPROGRESS DONE
#+TAGS: =IDENTICAL TAGS LINE
#+ALLPRIORITIES: A B C
--

In 20150810
--
#+READONLY
#+TODO: TODO WAITING NEXT INPROGRESS DONE
#+TODO:  | DONE
#+TAGS: =IDENTICAL TAGS LINE
#+DRAWERS: PROPERTIES CLOCK LOGBOOK RESULTS
#+ALLPRIORITIES: A B C
--

Once I remove these extra TODO and DRAWERS lines from mobileorg's index.org, 
mobileorg
synchronization with Android mobileorg application starts working again, but 
this needs 
to be done for every push.


2. All agenda org files contain extra PROPERTIES drawer for every entry. While 
it is not 
blocking synchronization, it increases file sizes significantly and might cause 
problems
in editing the file using simple scripts. Example of one entry is below, every 
entry at 
every level seems to have this extra entry.

Pre 20150810
--
*** NEXT sampletodoitem
:LOGBOOK:
- State "NEXT"   from "TODO"   [2015-07-08 Wed 21:18]
- State "TODO"   from ""   [2015-07-08 Wed 21:18]
:END:
:PROPERTIES:
:ID:   c035368f-cd7b-4159-bcc6-01632f4f8860
:END:
--


In 20150810
--
*** NEXT sampletodoitem
:PROPERTIES:
:ID:   9363d19f-84bc-4872-a77c-b931448e253c
:END:
:LOGBOOK:
- State "NEXT"   from "TODO"   [2015-07-08 Wed 21:18]
- State "TODO"   from ""   [2015-07-08 Wed 21:18]
:END:
:PROPERTIES:
:ID:   c035368f-cd7b-4159-bcc6-01632f4f8860
:END:
--


Can someone else confirm or deny these findings?


[1]: By stopped working, I mean "Clear database", then Synchronize causes only 
one entry (Agenda Views) to appear in 
mobileorg UI, that one entry is empty. Synchronize again causes one more entry 
(first org file) to appear, which is 
also empty. And so on.

thanks


pgppMXO2UR0G3.pgp
Description: OpenPGP digital signature


Re: [O] named python session

2015-08-12 Thread Ken Mankoff
Hi Andreas,

On 2015-08-12 at 08:06, Andreas Leha  wrote:
> How do I associate that with the python process in *mypy*?
> I am asked to start python when I run python-shell-send-region.


I have set up my system so that Org asks for a buffer name every time 
=org-edit-special= is called. This may be helpful to you.

  -k.
 

*** Custom Python Session Names

https://github.com/jorgenschaefer/elpy/issues/383

I want each python session to optionally have a unique name, so that I
can run multiple sessions in multiple windows/buffers/directories and
not have them interact/interfere.

Here I've copied =elpy-shell-get-or-create-process= from =elpy.el= and
modified it. I also have to modify =python-shell-get-process-name=.
This all is fairly easy, except when executing from Org it gets more
complicated, hence the special case if a function called from
=org-ctrl-c-ctrl-c=. 

#+BEGIN_SRC emacs-lisp :results none
  (defun elpy-shell-get-or-create-process ()
"Get or create an inferior Python process for current buffer and return it.
Customized by KDM to make dedicated sessions"
(let* ((bufname (format "*%s*" (python-shell-get-process-name t)))
   (proc (get-buffer-process bufname)))
  (if proc
  proc
(run-python (python-shell-parse-command) t nil) ;; DEDICATED!
(get-buffer-process bufname

  (defun python-shell-get-process-name (dedicated)
(if (equal this-command 'org-ctrl-c-ctrl-c)
(kdm/orig-py-sh-get-proc-name dedicated)
  (kdm/my-py-sh-get-proc-name dedicated)))

  (defun kdm/orig-py-sh-get-proc-name (dedicated)
"Calculate the appropriate process name for inferior Python process.
   If DEDICATED is t returns a string with the form
   `python-shell-buffer-name'[variable `buffer-name']."
(let ((process-name
   (if (and dedicated
(buffer-name))
   (format "%s[%s]" python-shell-buffer-name (buffer-name))
 (format "%s" python-shell-buffer-name
  process-name))

  (defun kdm/my-py-sh-get-proc-name (dedicated)
(if (boundp 'py-buf-proc-name)
(format "%s" py-buf-proc-name)
  (setq-local py-buf-proc-name
  (format "%s"
  (completing-read "Python session name: "
   nil nil nil (buffer-name) nil 
(buffer-name)))
  )))

#+END_SRC




Re: [O] org-block-background in 8.3.1?

2015-08-12 Thread Kyle Meyer
Sebastien Vauban writes:
> Kyle Meyer writes:
>> org-block-background was removed in f8b42e8 ("Don't use an overlay for
>> src blocks backgrounds", 2014-07-28) for performance reasons.
>
> IIRC, we never saw a profiler report showing that it slowed down buffer
> fontification in a visible way.  Correct me if I'm wrong.
>
> Really, it has been removed because of a problem when ps-print'ing an
> Org buffer -- though the bug was to find in `ps-def.el' and not in Org,
> as reported by Stefan Monnier [1].  It should have been fixed there
> instead.

Thank you for the background information.  My comment was based solely
off the commit message for f8b42e8.

--
Kyle



Re: [O] fa5fd6351605912ec75e783cb62649 breaks org-babel-script-escape for ob-ruby

2015-08-12 Thread Kyle Meyer
Matthew MacLean  writes:

> Alright, done. Is this acceptable? (Provided that tests don't count towards
> line count, of course)

Thanks.  A few minor comments on the commit message.

> Subject: [PATCH] ob-ruby: Fix double-escaping
>
> * lisp/ob-ruby.el: Remove second call to
>   `org-babel-ruby-table-or-string' in `org-babel-ruby-evaluate'.

Please add the name of the changed function in parentheses after the
file name rather than putting it in the description body.

> * testing/lisp/test-ob-ruby.el: Add test to verify
>   `org-babel-execute:ruby' can evaluate Ruby code. (What the
>   double-escape prevented)

Same here for the test name.  "Add test." for description would do.

> I removed the escaping from `org-babel-ruby-evaluate', because the only
> place `org-babel-ruby-evaluate' is ever called is in
> `org-babel-execute:ruby'.
>
> In this function, its result either escaped (Where the double escape
> previously occurred) or passed in as the "scalar-form" of
> `org-babel-result-cond', which handles the "pp" and "code" parameters.
> (A place that doesn't need escaping.)

I think the above two paragraphs could be replaced by a link to this ML
post.

Thanks for working on this.

--
Kyle



Re: [O] Stable releases

2015-08-12 Thread Achim Gratz
Scott Randby writes:
> While I've used Org's development version in the past, I stopped doing
> that due to my failure to learn how to use git (no time) and other
> issues. Now, I only use the stable releases. But the latest 8.3
> release doesn't seem so stable to me, so I'd like some clarification
> about what the Org maintainers mean by a stable release. Perhaps this
> is too vague, so let me explain a bit.

There are no stable releases, but major and minor ones (see
README_maintainer).  Major releases are developed in the master branch
and include backwards-incompatible changes as well as new and removed
features.  Minor releases are made from the maint branch and are kept
backwards compatible to the last major release (only bug fixes, no new
features, no feature removal).

> Normally, I wait many months before upgrading Org to a new stable
> release, but when 8.3 was released, I upgraded right away (from
> 8.2.10) since I have a new machine on which I installed Emacs 24.5. I
> read through the release notes for anything that might give me
> problems and didn't see anything.

Since the NEWS file isn't automatically generated, there are some holes
to be expected after two years of development.  That's not an excuse,
mind you, and everyone should strive to be more diligent in keeping the
code changes synced up with the documentation.

> I guess what I want to know, and maybe there is no answer, is how long
> should I wait before upgrading to a stable release? Org is by far the
> most important piece of software I use (I hate it when I can't use
> Org), and bugs (which I know can't be avoided) make it hard, even
> impossible, for me to get my real work done. If there is a way for me
> to minimize encountering bugs, I will appreciate a description of that
> way.

As always when it comes to updates, there is the camp that says you
should keep with the flow and make many small changes in doing so and
the other one that says to wait unltil the last moment and then do the
big-bang change of everything.  In your case it seems you need to plan
for some conversion time whenever you skip to a new major release.  I
don't see why you would skip minor releases though.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs




Re: [O] Stable releases

2015-08-12 Thread Scott Randby

On 08/12/2015 01:37 PM, Achim Gratz wrote:

Scott Randby writes:

While I've used Org's development version in the past, I stopped doing
that due to my failure to learn how to use git (no time) and other
issues. Now, I only use the stable releases. But the latest 8.3
release doesn't seem so stable to me, so I'd like some clarification
about what the Org maintainers mean by a stable release. Perhaps this
is too vague, so let me explain a bit.


There are no stable releases, but major and minor ones (see
README_maintainer).  Major releases are developed in the master branch
and include backwards-incompatible changes as well as new and removed
features.  Minor releases are made from the maint branch and are kept
backwards compatible to the last major release (only bug fixes, no new
features, no feature removal).


If there are no stable releases, then maybe the web site should not say: 
"Stable version 8.3.1 (Aug. 2015)." Perhaps "stable" should just be 
eliminated from that phrase. Certainly, the use of "stable" confused me.


Scott



Re: [O] fa5fd6351605912ec75e783cb62649 breaks org-babel-script-escape for ob-ruby

2015-08-12 Thread Matthew MacLean
In that case... Here is another patch with your suggestions.

Thanks for taking the time to point out all that..! I'll be sure to keep it
all in mind if I submit something else later.

On Wed, Aug 12, 2015 at 11:21 AM, Kyle Meyer  wrote:

> Matthew MacLean  writes:
>
> > Alright, done. Is this acceptable? (Provided that tests don't count
> towards
> > line count, of course)
>
> Thanks.  A few minor comments on the commit message.
>
> > Subject: [PATCH] ob-ruby: Fix double-escaping
> >
> > * lisp/ob-ruby.el: Remove second call to
> >   `org-babel-ruby-table-or-string' in `org-babel-ruby-evaluate'.
>
> Please add the name of the changed function in parentheses after the
> file name rather than putting it in the description body.
>
> > * testing/lisp/test-ob-ruby.el: Add test to verify
> >   `org-babel-execute:ruby' can evaluate Ruby code. (What the
> >   double-escape prevented)
>
> Same here for the test name.  "Add test." for description would do.
>
> > I removed the escaping from `org-babel-ruby-evaluate', because the only
> > place `org-babel-ruby-evaluate' is ever called is in
> > `org-babel-execute:ruby'.
> >
> > In this function, its result either escaped (Where the double escape
> > previously occurred) or passed in as the "scalar-form" of
> > `org-babel-result-cond', which handles the "pp" and "code" parameters.
> > (A place that doesn't need escaping.)
>
> I think the above two paragraphs could be replaced by a link to this ML
> post.
>
> Thanks for working on this.
>
> --
> Kyle
>
From 17447319eee53fbfcc6123c384842dd7fd04e3b8 Mon Sep 17 00:00:00 2001
From: Archenoth 
Date: Tue, 11 Aug 2015 23:59:25 -0600
Subject: [PATCH] ob-ruby: Fix double-escaping

* lisp/ob-ruby.el (org-babel-ruby-evaluate): Remove second call to
  `org-babel-ruby-table-or-string'.

* testing/lisp/test-ob-ruby.el (org-babel-ruby-evaluate): Add test.



TINYCHANGE
---
 lisp/ob-ruby.el  |  6 +-
 testing/lisp/test-ob-ruby.el | 17 +
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/lisp/ob-ruby.el b/lisp/ob-ruby.el
index 9b01dbf..0ff460e 100644
--- a/lisp/ob-ruby.el
+++ b/lisp/ob-ruby.el
@@ -201,11 +201,7 @@ return the value of the last statement in BODY, as elisp."
 			  org-babel-ruby-pp-wrapper-method
 			org-babel-ruby-wrapper-method)
 			  body (org-babel-process-file-name tmp-file 'noquote)))
-		 (let ((raw (org-babel-eval-read-file tmp-file)))
-   (if (or (member "code" result-params)
-   (member "pp" result-params))
-   raw
- (org-babel-ruby-table-or-string raw))
+		 (org-babel-eval-read-file tmp-file
 ;; comint session evaluation
 (case result-type
   (output
diff --git a/testing/lisp/test-ob-ruby.el b/testing/lisp/test-ob-ruby.el
index eb5233b..576cb13 100644
--- a/testing/lisp/test-ob-ruby.el
+++ b/testing/lisp/test-ob-ruby.el
@@ -21,6 +21,23 @@
 (unless (featurep 'ob-ruby)
   (signal 'missing-test-dependency "Support for Ruby code blocks"))
 
+(ert-deftest test-ob-ruby/basic-evaluation ()
+  "Test that basic evaluation works."
+(should (equal (org-test-with-temp-text "#+begin_src ruby
+ 2 + 2
+#+end_src"
+  (org-babel-execute-maybe)
+  (substring-no-properties
+   (buffer-string)))
+		   "#+begin_src ruby
+ 2 + 2
+#+end_src
+
+#+RESULTS:
+: 4
+
+")))
+
 (ert-deftest test-ob-ruby/session-output-1 ()
 (should (equal (org-test-with-temp-text "#+begin_src ruby :session :results output
 s = \"1\"
-- 
2.5.0



Re: [O] switch M-RET and C-RET in org mode with no sucess

2015-08-12 Thread Peter Salazar
Glad to be of help!

On Wed, Aug 12, 2015 at 11:33 AM, Xebar Saram  wrote:

> Thx Peter
>
> that did the trick, never know when to use RET or return :)
>
> z
>
> On Wed, Aug 12, 2015 at 6:22 AM, Peter Salazar 
> wrote:
>
>> Maybe try using  instead of RET? Something like this:
>>
>> (define-key org-mode-map (kbd "") 'org-insert-heading)
>>
>>
>> On Tue, Aug 11, 2015 at 1:45 PM, Xebar Saram  wrote:
>>
>>> Hi guys
>>>
>>> im trying to switch between C-RET and M-RET (i use M-ret alot more but
>>> C-RET is much more accessible for me :)) but i dont seem to have any
>>> success in doing so
>>>
>>> this is what i have so far
>>>
>>> (with-eval-after-load "org"
>>> (define-key org-mode-map (kbd "C-RET") 'org-insert-heading)
>>> (define-key org-mode-map (kbd "M-RET")
>>> 'org-insert-heading-respect-content)
>>> )
>>>
>>> any ideas what im doing wrong? after reloading emacs C-RET still
>>> defaults to org-insert-heading-respect-content
>>>
>>> best
>>>
>>> Z
>>>
>>
>>
>


[O] [PATCH] `org-return' in 8.3 no longer follows links in headings

2015-08-12 Thread Alexey Lebedeff
Hi all,

After switching to 8.3 I discovered that `org-return' no longer follows
links in headings, even if `org-return-follows-link' is non-nil. Instead it
started inserting newlines in the middle of link. This change of behavior
was introduced by a7e62499f2fe5c313567212ee90ff743c5e734a8

In the attached patch I just shuffled parts of `org-return' around. Maybe
it is better to move tag-preserving newline code to some helper function,
but I'm not sure how to do it properly.


Best,
Alexey
From d30093d4019d445b6b8d176837601bc3f712b190 Mon Sep 17 00:00:00 2001
From: Alexey Lebedeff 
Date: Wed, 12 Aug 2015 23:02:49 +0300
Subject: [PATCH] Make `org-return' follow links in headings again

* org.el (org-return): Check for links first when
  `org-return-follows-link' is non-nil, before inserting any newlines.

This patch restores order in which `org-return' perform actions (which
was changed in a7e62499f2fe5c313567212ee90ff743c5e734a8).  It is
TINYCHANGE, because patch mostly consists of moving existing code
around.
---
 lisp/org.el  | 63 
 testing/lisp/test-org.el |  6 +
 2 files changed, 38 insertions(+), 31 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index e8643e1..d7ecf85 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -21287,7 +21287,28 @@ will not happen if point is in a table or on a \"dead\"
 object (e.g., within a comment).  In these case, you need to use
 `org-open-at-point' directly."
   (interactive)
-  (if (and (not (bolp))
+  (let* ((context (if org-return-follows-link (org-element-context)
+		(org-element-at-point)))
+	 (type (org-element-type context)))
+(cond
+ ;; In a table, call `org-table-next-row'.
+ ((or (and (eq type 'table)
+	   (>= (point) (org-element-property :contents-begin context))
+	   (< (point) (org-element-property :contents-end context)))
+	  (org-element-lineage context '(table-row table-cell) t))
+  (org-table-justify-field-maybe)
+  (call-interactively #'org-table-next-row))
+ ;; On a link or a timestamp but not on white spaces after it,
+ ;; call `org-open-line' if `org-return-follows-link' allows it.
+ ((and org-return-follows-link
+	   (memq type '(link timestamp))
+	   (< (point)
+	  (save-excursion (goto-char (org-element-property :end context))
+			  (skip-chars-backward " \t")
+			  (point
+  (call-interactively #'org-open-at-point))
+ ;; Insert newline in heading, but preserve tags.
+ ((and (not (bolp))
 	   (save-excursion (beginning-of-line)
 			   (looking-at org-complex-heading-regexp)))
   ;; At headline.
@@ -21317,36 +21338,16 @@ object (e.g., within a comment).  In these case, you need to use
 	(end-of-line)
 	(org-show-entry)
 	(if indent (newline-and-indent) (newline))
-	(and string (save-excursion (insert (org-trim string)
-(let* ((context (if org-return-follows-link (org-element-context)
-		  (org-element-at-point)))
-	   (type (org-element-type context)))
-  (cond
-   ;; In a table, call `org-table-next-row'.
-   ((or (and (eq type 'table)
-		 (>= (point) (org-element-property :contents-begin context))
-		 (< (point) (org-element-property :contents-end context)))
-	(org-element-lineage context '(table-row table-cell) t))
-	(org-table-justify-field-maybe)
-	(call-interactively #'org-table-next-row))
-   ;; On a link or a timestamp but not on white spaces after it,
-   ;; call `org-open-line' if `org-return-follows-link' allows it.
-   ((and org-return-follows-link
-	 (memq type '(link timestamp))
-	 (< (point)
-		(save-excursion (goto-char (org-element-property :end context))
-(skip-chars-backward " \t")
-(point
-	(call-interactively #'org-open-at-point))
-   ;; In a list, make sure indenting keeps trailing text within.
-   ((and indent
-	 (not (eolp))
-	 (org-element-lineage context '(item)))
-	(let ((trailing-data
-	   (delete-and-extract-region (point) (line-end-position
-	  (newline-and-indent)
-	  (save-excursion (insert trailing-data
-   (t (if indent (newline-and-indent) (newline)))
+	(and string (save-excursion (insert (org-trim string))
+ ;; In a list, make sure indenting keeps trailing text within.
+ ((and indent
+	   (not (eolp))
+	   (org-element-lineage context '(item)))
+  (let ((trailing-data
+	 (delete-and-extract-region (point) (line-end-position
+	(newline-and-indent)
+	(save-excursion (insert trailing-data
+ (t (if indent (newline-and-indent) (newline))
 
 (defun org-return-indent ()
   "Goto next table row or insert a newline and indent.
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 3a156b8..9fee787 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -893,6 +893,12 @@
(org-test-with-temp-text "Link [[target]] <>"
  (let ((org-return-follows-link nil)) (org-return))
  (org-looking-at-p "<>")))
+  ;; Link in h

Re: [O] org-bbdb-birthday reminder

2015-08-12 Thread Matt Lundin
Julien Cubizolles  writes:

> I'm using org-bbdb-anniversaries to use the bbdb-anniversaries. At the
> moment, it only displays the birthdays of the day. How can I generate a
> reminder for a few days before the actual birthday ?

This is not possible at the moment with bbdb-anniversaries. 

For advanced reminders of birthdays and the like, you could use a
diary-sexp:

%%(diary-remind '(org-anniversary 1996 8 20) -7) Someone turns %s

Best,
Matt







[O] How would you export one headline every time that you tangle the file?

2015-08-12 Thread Grant Rettke
Good afternoon,

I've got an org file. It has a bunch of headlines. There is on
headline names README.

I want to do something every time I tangle the file. I want to:

- Go to that headline
- Select set the region to the contents of that headline (org-mark-subtree)
- Export the contents using the Github Flavored Markup to the file README.md.

I figured that I would figure out how to do all of this using Elisp,
write a function, and add that function
to the org-babel-post-tangle hook. I feel OK about that.

I haven't started yet because I started to wonder if doing this sort of thing
is just "built into" Org-Mode and coding it up would be a poor use of time. This
seems like something that I can't be the first one to be doing this.

So, I wondered, how would you do that? I don't want to recode
something that Org-Mode
already does just because I don't know all of Org-Mode.

Sincerely,

Grant Rettke
--
g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
“All creativity is an extended form of a joke.” --Kay
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson



Re: [O] using holiday dates from an ICAL calendar

2015-08-12 Thread Matt Lundin
Julien Cubizolles  writes:

> I need to define weekly appointments, except during the school
> holidays. I know org-class provides a way to exclude some weeks from
> recurring events but I was wondering if some clever use of sexp would
> make it possible to use the weeks/days of holiday from a public ical
> calendar (like
> https://www.google.com/calendar/ical/bubn5utkn054pluh4v44nu6ok62e1dbo%40import.calendar.google.com/public/basic.ics).

> Did somebody ever try it ?

One possible solution that comes to mind would be to parse the calendar
with icalendar-import-file.

wget 
https://www.google.com/calendar/ical/bubn5utkn054pluh4v44nu6ok62e1dbo%40import.calendar.google.com/public/basic.ics
 /tmp/basic.ics

Then within emacs:

(icalendar-import-file "/tmp/basic.ics" "/tmp/diary")

This produces entries that look like this:

--8<---cut here---start->8---
%%(and (diary-block 10 17 2015 11 1 2015)) Vacances de la Toussaint - Zone B
 Desc: Vacances de la Toussaint
 Location: Aix-Marseille, Amiens, Caen, Lille, Nancy-Metz, Nantes, Nice, 
Orléans-Tours, Reims, Rennes, Rouen, Strasbourg
--8<---cut here---end--->8---

You could write a script to parse this data and combine it with an
org-class sexp, resulting in something like this:

%%(and (not (diary-block 10 17 2015 11 1 2015)) (org-class 2015 9 15 2015 12 20 
3)) My class

Alternatively you could use the data in the diary block to calculate
which iso weeks to add to the SKIP-WEEKS arguments of org-class, which
has the following form:

(org-class Y1 M1 D1 Y2 M2 D2 DAYNAME &rest SKIP-WEEKS)

Here's a proof of concept that shows how you could quickly calculate
which days to add to org-class. It takes two dates and a day of week
(dow), returning the iso weeks in which the day of the week falls within
the diary block.

--8<---cut here---start->8---
(defun my-calculate-skip-weeks (date1 date2 dow)
  (let ((d1 (calendar-absolute-from-gregorian date1))
(d2 (calendar-absolute-from-gregorian date2))
(iso-weeks))
(while (< d1 d2)
  (let ((iso-date (calendar-iso-from-absolute d1)))
(when (eq (nth 1 iso-date) dow)
  (add-to-list 'iso-weeks (car (calendar-iso-from-absolute d1)) t)))
  (setq d1 (1+ d1)))
iso-weeks))
--8<---cut here---end--->8---

Using the diary block information above and taking Wednesday as the day
of the week, the function yields the days of the week to add as
SKIP-WEEKS in org-class:

(my-calculate-skip-weeks '(10 17 2015) '(11 1 2015) 3) => (43 44)

Based on this information, the org-class sexp could be written like
this:

%%(org-class 2015 9 15 2015 12 20 3 43 44) My class

Obviously this would need to be scripted. But I hope these ideas help.

Matt



[O] outorg issue

2015-08-12 Thread Andreas Leha
Hi all,

For quite some time now, I have to disable outshine/outorg [1] as it
does give me "Before first heading" (complete backtrace [2]) whenever I
open an org file followed by more issues actually using org mode.

I can even reproduce this with emacs -Q and a minimal configuration [3].

My system is:
: GNU Emacs 25.0.50.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 
10.9.5 (Build 13F1077))
:  of 2015-06-17
: Org-mode version 8.3beta (release_8.3beta-1264-g365c19)


Can anyone reproduce this and/or has a fix?  Or am I missing anything
obvious?

Thanks in advance!


Regards,
Andreas




[1] https://github.com/tj64/outshine
https://github.com/tj64/outorg


[2] complete backtrace when opening a random org file

--8<---cut here---start->8---
Debugger entered--Lisp error: (error "Before first heading")
  signal(error ("Before first heading"))
  error("Before first heading")
  outline-back-to-heading()
  outline-flag-subtree(t)
  hide-subtree()
  (save-excursion (goto-char (point-min)) (hide-subtree) (show-children 
keep-levels) (condition-case err (while (outline-get-next-sibling) 
(hide-subtree) (show-children keep-levels)) (error nil)))
  hide-sublevels(1)
  org-overview()
  org-set-startup-visibility()
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(# 
"~/hipsci/cellomics/cellomics.org" nil nil "~/hipsci/cellomics/cellomics.org" 
(25636441 16777218))
  find-file-noselect("~/hipsci/cellomics/cellomics.org" nil nil t)
  find-file("~/hipsci/cellomics/cellomics.org" t)
  funcall-interactively(find-file "~/hipsci/cellomics/cellomics.org" t)
  call-interactively(find-file nil nil)
  command-execute(find-file)
--8<---cut here---end--->8---



[3] minimal startup file

--8<---cut here---start->8---
;; outorg/outshine pre-requisite
(defvar outline-minor-mode-prefix "\M-#")

(add-to-list 'load-path (expand-file-name 
"~/local/emacs/org-mode-install/lisp"))
(add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . 
org-mode))

;; outorg/outshine
(add-to-list 'load-path "~/local/emacs/org-mode-in-comments/outorg/")
(add-to-list 'load-path "~/local/emacs/org-mode-in-comments/outshine")
(require 'outshine)
(add-hook 'outline-minor-mode-hook 'outshine-hook-function)
(setq outshine-use-speed-commands t)
--8<---cut here---end--->8---




Re: [O] show number of sub headers in top level header (alternative to statistics cookie?)

2015-08-12 Thread Matt Lundin
Xebar Saram  writes:

> I was wondering if there was an option in org to show number of sub
> headers in top level header. i know there is statistics cookies but
> that's not automatic?

There are a few ways one could use statistic cookies to make this more
"automatic."

The first is to set:

(setq org-provide-todo-statistics 'all-headlines)

Also make sure that org-hierarchical-todo-statistics is set to t (the
default).

This will make sure that the statistics cookie counts all entries, not
just todo keywords, so the second number in a cookie [3/18] will be the
total number of subheadings.

Org-mode already automatically updates cookies when changing a todo. But
you could also update the cookies when changing a headline to ensure an
up-to-date count:

(add-hook 'org-insert-heading-hook 'org-update-parent-todo-statistics)

Hope this helps,
Matt



Re: [O] Help with export filter?

2015-08-12 Thread Rasmus
Samuel Loury  writes:

> Dear Nicolas,
>
> Thank you for the prompt reply.
> Nicolas Goaziou  writes:
>
>> Samuel Loury  writes:
>>
>>> This I just the feature I need today. Thank you for sharing. Do you know
>>> what is missing to add the feature to org-mode instead of adding in each
>>> user's .emacs file?
>>
>> This function apparently includes many features. Which one are you
>> talking about?
>
> I used the clearpage and newpage features. The only other way I found
> out was to add a bit of latex just before the heading.

As Nicolas says, we'd need to think carefully as to how to incorporate
such things across backends for it to be worthwhile to include.  For
clearpage you'd have something like "" in ascii and there's an odt
equivalent as well.  For html it's less clear.

New features should be implemented like headline properties.

I would still like to see a proper ignoreheading, but it's a proper
definition of this behavior is hard.

Note: For all Tom's examples it would be enough to have a way to insert
arbitrary code just before (and maybe just after) a headline.  An
"export_before_BACKEND" property, say.

Rasmus

-- 
Vote for Dick Taid in an election near you!




Re: [O] [OFF TOPIC] almost giving up on emacs email..looking for advice?

2015-08-12 Thread Rasmus
Hi,

Eric Abrahamsen  writes:

> Rasmus  writes:
>
>> Eric Abrahamsen  writes:
>>
>>> It's not trivial when you live in China :)
>>>
>>> I can make it work, between alternate IP addresses and ssh tunnels, but
>>> it involves a lot of cursing and grinding my teeth. In a hostile network
>>> environment any client will face the same problems, but the lack of
>>> threading becomes pretty apparent here.
>>
>> I don't know what the great firewall is like, but for "hostile networks"
>> around here (universities blocking git, airports blocking smtp/imap etc),
>> I use openvpn.  Are commercial openvpn provides blocked in China?
>
> Both commercial providers, and non-commercial providers! I set up my own
> OpenVPN server on a US server, and that worked for a couple of years.
> Then they caught it, and I switched to a non-standard port. That worked
> for another four months or so, and now it doesn't work on any port. I'm
> sure OpenVPN traffic is pretty easily sniffable.

But what if you use TCP 443?  That should be hard to detect, though speed
might not be great...  I guess https is OK in China.

First link from startpage.com:

  
https://www.bestvpn.com/blog/5919/how-to-hide-openvpn-traffic-an-introduction/

> My next project is ipsec (another broken-leg project). But I figure, if
> I can google up these solutions, so can they, and the packet signatures
> of all these different systems must be quite identifiable.

Isn't ipsec as less popular version of Tor?  BTW: I tried Tor again in the
weekend since a relative was asking about it.  Speed seems to have gotten
a lot better (I'm in EU).

> Using vanilla ssh seems fairly reliable: for the time being, I don't
> think they'd go so far as to block ssh across the board. That would
> really be declaring war on the internet. So sshuttle, tunnels, and the
> built-in ssh SOCKS proxy are serving me well. Using dnscrypt-proxy
> actually solves many of the problems -- in years past, it would have
> solved everything, but they've started hell-banning IP ranges, and of
> course that includes gmail. My own dumb fault for using gmail, I guess.

The problem for me with socks is that it doesn't allow arbitrary port
connections (I mostly deal with bad network configs, e.g. closed XMPP or
git ports).

> How off-topic can we get? :)

It's interesting.  And +30°C.  It's fin!  Thanks for sharing!

Rasmus

-- 
May the Force be with you




Re: [O] Stable releases

2015-08-12 Thread Rasmus
Scott Randby  writes:

> I don't understand what is wrong with keeping
> org-latex-with-hyperref. It is easy enough for me to set the variable
> locally for old files while I can use the default \hypersetup{...} for
> new files. Making org-latex-hyperref-template an empty string means I
> cannot use the built-in default template.

You can use file-variable or BIND to set org-latex-with-hyperref to the
empty string or nil.  We could include org-latex-with-hyperref, but I
don't see any advantage in having two ways to disable hyperref setup...

Also, org-latex-with-hyperref does not seem to have ox-publish support,
skimming 8.2.10 briefly.

Still, the ORG-NEWS entry could've been better.

Rasmus

-- 
Warning: Everything saved will be lost




[O] :PROPERTIES: right after ?

2015-08-12 Thread Boyan Penkov
Hey folks,

Is is the case that, syntactically, the :PROPERTIES: drawer must be immediately 
after the :SCHEDULED: line?

Here’s the example; after the org-20150810 update

TODO Water the plants.
   SCHEDULED: <2015-08-13 Thu .+1d/2d>
   :PROPERTIES:
   :STYLE: habit
   :LAST_REPEAT: [2015-08-12 Wed 19:24]
   :END:
   - State "DONE"   from "WAITING"[2015-08-12 Wed 19:24]
   - State "DONE"   from "WAITING"[2015-08-11 Tue 21:17]
   - State "DONE"   from "WAITING"[2015-08-10 Mon 21:40]
   - State "DONE"   from "WAITING"[2015-08-09 Sun 21:19]

correctly shows the habit string in the agenda, but

TODO Water the plants.
   SCHEDULED: <2015-08-13 Thu .+1d/2d>
   - State "DONE"   from "WAITING"[2015-08-12 Wed 19:24]
   - State "DONE"   from "WAITING"[2015-08-11 Tue 21:17]
   - State "DONE"   from "WAITING"[2015-08-10 Mon 21:40]
   - State "DONE"   from "WAITING"[2015-08-09 Sun 21:19]
   :PROPERTIES:
   :STYLE: habit
   :LAST_REPEAT: [2015-08-12 Wed 19:24]
   :END:

does not in the agenda view.

Should I go and change all these in my files?

Cheers!
--
Boyan Penkov
www.boyanpenkov.com



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [O] :PROPERTIES: right after ?

2015-08-12 Thread Kyle Meyer
Hello,

Boyan Penkov  writes:

> Hey folks,
>
> Is is the case that, syntactically, the :PROPERTIES: drawer must be
> immediately after the :SCHEDULED: line?

Yes, as of version 8.3:

http://orgmode.org/Changes.html

This includes a function you can use to fix up your files.

--
Kyle



Re: [O] [PATCH] `org-return' in 8.3 no longer follows links in headings

2015-08-12 Thread Nicolas Goaziou
Hello,

Alexey Lebedeff  writes:

> After switching to 8.3 I discovered that `org-return' no longer follows
> links in headings, even if `org-return-follows-link' is non-nil. Instead it
> started inserting newlines in the middle of link. This change of behavior
> was introduced by a7e62499f2fe5c313567212ee90ff743c5e734a8
>
> In the attached patch I just shuffled parts of `org-return' around. Maybe
> it is better to move tag-preserving newline code to some helper function,
> but I'm not sure how to do it properly.

Applied. Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] couple questions about simple todo

2015-08-12 Thread scrawler
On Wed, Aug 12, 2015 at 12:45:23PM +0800, Eric Abrahamsen wrote:
> scraw...@gmail.com writes:
> 
> > So I can avoid looking at all that?
> 
> Sure, in principle you don't need that stuff at all! It depends on what
> you're using Org for, but if you're really trying to start simple and
> build up, then ignore properties etc for now.

I meant I could have them, if needed, but wouldn't see them while
looking at the agenda.

I'm going to follow your advice except I'll probaby name TODO and DONE
something different, just to be different.

Thanks very much for your help. :-)
--





[O] OrgTbl mode not working

2015-08-12 Thread Benjamin Slade
Since some recent update of either orgmode or AUCTeX, OrgTbl-mode is no
longer working for me.  The OrgTbl menu appears, and allows me to insert
tables, but it does not treat inserted tables as actual orgmode tables,
but just as regular characters (i.e. I can't edit them as tables, or
"compile" them into LaTeX tables with C-c C-c, etc.)

~
Dr Benjamin Slade
pgp fingerprint: 21BA 2AE1 28F6 DF36 110A 0E9C A320 BBE8 2B52 EE19
~
{sent by mu4e on Emacs running under GNU/Linux}
(Choose Linux, Choose Freedom)



Re: [O] How would you export one headline every time that you tangle the file?

2015-08-12 Thread Charles C. Berry

On Wed, 12 Aug 2015, Grant Rettke wrote:


Good afternoon,

I've got an org file. It has a bunch of headlines. There is on
headline names README.

I want to do something every time I tangle the file. I want to:

- Go to that headline
- Select set the region to the contents of that headline (org-mark-subtree)
- Export the contents using the Github Flavored Markup to the file README.md.



If this is a one-off, I'd write a babel block like this and put it under 
the headline of that subtree:


#+NAME: tangle-and-export-readme
#+BEGIN_SRC emacs-lisp :tangle no :exports none
(org-babel-tangle)
(require 'ox-gfm)
(org-export-to-file 'gfm "README.md" nil t)
#+END_SRC


Then when you want to tangle,

C-c C-v g tangle-and-export-readme RET C-c C-c y

will do it. (Assuming contrib is on the load path, of course.)

You can use TAB completion with `C-c C-v g'.

HTH,

Chuck



Re: [O] org-bbdb-birthday reminder

2015-08-12 Thread Nick Dokos
Matt Lundin  writes:

> Julien Cubizolles  writes:
>
>> I'm using org-bbdb-anniversaries to use the bbdb-anniversaries. At the
>> moment, it only displays the birthdays of the day. How can I generate a
>> reminder for a few days before the actual birthday ?
>
> This is not possible at the moment with bbdb-anniversaries. 
>
> For advanced reminders of birthdays and the like, you could use a
> diary-sexp:
>
> %%(diary-remind '(org-anniversary 1996 8 20) -7) Someone turns %s
>

org-bbdb-anniversaries depends on having a dynamically bound variable
called 'date' in the format (month day year) and produces the list
of anniversaries for that particular date. Instead of doing

%%(org-bbdb-anniversaries)

you could do

%%(let ((date '(9 1 2015))) (org-bbdb-anniversaries))

which produces the anniversaries for 2015-09-01,
no matter what the current date is. That's silly of
course but you could take advantage of it as follows:
you could define your own function and do

%%(my-anniversaries)

org-bbdb-anniversaries produces a list of strings, one string for each
anniversary falling on the given date. So your function
would have to calculate the list of dates that it wants anniversaries
for, and for each date d in that list calculate the list of
anniversaries for that date:

   (let ((date d)) (org-bbdb-anniversaries))

probably annotating each string in the resulting list with the date of
the anniversary and accumulating it in a single list, which it would
then return.

Obviously lots of details are missing - nevertheless, I hope it helps
a bit.

Nick









Re: [O] couple questions about simple todo

2015-08-12 Thread Eric Abrahamsen
scraw...@gmail.com writes:

> On Wed, Aug 12, 2015 at 12:45:23PM +0800, Eric Abrahamsen wrote:
>> scraw...@gmail.com writes:
>> 
>> > So I can avoid looking at all that?
>> 
>> Sure, in principle you don't need that stuff at all! It depends on what
>> you're using Org for, but if you're really trying to start simple and
>> build up, then ignore properties etc for now.
>
> I meant I could have them, if needed, but wouldn't see them while
> looking at the agenda.

Oh, I see -- sure, the Agenda view does often end up looking cleaner.

> I'm going to follow your advice except I'll probaby name TODO and DONE
> something different, just to be different.

Rebel!

> Thanks very much for your help. :-)

My pleasure.




Re: [O] [OFF TOPIC] almost giving up on emacs email..looking for advice?

2015-08-12 Thread Eric Abrahamsen
Rasmus  writes:

> Hi,
>
> Eric Abrahamsen  writes:
>
>> Rasmus  writes:
>>
>>> Eric Abrahamsen  writes:
>>>
 It's not trivial when you live in China :)

 I can make it work, between alternate IP addresses and ssh tunnels, but
 it involves a lot of cursing and grinding my teeth. In a hostile network
 environment any client will face the same problems, but the lack of
 threading becomes pretty apparent here.
>>>
>>> I don't know what the great firewall is like, but for "hostile networks"
>>> around here (universities blocking git, airports blocking smtp/imap etc),
>>> I use openvpn.  Are commercial openvpn provides blocked in China?
>>
>> Both commercial providers, and non-commercial providers! I set up my own
>> OpenVPN server on a US server, and that worked for a couple of years.
>> Then they caught it, and I switched to a non-standard port. That worked
>> for another four months or so, and now it doesn't work on any port. I'm
>> sure OpenVPN traffic is pretty easily sniffable.
>
> But what if you use TCP 443?  That should be hard to detect, though speed
> might not be great...  I guess https is OK in China.
>
> First link from startpage.com:
>
>   
> https://www.bestvpn.com/blog/5919/how-to-hide-openvpn-traffic-an-introduction/

Oh, interesting! Let me fire up my ssh tunnel so I can open the link...

Okay, that's really useful, I'll try some of these solutions, thank you.
I'll admit I'm often too impatient to sit down and do the research.

startpage.com is nice, but it looks like they've already found that. I'm
using search.disconnect.me, which is great, and so far open.

>> My next project is ipsec (another broken-leg project). But I figure, if
>> I can google up these solutions, so can they, and the packet signatures
>> of all these different systems must be quite identifiable.
>
> Isn't ipsec as less popular version of Tor?  BTW: I tried Tor again in the
> weekend since a relative was asking about it.  Speed seems to have gotten
> a lot better (I'm in EU).

I don't think it's like Tor, as in I don't think it's P2P. I tried Tor a
couple of years ago and it was unusably slow -- maybe it's time again.

>> Using vanilla ssh seems fairly reliable: for the time being, I don't
>> think they'd go so far as to block ssh across the board. That would
>> really be declaring war on the internet. So sshuttle, tunnels, and the
>> built-in ssh SOCKS proxy are serving me well. Using dnscrypt-proxy
>> actually solves many of the problems -- in years past, it would have
>> solved everything, but they've started hell-banning IP ranges, and of
>> course that includes gmail. My own dumb fault for using gmail, I guess.
>
> The problem for me with socks is that it doesn't allow arbitrary port
> connections (I mostly deal with bad network configs, e.g. closed XMPP or
> git ports).

I only use socks for sending email, so it works fine. I've ended up with
multiple concurrent solutions, which doesn't bother me too much. But if
I could get openvpn back online, I'd like to just use that. If I could
set up some sort of selective tunneling, based on a whitelist of hosts,
that would be nice...

>> How off-topic can we get? :)
>
> It's interesting.  And +30°C.  It's fin!  Thanks for sharing!

Fun stuff! I'll report back with any surprising news.




Re: [O] Exporting calender to ical

2015-08-12 Thread Matt Lundin
Benny Simonsen  writes:

> ** <2015-08-11 12:00> Simple event, default duration
> :PROPERTIES:
> :ID: 71def5c6-2f7e-4560-88d9-f13187bfd9f8
> :END:

How did you produce these timestamps? Org-mode always includes a day of
week when it generates a timestamp. E.g., if I adjust the timestamp with
shift-up or shift-right, org-mode automatically fixes it to:

* <2015-08-11 Tue 12:00> Simple event, default duration

> - All subjects have got the timestamp in the subject

That said, even with the correct timestamp syntax, I can confirm that
org-icalendar-export-to-ics leaves the timestamp in the
headline/summary. However, placing the timestamp beneath the headline
works fine:

* Simple event, default duration
  <2015-08-11 Tue 12:00>

...results in...

--8<---cut here---start->8---
BEGIN:VEVENT
DTSTAMP:20150813T023625Z
UID:TS1-baefe3e9-6317-4d41-b609-98787e373c81
DTSTART:20150811T12
DTEND:20150811T14
SUMMARY:Simple event, default duration
DESCRIPTION:<2015-08-11 Tue 12:00>
CATEGORIES:inbox
END:VEVENT
--8<---cut here---end--->8---

> - Duration is the default duration even for even for events with a
> time-interval
> - Events with time-interval is show double

[...]

> ** <2015-08-12 12:00>-<2015-08-12 12:59> Event with specified duration
> :PROPERTIES:
> :ID: d8056b59-c841-451c-b0b7-bbf8e8695838
> :END:

I believe this syntax for duration is incorrect. It does not even work
with org-mode's agenda. E.g., the agenda line looks like this:

  inbox:  12:00.. <2015-08-12 >-<2015-08-12 12:59> Event with specified 
duration

The correct syntax for duration is...

<2015-08-12 Wed 12:00-12:59>

When I use that, the duration exports correctly to ics. See
http://orgmode.org/manual/Timestamps.html for more details.

Hope this helps.
Matt



[O] todo autochange to done

2015-08-12 Thread scrawler
Hey guys,

In the manual, section 5.5, there is a function shown that would allow a "TODO 
entry to automatically change to DONE when all children are done". Here it is:

;>

(defun org-summary-todo (n-done n-not-done)
 "Switch entry to DONE when all subentries are done, to TODO otherwise."
 (let (org-log-done org-log-states)
; turn off logging
   (org-todo (if (= n-not-done 0) "finished" ":-)"
(add-hook ’org-after-todo-statistics-hook ’org-summary-todo)

;<

I get this:
Symbol's value as variable is void: ’org-after-todo-statistics-hook

What's going on?
thanks!
-- 
signature to baby: "doobywoobybooboo"
:-)



Re: [O] fa5fd6351605912ec75e783cb62649 breaks org-babel-script-escape for ob-ruby

2015-08-12 Thread Kyle Meyer
Matthew MacLean  writes:

> In that case... Here is another patch with your suggestions.

I've pushed this (stripping out the test).  Thank you for the fix.

--
Kyle



Re: [O] fa5fd6351605912ec75e783cb62649 breaks org-babel-script-escape for ob-ruby

2015-08-12 Thread Matthew MacLean
Gnarly--and thank you for the help!

On Wed, Aug 12, 2015 at 9:41 PM, Kyle Meyer  wrote:

> Matthew MacLean  writes:
>
> > In that case... Here is another patch with your suggestions.
>
> I've pushed this (stripping out the test).  Thank you for the fix.
>
> --
> Kyle
>


[O] [PATCH] Re: helm-mode-org-set-tags adding additional tags

2015-08-12 Thread Matt Lundin
"Stephen J. Barr"  writes:

> I am using org-mode 8.2.10 with helm. When I am adding tags to a
> headline, the first tag offers me completions of all possible tags in
> the file. However, if I go back later and add additional tags, I am
> not offered completion. How can I fix this?

I can confirm that this is not just a helm problem. There is a bug with
all completion backends with the the following *default* settings:

(setq org-use-fast-tag-selection 'auto) ;; provided that shortcuts are
;; defined in org-tag-alist
(setq org-fast-tag-selection-single-key nil)
(setq org-complete-tags-always-offer-all-agenda-tags nil)

Steps to replicate (without helm):

M-x org-set-tags
[Tab] Select via completion [Ret]
[Tab] Only the most recent tab appears [Ret]

The following patch should fix the problem.

>From 370ba61a4647bb97d2233ccb6ef84db033824248 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Wed, 12 Aug 2015 23:22:22 -0500
Subject: [PATCH] Fix completion when selecting more than one tag

* lisp/org.el (org-fast-tag-selection): Make sure to set local variable
  buffer-tags to actual buffer-tags before pushing selected tag to the
  list; otherwise, the subsequent completion list will be limited to the
  one selected tag.
---
 lisp/org.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index a908d9e..d7528fc 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15314,7 +15314,8 @@ Returns the new tags string, or nil to not change the current settings."
 "Tag: "
 (or buffer-tags
 (with-current-buffer buf
-  (org-get-buffer-tags)
+  (setq buffer-tags
+	(org-get-buffer-tags))
 		(quit (setq tg "")))
 		  (when (string-match "\\S-" tg)
 		(add-to-list 'buffer-tags (list tg))
-- 
2.5.0



Re: [O] tags completion in a narrowed buffer

2015-08-12 Thread Matt Lundin
"Stephen J. Barr"  writes:

> Greetings,
>
> In my workflow I frequently narrow buffers. Within a narrowed buffer,
> I would like to add additional headlines with tag completion. However,
> the menu of tags offered for completion are only the tags in the
> narrowed buffer. Is it possible for me to specify that tag completion
> should always offer me all tags in all org-agenda-files files.

(setq org-complete-tags-always-offer-all-agenda-tags t)

Matt



Re: [O] todo autochange to done

2015-08-12 Thread Matt Lundin
scraw...@gmail.com writes:

> In the manual, section 5.5, there is a function shown that would allow
> a "TODO entry to automatically change to DONE when all children are
> done". Here it is:
>
> ;>
>
> (defun org-summary-todo (n-done n-not-done)
>  "Switch entry to DONE when all subentries are done, to TODO otherwise."
>  (let (org-log-done org-log-states)
>   ; turn off logging
>(org-todo (if (= n-not-done 0) "finished" ":-)"
> (add-hook ’org-after-todo-statistics-hook ’org-summary-todo)
>
> ;<
>
> I get this:
> Symbol's value as variable is void: ’org-after-todo-statistics-hook

Check the quote character before org-after-todo-statistics-hook and
org-summary-todo: it should be ' not ’.

Matt



Re: [O] Exporting calender to ical

2015-08-12 Thread Benny Simonsen
2015-08-13 4:45 GMT+02:00 Matt Lundin :

> Benny Simonsen  writes:
>
> > ** <2015-08-11 12:00> Simple event, default duration
> > :PROPERTIES:
> > :ID: 71def5c6-2f7e-4560-88d9-f13187bfd9f8
> > :END:
>
> How did you produce these timestamps?


I have made the timestamp by hand and I propably found that it didn't
change anything, so it was faster not including the day of week.



> * Simple event, default duration
>   <2015-08-11 Tue 12:00>
>
> ...results in...
>
> DESCRIPTION:<2015-08-11 Tue 12:00>
>

We still have the timestamp but just moved to DESCRIPTION.

I would normally like to get it completely removed.

Maybe I should make an option for removing active timestamps in the header
or postprocess the ics file for my special usage.


<2015-08-12 Wed 12:00-12:59>
>
[cut]

>
> When I use that, the duration exports correctly to ics. See
> http://orgmode.org/manual/Timestamps.html for more details.
>


Great - Much easer to read.


>
> Hope this helps.
> Matt
>

Yes, thank you.


Re: [O] [ANN] org-link-edit.el --- Slurp and barf with Org links

2015-08-12 Thread Kyle Meyer
Bastien Guerry  writes:

> Nicolas Goaziou  writes:
>
>> Wasn't it a goal to slowly move away from contrib/ and use either ELPA
>> or core instead?
>
> Yes, it is still a goal -- but we don't know when this will happen so
> in the meantime, adding a package to contrib/ is okay.

OK, I've added it to contrib for the time being.

--
Kyle



Re: [O] org-bbdb-birthday reminder

2015-08-12 Thread Julien Cubizolles
Matt Lundin  writes:


> This is not possible at the moment with bbdb-anniversaries. 

I thought someone would have felt the need to have this list of upcoming
birthdays. I'm guess not so many of you always end up rushing to buy
presents in the last days the way I dO.

> For advanced reminders of birthdays and the like, you could use a
> diary-sexp:
>
> %%(diary-remind '(org-anniversary 1996 8 20) -7) Someone turns %s

I'll give it a try thanks, but you need one line per birthday you want
to be reminded of. It would be much easier to have just a field in bbdb
to select these contatcs.

Julien.