[O] No image output from Maxima in Babel

2016-02-05 Thread Zachary Peterson
Hello,

After recently learning about Babel, I've been working my way through
some of the examples in the various languages' documentation, and I've
run into a problem with Maxima. I evaluated this code, taken from the
documentation at
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-maxima.html#sec-4-3,
with only the filename changed:

#+name: 3d-maxima
#+header: :file maxima-3d.png
#+header: :exports results
#+header: :results graphics
#+begin_src maxima 
  programmode: false;
  plot3d(atan(-x^2+y^3/4),[x,-4,4],[y,-4,4],[grid,50,50],[gnuplot_pm3d,true]);
#+end_src

It returns this:
#+RESULTS: 3d-maxima
[[file:maxima-3d.png]]

The file is empty, though.

Running the code from within the Maxima REPL produces the expected
result.

I'm running Org version 20160201 on GNU Emacs 24.4.1 with Maxima 5.34.1
on Debian Jessie.

I would appreciate any help. Thanks.
-- 
Zachary Peterson
zap5...@psu.edu
(317) 828-2377
OpenPGP key: BF5879D6



[O] bug#22472: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert

2016-02-05 Thread Stephen J. Barr
I was in the progress of writing my own email about this same issue. I was
not aware that C-c C-c is no longer used for disabling overlays. If this is
the case, what is the correct workflow for toggling these previews on and
off?

Thanks,

-Stephen



Stephen J. Barr
PhD Candidate, Operations Management
Dept: Information Systems and Operations Management (ISOM)
Michael G. Foster School of Business
University of Washington
Phone:  425 516 5012
Email: stev...@uw.edu
Twitter: @stevejb
Website: http://stephen.planetbarr.com



On Fri, Feb 5, 2016 at 2:10 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> Dima Kogan  writes:
>
> > Ah. Thanks for explaining. The patch helps somewhat, but one can still
> > get into an inconsistent state:
> >
> >   1. Write \(1 + 2\)
> >   2. Toggle overlay with C-c C-x C-l
> >   3. M-x revert-buffer
> >
> > After the revert, the overlay remains, which is arguably OK, since the
> > text has not changed. However after the revert org doesn't realize that
> > the overlay is still up: org-latex-fragment-image-overlays is nil.
>
> Indeed.
>
> `org-latex-fragment-image-overlays' is a local variable and
> `revert-buffer' calls `normal-mode', which, in turn, calls
> `fundamental-mode'. The latter calls `kill-all-local-variables'.
> Information is lost.
>
> I don't think that `org-latex-fragment-image-overlays' is useful,
> anyway. So I removed it, along with that bug, hopefully.
>
> > I think the overlays should all disappear on a revert.
>
> I'm not convinced that an unmodified overlay should disappear.
>
> Thank you for the report.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>
>
>
>


Re: [O] Columnview *** is exported as *

2016-02-05 Thread Nicolas Goaziou
Hello,

Michael Brand  writes:

> Commit release_8.3.3-547-g00f0c70 does not respect the stars of ITEM
> any more for the dynamic column width of the interactive column view
> with overlays. The fix of org-columns-get-autowidth-alist for the two
> "(setq-local org-columns-current-maxwidths [...]" seems too
> complicated to do it myself.
>
> The MCE
>
> --
> * Column view
> *** Subsection
> * Subsubsection
> * File config :ARCHIVE:
>   #+COLUMNS: %ITEM
>   #+STARTUP: odd showall
> --
>
> changes the looking from
>
> --
> ITEM|
> * Column view   |
> *** Subsection  |
> * Subsubsection |
> * File config :ARCHIVE:...
> --
>
> to
>
> --
> ITEM  |
> * Column view |
> *** Subsect.. |
> * Subsu.. |
> * File config :ARCHIVE:...
> --

Fixed. Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] inline code and minted

2016-02-05 Thread Alan Schmitt
On 2016-02-05 14:33, Nicolas Goaziou  writes:

>> I have two questions:
>> - should we support this and generate this code?
>
> Sure. Could you provide and apply a patch for that?

Yes. Here it is for review, please let me know if I can apply it.

From aa8c0fa91af7a9307491bad78d7f82ce1705a7bd Mon Sep 17 00:00:00 2001
From: Alan Schmitt 
Date: Fri, 5 Feb 2016 15:55:54 +0100
Subject: [PATCH] ox-latex.el: Fix minted inline

* lisp/ox-latex.el (org-latex-inline-src-block): Output minted code that
  correctly formats code inline.
---
 lisp/ox-latex.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index ec06b17..5879e40 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2012,10 +2012,10 @@ contextual information."
 			 (downcase org-lang)))
 	  (options (org-latex--make-option-string
 			(plist-get info :latex-minted-options
-	 (concat (format "\\mint%s{%s}"
+	 (format "\\mintinline%s{%s}{%s}"
 			 (if (string= options "") "" (format "[%s]" options))
-			 mint-lang)
-		 separator code separator)))
+			 mint-lang
+			 code)))
   ;; Use listings package.
   (otherwise
;; Maybe translate language's name.
-- 
2.7.0


>> - in the meantime, I created a macro that does this for latex, but it
>> does not work for html (it exports the “src_coq” string verbatim):
>> #+macro: coq @@latex:\mintinline{coq}{$1}html:src_coq[:exports 
>> code]{$1}@@
>> Why is this macro wrong?
>
> Contents of an export snippet, e.g. @@html:...@@ are not evaluated by
> the back-end. IOW this is back-end code.

I see. I think I’ll just use  then and skip the syntax coloring
for the moment.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated February 4, 2016, Mauna Loa Obs.): 403.08 ppm


signature.asc
Description: PGP signature


Re: [O] references to arbitrary labels in org and export to latex

2016-02-05 Thread Kaushal Modi
On Fri, Feb 5, 2016 at 8:40 AM John Kitchin  wrote:

> Could you use footnotes for this?
>
>
I had to go with that custom solution on emacs.SE because I wanted the
links to be rendered just like [[link][description]], without plain-text
links in the footnotes. But I also needed a Footnotes-like convenience
where it is easy to edit all links in a central place.


Re: [O] inline code and minted

2016-02-05 Thread Kaushal Modi
On Fri, Feb 5, 2016 at 10:01 AM Alan Schmitt 
wrote:

>
> Yes. Here it is for review, please let me know if I can apply it.
>

TIL that we can have inline source code highlighting in org exports!

For anyone else that just got enlightened about this, check out "C-h i g
(org) Structure of code blocks".

@Alan: I tried out your patch and it works great! Thanks!


Re: [O] inline code and minted

2016-02-05 Thread Nicolas Goaziou
Alan Schmitt  writes:

> Yes. Here it is for review, please let me know if I can apply it.

Be my guest! Thank you.

> I see. I think I’ll just use  then and skip the syntax coloring
> for the moment.

I'm not sure to understand your problem. src_emacs-lisp{(+ 1 1)} should
get syntax coloring in both latex and html back-end.

Regards,



Re: [O] org-pdfview-open doesn't work anymore

2016-02-05 Thread Nicolas Goaziou
Hello,

Michael Brand  writes:

> +  ;; FIXME: Remove this check when most default installations of
> +  ;; Emacs have at least Org 9.0.
> +  (let ((arglist (help-function-arglist cmd)))
> + (when (or (memq ' arglist)
> +   (memq ' arglist)
> +   (/= 2 (length arglist)))
> +   (user-error
> +(format
> + "%s%s%S"
> + "Please see Org News for version 9.0 about `org-file-apps', "
> + "this function signature is wrong: "
> + cmd

I have the feeling there is some over-engineering involved there. 

In any case, instead of relying on `help-function-arglist', I suggest to
use something lightweight:

(condition-case err
(funcall ...)
  (wrong-number-of-arguments
   (user-error "Please ..."))
  (invalid-function
   (user-error "Please ...")))


Regards,

-- 
Nicolas Goaziou



Re: [O] org-pdfview-open doesn't work anymore

2016-02-05 Thread Michael Brand
Hi Julien

On Fri, Feb 5, 2016 at 6:46 AM, Julien Cubizolles  wrote:
> I've been using org-pdfview (from
> https://github.com/markus1189/org-pdfview) to have org-mode open pdf
> files generated during export.
>
> --8<---cut here---start->8---
> (pdf-tools-install)
> (eval-after-load 'org '(progn (require 'org-pdfview)
>   (add-to-list 'org-file-apps '("\\.pdf\\'" . 
> org-pdfview-open))
>   ))
> --8<---cut here---end--->8---
>
> Since a recent upgrade, this fails with:
>
> --8<---cut here---start->8---
> (wrong-number-of-arguments #[(link) "\304\305 \"\2031\306\307 \"\310\306\311 
> \"!\310\306\312 \"!\313\307\"\210\314
> !\210\315\316 \317 @_\320 \245!!+\207\304\321 \"\203N\306\307 \"\310\306\311 
> \"!\313\307\"\210\314
> !*\207\313 \307\"\207" [link path page height string-match 
> "\\(.*\\)::\\([0-9]*\\)\\+\\+\\([[0-9]\\.*[0-9]*\\)" match-string 1 
> string-to-number 2 3 org-open-file pdf-view-goto-page 
> image-set-window-vscroll round pdf-view-image-size frame-char-height 
> "\\(.*\\)::\\([0-9]+\\)$"] 4 
> ("/home/wilk/.emacs.d/elpa/org-pdfview-20160125.1254/org-pdfview.elc" . 662)] 
> 2)
>   
> org-pdfview-open("/home/wilk/enseignement/2015-2016/topos/topo-tipe-beamer.pdf"
>  "/home/wilk/enseignement/2015-2016/topos/topo-tipe-beamer.pdf")
> --8<---cut here---end--->8---
>
> Is it a bug in Org-mode or should I report the issue to the org-pdfview
> author ?

Due to lexical binding in org.el there was a change in
`org-file-apps', see Org News for version 9.0 and e. g. this thread:
http://thread.gmane.org/gmane.emacs.orgmode/104272
I think the most convenient would be if `org-open-file' tries to find
out that `cmd' in this case is a function with only one argument and
call it with just `file'.

@Nicolas: Is this reasonable for you to implement?

Michael



Re: [O] [bug] org fails in org-sparse-tree for date filtering

2016-02-05 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> One way I use to identify what I want to archive is to use
> org-sparse-tree, selecting [b]efore-date.  If I do so, giving for
> instance "1 jan 2015" as the date, I get an error with backtrace in the
> attached file.

Fixed. Thank you.


Regards,

-- 
Nicolas Goaziou



[O] bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert

2016-02-05 Thread Nicolas Goaziou
Hello,

Dima Kogan  writes:

> Ah. Thanks for explaining. The patch helps somewhat, but one can still
> get into an inconsistent state:
>
>   1. Write \(1 + 2\)
>   2. Toggle overlay with C-c C-x C-l
>   3. M-x revert-buffer
>
> After the revert, the overlay remains, which is arguably OK, since the
> text has not changed. However after the revert org doesn't realize that
> the overlay is still up: org-latex-fragment-image-overlays is nil.

Indeed. 

`org-latex-fragment-image-overlays' is a local variable and
`revert-buffer' calls `normal-mode', which, in turn, calls
`fundamental-mode'. The latter calls `kill-all-local-variables'.
Information is lost.

I don't think that `org-latex-fragment-image-overlays' is useful,
anyway. So I removed it, along with that bug, hopefully.

> I think the overlays should all disappear on a revert.

I'm not convinced that an unmodified overlay should disappear.

Thank you for the report.


Regards,

-- 
Nicolas Goaziou





Re: [O] org-pdfview-open doesn't work anymore

2016-02-05 Thread Nicolas Goaziou
Hello,

Michael Brand  writes:

> + ;; FIXME: Remove this check when most default installations of
> + ;; Emacs have at least Org 9.0.
> + ((wrong-number-of-arguments invalid-function)
> +  (user-error
> +   (concat
> +"Please see Org News for version 9.0 about `org-file-apps', "
> +"error: "
> +(prin1-to-string err))

(user-error
 "Please see Org News for version 9.0 about `org-file-apps', error: %S"
 (nth 1 err))

You can use continuation character (i.e., "\" followed by a newline) if
string is too large.

>   ((consp cmd)
>;; FIXME: Remove this check when most default installations of
>;; Emacs have at least Org 9.0.
> @@ -11333,7 +11342,9 @@ If the file does not exist, an error is thrown."
>;; `org-link-frame-setup' for an old usage of `org-file-apps'
>;; with sexp instead of a function for `cmd'.
>(user-error
> -   "Please see Org News for version 9.0 about `org-file-apps'"))
> +   (concat "Please see Org News for version 9.0 about `org-file-apps', "
> +"error: deprecated usage of "
> +(prin1-to-string cmd

Ditto.


Regards,

-- 
Nicolas Goaziou



Re: [O] No image output from Maxima in Babel

2016-02-05 Thread Zachary Peterson
> Thomas S Dye  writes:

> Aloha Zachary, That example works here.

> Do the other maxima examples work for you and only this one fails?

All the other examples work.

-- 
Zachary Peterson
zap5...@psu.edu
(317) 828-2377
OpenPGP key: BF5879D6



Re: [O] What happened to `org-end-of-meta-data-and-drawers'?

2016-02-05 Thread Nicolas Goaziou
Hello,

Thorsten Jolitz  writes:

> Hi List,
> again an Org function I used in one of my libraries has disappeared.
>
> ,
> | org-dp-lib.el:483:1:Warning: the function `org-end-of-meta-data-and-drawers'
> | is not known to be defined.
> `
>
> Two related questions:
>
>  - is there a replacement?

(org-end-of-meta-data t)

>  - using Magit, how can I investigate the fate of such a lost function
>without investing too much time and effort?

You can do a regexp search in commit messages : 

  l =g org-end-of-meta-data

> Another rather unrelated question:
> Byte-compiling files that require package cl, I always get one of two
> errors:
>  - using (require 'cl), I get
>
> ,
> | org-dp.el:172:1:Warning: cl package required at runtime
> `
>
>  - but, when I correctly use (eval-when-compile (require 'cl)), I see
>several of these:
>
> ,
> | org-dp-lib.el:275:40:Warning: function `remove-duplicates' from cl package
> | called at runtime
> `
>
> How to avoid both kinds of warnings? I'm probably not really up-to-date
> here ...

If you plan to base your work off master, you can as well use

  (require 'cl-lib)

Regards,

-- 
Nicolas Goaziou



Re: [O] Strange problems when exporting asynchronously in beamer mode

2016-02-05 Thread Nicolas Goaziou
Hello,

Julien Cubizolles  writes:

> The contents of the
> "/home/wilk/configuration/elisp/org-export-async-init-test.el" file are:
>
> ;;~/.emacs -*- mode: lisp-*-
> (setq org-export-async-debug t)
>
> (add-to-list 'load-path (expand-file-name "~/info/emacs/org-mode/lisp"))
> (add-to-list 'load-path (expand-file-name  
> "~/info/emacs/org-mode/contrib/lisp"))
>
> (require 'org)
> (require 'ox)
>
> Any idea what went wrong ?

You could try adding (require 'ox-beamer) above.

Regards,

-- 
Nicolas Goaziou



[O] What happened to `org-end-of-meta-data-and-drawers'?

2016-02-05 Thread Thorsten Jolitz

Hi List,
again an Org function I used in one of my libraries has disappeared.

,
| org-dp-lib.el:483:1:Warning: the function `org-end-of-meta-data-and-drawers'
| is not known to be defined.
`

Two related questions:

 - is there a replacement?
 - using Magit, how can I investigate the fate of such a lost function
   without investing too much time and effort?

PS
Another rather unrelated question:
Byte-compiling files that require package cl, I always get one of two
errors:
 - using (require 'cl), I get

,
| org-dp.el:172:1:Warning: cl package required at runtime
`

 - but, when I correctly use (eval-when-compile (require 'cl)), I see
   several of these:

,
| org-dp-lib.el:275:40:Warning: function `remove-duplicates' from cl package
| called at runtime
`

How to avoid both kinds of warnings? I'm probably not really up-to-date
here ...

-- 
cheers,
Thorsten





Re: [O] No image output from Maxima in Babel

2016-02-05 Thread Thomas S . Dye
Aloha Zachary,

That example works here.

Do the other maxima examples work for you and only this one fails?

All the best,
Tom

Zachary Peterson  writes:

> Hello,
>
> After recently learning about Babel, I've been working my way through
> some of the examples in the various languages' documentation, and I've
> run into a problem with Maxima. I evaluated this code, taken from the
> documentation at
> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-maxima.html#sec-4-3,
> with only the filename changed:
>
> #+name: 3d-maxima
> #+header: :file maxima-3d.png
> #+header: :exports results
> #+header: :results graphics
> #+begin_src maxima 
>   programmode: false;
>   plot3d(atan(-x^2+y^3/4),[x,-4,4],[y,-4,4],[grid,50,50],[gnuplot_pm3d,true]);
> #+end_src
>
> It returns this:
> #+RESULTS: 3d-maxima
> [[file:maxima-3d.png]]
>
> The file is empty, though.
>
> Running the code from within the Maxima REPL produces the expected
> result.
>
> I'm running Org version 20160201 on GNU Emacs 24.4.1 with Maxima 5.34.1
> on Debian Jessie.
>
> I would appreciate any help. Thanks.


-- 
Thomas S. Dye
http://www.tsdye.com



[O] Problem with threeparttable and sidewaystable, or: change request for (org-latex-tables-centered) behaviour

2016-02-05 Thread Michael Giepen


* Problem with centering sidewaystable and threeparttable

#+LATEX_HEADER: \usepackage{threeparttable}

I am referring myself to an archived post about using "threeparttable" 
with org-mode syntax(!), without having to use a LaTeX code block:

https://lists.gnu.org/archive/html/emacs-orgmode/2013-12/msg00446.html

I am having trouble achieving the following goals:
- booktabs table (just mentioning, do not think that matters)
- threeparttable in org-mode syntax
- floating environment --> place threeparttable inside "table environment"
- table centered! -> here is the problem!


** threeparttable

floating threeparttable example (non-floating would not be a problem):

#+CAPTION: Here goes the caption
#+BEGIN_table
#+BEGIN_threeparttable
| An example of a \tnote{a} | threeparttable | centered table \tnote{c} |
| 1 |  2 |3 |

#+BEGIN_tablenotes
\item[a] To float one has to put threeparttable (TPT) in a table environment
\item[b] With default (org-latex-tables-centered) on TPT gets exportet 
in "center" environment

\item[c] "center" environment and TPT clash, no document export
#+END_tablenotes
#+END_threeparttable
#+END_table

The LaTeX export is: (uses \begin{center}...\end{center}

# ###

\begin{table}[!htpb]
\caption{\label{tab:}
Here goes the caption}
\begin{threeparttable}

\begin{center}
\begin{tabular}{lll}
\toprule
a \tnote{a} & table \tnote{b} & example \tnote{c}\\
\bottomrule
\end{tabular}
\end{center}

\begin{tablenotes}
\item[a] To float one has to put threeparttable (TPT) in a table environment
\item[b] With default (org-latex-tables-centered) on TPT gets exportet 
in "center" environment

\item[c] "center" environment and TPT clash, no document export
\end{tablenotes}
\end{threeparttable}
\end{table}

# ###

The "center environment" within threeparttable does not export!

Just as a comparison a standard table export:

#+CAPTION: Standard table
| Standard | simple | table |

becomes exported to: (uses centering!)

\begin{table}[!htbp]
\caption{Standard table}
\centering
\begin{tabular}{lll}
\toprule
Standard & simple & table\\
\bottomrule
\end{tabular}
\end{table}

If the \centering would also be used for threeparttable or any 
environment, there would be no conflict at all (I think).  I do not 
really understand why why the center environment is used in the first 
place: it apparently causes conflicts with several environments, but in 
effect seems to be no different from the center environment.  I think 
that should be changed to always use centering.


Anyways, my workaround solution, which works nicely so far is:
'org-latex-tables-centered nil
plus adding

#+LATEX_HEADER: \makeatletter
#+LATEX_HEADER: \g@addto@macro\@floatboxreset\centering
#+LATEX_HEADER: \makeatother

so that any float becomes centered.

* sidewaystable
Now, with the threeparttable problem solved, I now get a new problem 
with sidewaystables, which are now left-aligned (bottom of the page) 
with 'org-latex-tables-centered nil.


#+CAPTION: sidewaystable
#+LABEL: tab:sidewaystable
#+ATTR_LATEX: :float sideways
| Some | random | headers | in | sideways | table | with | random | 
content |

|--++-++--+---+--++-|
|  4.0 |0.4 | 1.0 |456 | 5465 |   465 |   65 | 645 
|  46 |
|  4.0 |   0.49 | 654 | 546546 |  654 |   546 |   54 | 654 | 
654 |


To solve this I have tried:

#+BEGIN_center
#+CAPTION: sidewaystable
#+LABEL: tab:sidewaystable
#+ATTR_LATEX: :float sideways
| Some | random | headers | in | sideways | table | with | random | 
content |

|--++-++--+---+--++-|
|  4.0 |0.4 | 1.0 |456 | 5465 |   465 |   65 | 645 
|  46 |
|  4.0 |   0.49 | 654 | 546546 |  654 |   546 |   54 | 654 | 
654 |

#+END_center

--> no effect

#+CAPTION: sidewaystable
#+LABEL: tab:sidewaystable
#+ATTR_LATEX: :float sideways
#+BEGIN_center
| Some | random | headers | in | sideways | table | with | random | 
content |

|--++-++--+---+--++-|
|  4.0 |0.4 | 1.0 |456 | 5465 |   465 |   65 | 645 
|  46 |
|  4.0 |   0.49 | 654 | 546546 |  654 |   546 |   54 | 654 | 
654 |


#+END_center

--> as the table is not "connected to the header the header is not 
considered on export.


and adding

#+ATTR_LATEX: :center
--> no effect on export at all (no center command appears...). I thought 
that this one turns 'org-latex-tables-centered on a float basis...


Nothing works...

One solution would be a workaround for the sidewaystable with the 
'org-latex-tables-centered turned off. Any ideas?


If not,  would it be possible to permanently change "center environment" 
for \centering with the 

Re: [O] org-pdfview-open doesn't work anymore

2016-02-05 Thread Michael Brand
Hi Nicolas

On Fri, Feb 5, 2016 at 6:22 PM, Nicolas Goaziou  wrote:

> Michael Brand  writes:

>> +  ;; FIXME: Remove this check when most default installations of
>> +  ;; Emacs have at least Org 9.0.
>> +  (let ((arglist (help-function-arglist cmd)))
>> + (when (or (memq ' arglist)
>> +   (memq ' arglist)
>> +   (/= 2 (length arglist)))
>> +   (user-error
>> +(format
>> + "%s%s%S"
>> + "Please see Org News for version 9.0 about `org-file-apps', "
>> + "this function signature is wrong: "
>> + cmd
>
> I have the feeling there is some over-engineering involved there.

Also it should have allowed at least optional arguments

(when (or (memq
   ;; Too complicated to parse regarding that such functions
   ;; are probably not useful here.
   '
   arglist)
  (/= 2 (length (delete ' arglist
  (user-error

for e. g. a simple

(add-to-list 'org-file-apps
 (cons (concat org-player-file-extensions-regexp "$")
   'org-player-play-file))

which refers to the existing

(defun org-player-play-file (filename  pos)

> In any case, instead of relying on `help-function-arglist', I suggest to
> use something lightweight:
>
> (condition-case err
> (funcall ...)
>   (wrong-number-of-arguments
>(user-error "Please ..."))
>   (invalid-function
>(user-error "Please ...")))

Of course. I didn't know about this possibility, remixed patch attached.

Michael
From f1c382cabe5b34f52db22df70d5c25e02de2a18a Mon Sep 17 00:00:00 2001
From: Michael Brand 
Date: Fri, 5 Feb 2016 19:42:55 +0100
Subject: [PATCH] `org-file-apps' add migration hint for function signature

* lisp/org.el (org-open-file): Add an error when the function
signature does not match.
---
 lisp/org.el | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index d4fb8a6..f6c5f89 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11323,9 +11323,18 @@ If the file does not exist, an error is thrown."
 		  (when (derived-mode-p 'org-mode) (org-reveal)))
 	(search (org-link-search search
  ((functionp cmd)
-  (save-match-data
-	(set-match-data link-match-data)
-	(funcall cmd file link)))
+  (condition-case err
+	  (save-match-data
+	(set-match-data link-match-data)
+	(funcall cmd file link))
+	;; FIXME: Remove this check when most default installations of
+	;; Emacs have at least Org 9.0.
+	((wrong-number-of-arguments invalid-function)
+	 (user-error
+	  (concat
+	   "Please see Org News for version 9.0 about `org-file-apps', "
+	   "error: "
+	   (prin1-to-string err))
  ((consp cmd)
   ;; FIXME: Remove this check when most default installations of
   ;; Emacs have at least Org 9.0.
@@ -11333,7 +11342,9 @@ If the file does not exist, an error is thrown."
   ;; `org-link-frame-setup' for an old usage of `org-file-apps'
   ;; with sexp instead of a function for `cmd'.
   (user-error
-   "Please see Org News for version 9.0 about `org-file-apps'"))
+   (concat "Please see Org News for version 9.0 about `org-file-apps', "
+	   "error: deprecated usage of "
+	   (prin1-to-string cmd
  (t (funcall (cdr (assq 'file org-link-frame-setup)) file)))
 (and (derived-mode-p 'org-mode)
 	 (eq old-mode 'org-mode)
-- 
2.1.3.dirty



[O] Custom agenda 'tags-todo' sorting by scheduled date not working

2016-02-05 Thread Gabriel Duven

Hi guys,

I created a custom agenda view with tags-todo, which I like to sort by 
scheduled date.


(add-to-list 'org-agenda-custom-commands
  '("u" "Next actions" tags-todo "+PRIORITY=\"A\""
 ((org-agenda-overriding-header "Critical")
  (org-agenda-prefix-format " %-5:c")
  (org-agenda-sorting-strategy '(scheduled-down))
  (org-agenda-todo-ignore-scheduled 'future)
  (org-agenda-tags-todo-honor-ignore-options t)))
)

But sorting comes out wrong: It's not sorted by the scheduled date. In 
fact, it's not sorted at all, but seems to keep order of 
org-agenda-files.


Anybody help? Thanks a lot in advace!! Orgmode is great :)




[O] inline code and minted

2016-02-05 Thread Alan Schmitt
Hello,

I see that

src_coq[:exports code]{nat}

exports to (latex export with minted)

\mint{coq}~nat~

which does not work as inline code here. The following would work,
however, with a recent minted:

\mintinline{coq}{nat}

I have two questions:
- should we support this and generate this code?
- in the meantime, I created a macro that does this for latex, but it
does not work for html (it exports the “src_coq” string verbatim):
#+macro: coq @@latex:\mintinline{coq}{$1}html:src_coq[:exports code]{$1}@@
Why is this macro wrong?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated February 4, 2016, Mauna Loa Obs.): 403.08 ppm


signature.asc
Description: PGP signature


Re: [O] Org + MS DOC

2016-02-05 Thread Eric S Fraga
Ken,

lately, for the few luckily infrequent times that I need to share a
document with a Word user, I have found that exporting to ODT is
sufficient.  ODT documents can be loaded in (recent?) versions of MS
Office although the latter complains that the document is corrupt but is
able to "fix" it...  Equations, in particular, come through as well as I
could expect.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3.3-531-g8003ef



[O] [bug] org fails in org-sparse-tree for date filtering

2016-02-05 Thread Eric S Fraga
Hello,

it's that time of year where I remove (i.e. archive) old entries in my
various agenda files.

One way I use to identify what I want to archive is to use
org-sparse-tree, selecting [b]efore-date.  If I do so, giving for
instance "1 jan 2015" as the date, I get an error with backtrace in the
attached file.

Org is up to date from git.

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3.3-548-g99697a
Debugger entered--Lisp error: (void-variable d)
  (org-time-string-to-time d)
  (time-less-p (org-time-string-to-time match) (org-time-string-to-time d))
  (and (org-at-planning-p) (time-less-p (org-time-string-to-time match) 
(org-time-string-to-time d)))
  (let ((match (match-string 1))) (and (org-at-planning-p) (time-less-p 
(org-time-string-to-time match) (org-time-string-to-time d
  (lambda nil (let ((match (match-string 1))) (and (org-at-planning-p) 
(time-less-p (org-time-string-to-time match) (org-time-string-to-time d)()
  funcall((lambda nil (let ((match (match-string 1))) (and (org-at-planning-p) 
(time-less-p (org-time-string-to-time match) (org-time-string-to-time d))
  (progn (funcall callback))
  (unwind-protect (progn (funcall callback)) (set-match-data 
save-match-data-internal (quote evaporate)))
  (let ((save-match-data-internal (match-data))) (unwind-protect (progn 
(funcall callback)) (set-match-data save-match-data-internal (quote 
evaporate
  (or (not callback) (let ((save-match-data-internal (match-data))) 
(unwind-protect (progn (funcall callback)) (set-match-data 
save-match-data-internal (quote evaporate)
  (if (or (not callback) (let ((save-match-data-internal (match-data))) 
(unwind-protect (progn (funcall callback)) (set-match-data 
save-match-data-internal (quote evaporate) (progn (setq cnt (1+ cnt)) (if 
org-highlight-sparse-tree-matches (progn (org-highlight-new-match 
(match-beginning 0) (match-end 0 (org-show-context (quote occur-tree
  (while (re-search-forward regexp nil t) (backward-char) (if (or (not 
callback) (let ((save-match-data-internal (match-data))) (unwind-protect (progn 
(funcall callback)) (set-match-data save-match-data-internal (quote 
evaporate) (progn (setq cnt (1+ cnt)) (if org-highlight-sparse-tree-matches 
(progn (org-highlight-new-match (match-beginning 0) (match-end 0 
(org-show-context (quote occur-tree)
  (save-excursion (goto-char (point-min)) (if (or (not keep-previous) (not 
org-occur-highlights)) (progn (org-overview))) (while (re-search-forward regexp 
nil t) (backward-char) (if (or (not callback) (let ((save-match-data-internal 
(match-data))) (unwind-protect (progn (funcall callback)) (set-match-data 
save-match-data-internal (quote evaporate) (progn (setq cnt (1+ cnt)) (if 
org-highlight-sparse-tree-matches (progn (org-highlight-new-match 
(match-beginning 0) (match-end 0 (org-show-context (quote occur-tree))
  (let ((cnt 0)) (save-excursion (goto-char (point-min)) (if (or (not 
keep-previous) (not org-occur-highlights)) (progn (org-overview))) (while 
(re-search-forward regexp nil t) (backward-char) (if (or (not callback) (let 
((save-match-data-internal ...)) (unwind-protect (progn ...) (set-match-data 
save-match-data-internal ... (progn (setq cnt (1+ cnt)) (if 
org-highlight-sparse-tree-matches (progn (org-highlight-new-match ... ...))) 
(org-show-context (quote occur-tree)) (if org-remove-highlights-with-change 
(progn (org-add-hook (quote before-change-functions) (quote 
org-remove-occur-highlights) nil (quote local (if 
org-sparse-tree-open-archived-trees nil (org-hide-archived-subtrees (point-min) 
(point-max))) (run-hooks (quote org-occur-hook)) (if (with-no-warnings 
(called-interactively-p (quote interactive))) (progn (message "%d match(es) for 
regexp %s" cnt regexp))) cnt)
  org-occur("\\<\\(?:\\(?:DEADLINE\\|SCHEDULED\\):\\) *<\\([^>]+\\)>" nil 
(lambda nil (let ((match (match-string 1))) (and (org-at-planning-p) 
(time-less-p (org-time-string-to-time match) (org-time-string-to-time d))
  (message "%d entries before %s" (org-occur regexp nil callback) d)
  (let ((case-fold-search nil) (regexp (org-re-timestamp org-ts-type)) 
(callback (list (quote lambda) nil (list (quote let) (quote ((match ...))) 
(cons (quote and) (cons (if ... ... ...) (quote ...))) (message "%d entries 
before %s" (org-occur regexp nil callback) d))
  org-check-before-date("2015-01-01")
  funcall-interactively(org-check-before-date "2015-01-01")
  call-interactively(org-check-before-date)
  (cond ((eql answer (quote 99)) (org-sparse-tree arg (car (cdr (memq type 
(quote (nil all scheduled deadline active inactive closed))) ((eql answer 
(quote 100)) (call-interactively (quote org-check-deadlines))) ((eql answer 
(quote 98)) (call-interactively (quote org-check-before-date))) ((eql answer 
(quote 97)) (call-interactively (quote org-check-after-date))) ((eql answer 
(quote 68)) (call-interactively (quote org-check-dates-range))) ((eql answer 

Re: [O] automatically save org-index after it changes?

2016-02-05 Thread Alan Schmitt
On 2016-02-04 11:35, Nick Dokos  writes:

> Alan Schmitt  writes:
>
>
>> Each time I use org-index to jump to some headline, the file where the
>> table lives is modified. Is there a way to automatically save the file
>> after each such change?
>>
>
> Does something *really* change or is the file marked modified with no
> other visible change? If the lattter, it's probably a bug.

Something does change: the jumping count.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated February 3, 2016, Mauna Loa Obs.): 402.43 ppm


signature.asc
Description: PGP signature


Re: [O] Again - Unable to filter agenda to show only non-tagged items

2016-02-05 Thread sgeorgii .
Sorry, with the latest org 20160201 there is still error when I try to
filter org-agenda view with empty tag value:

org-agenda-filter-make-matcher: Args out of range: "", 0, 1


Any chance this could be remedied?



bug report follows just in case:

In GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/usr --host=i686-pc-mingw32'

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1251

Major mode: Org-Agenda Week Ddl Grid

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Press key for agenda command (unrestricted):
Filter by tag [ ], [TAB], [/]:off, [+/-]:filter/exclude, [q]:quit
org-agenda-filter-make-matcher: Args out of range: "", 0, 1

Load-path shadows:
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox-texinfo
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox-texinfo
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox-publish
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox-publish
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox-org hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox-org
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox-odt hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox-odt
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox-md hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox-md
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox-man hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox-man
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox-latex
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox-latex
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox-icalendar
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox-icalendar
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox-html hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox-html
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox-beamer
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox-beamer
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/ox-ascii
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/ox-ascii
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/org hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/org
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/org-w3m hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/org-w3m
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/org-version
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/org-version
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/org-timer
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/org-timer
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/org-table
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/org-table
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/org-src hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/org-src
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/org-rmail
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/org-rmail
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/org-protocol
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/org-protocol
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/org-plot
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/org-plot
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/org-pcomplete
hides
c:/Users/spbsokolg/Desktop/emacs-24.5-bin-i686-mingw32/share/emacs/24.5/lisp/org/org-pcomplete
c:/Users/spbsokolg/AppData/Roaming/.emacs.d/elpa/org-20160201/org-mouse
hides

[O] zip for odt export under windows

2016-02-05 Thread scrawler
Hi guys,

I need to use the odt exporter on a windows box, and i read in an archived post 
that I need to install infozip. Infozip seems to be unavailable. How have 
others configured for export?

thanks!
-- 
signature to baby: "doobywoobybooboo"
:-)



Re: [O] Columnview *** is exported as *

2016-02-05 Thread Michael Brand
Hi Nicolas

Commit release_8.3.3-547-g00f0c70 does not respect the stars of ITEM
any more for the dynamic column width of the interactive column view
with overlays. The fix of org-columns-get-autowidth-alist for the two
"(setq-local org-columns-current-maxwidths [...]" seems too
complicated to do it myself.

The MCE

--
* Column view
*** Subsection
* Subsubsection
* File config :ARCHIVE:
  #+COLUMNS: %ITEM
  #+STARTUP: odd showall
--

changes the looking from

--
ITEM|
* Column view   |
*** Subsection  |
* Subsubsection |
* File config :ARCHIVE:...
--

to

--
ITEM  |
* Column view |
*** Subsect.. |
* Subsu.. |
* File config :ARCHIVE:...
--

Michael



Re: [O] references to arbitrary labels in org and export to latex

2016-02-05 Thread Kaushal Modi
Check out this emacs.SE QnA: http://emacs.stackexchange.com/q/594/115

With that solution I can neatly collect all the links at the bottom of the
org document, using markdown style link references.

That still would not give the bibliography style link references at the end
of the exported document that you are looking for.

--
Kaushal Modi


Re: [O] automatically save org-index after it changes?

2016-02-05 Thread Alan Schmitt
Hello,

On 2016-02-04 13:42, Alan Schmitt  writes:

> Each time I use org-index to jump to some headline, the file where the
> table lives is modified. Is there a way to automatically save the file
> after each such change?

The solution I’ve found is not org specific, but it may still be of
interest here. I looked into how autosave work, and I can tweak it for
that particular file using:

# -*- auto-save-visited-file-name: t; -*-

This way the file is autosaved (for instance when emacs is idle) as if
it was really saved (and not in another file).

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated February 4, 2016, Mauna Loa Obs.): 403.08 ppm


signature.asc
Description: PGP signature


Re: [O] inline code and minted

2016-02-05 Thread Nicolas Goaziou
Hello,

Alan Schmitt  writes:

> Hello,
>
> I see that
>
> src_coq[:exports code]{nat}
>
> exports to (latex export with minted)
>
> \mint{coq}~nat~
>
> which does not work as inline code here. The following would work,
> however, with a recent minted:
>
> \mintinline{coq}{nat}
>
> I have two questions:
> - should we support this and generate this code?

Sure. Could you provide and apply a patch for that?

> - in the meantime, I created a macro that does this for latex, but it
> does not work for html (it exports the “src_coq” string verbatim):
> #+macro: coq @@latex:\mintinline{coq}{$1}html:src_coq[:exports code]{$1}@@
> Why is this macro wrong?

Contents of an export snippet, e.g. @@html:...@@ are not evaluated by
the back-end. IOW this is back-end code.


Regards,

-- 
Nicolas Goaziou



Re: [O] org-pdfview-open doesn't work anymore

2016-02-05 Thread Nicolas Goaziou
Hello,

Michael Brand  writes:

> Hi Julien
>
> On Fri, Feb 5, 2016 at 6:46 AM, Julien Cubizolles  
> wrote:
>> I've been using org-pdfview (from
>> https://github.com/markus1189/org-pdfview) to have org-mode open pdf
>> files generated during export.
>>
>> --8<---cut here---start->8---
>> (pdf-tools-install)
>> (eval-after-load 'org '(progn (require 'org-pdfview)
>>   (add-to-list 'org-file-apps '("\\.pdf\\'" . 
>> org-pdfview-open))
>>   ))
>> --8<---cut here---end--->8---
>>
>> Since a recent upgrade, this fails with:
>>
>> --8<---cut here---start->8---
>> (wrong-number-of-arguments #[(link) "\304\305 \"\2031\306\307 \"\310\306\311 
>> \"!\310\306\312 \"!\313\307\"\210\314
>> !\210\315\316 \317 @_\320 \245!!+\207\304\321 \"\203N\306\307 \"\310\306\311 
>> \"!\313\307\"\210\314
>> !*\207\313 \307\"\207" [link path page height string-match 
>> "\\(.*\\)::\\([0-9]*\\)\\+\\+\\([[0-9]\\.*[0-9]*\\)" match-string 1 
>> string-to-number 2 3 org-open-file pdf-view-goto-page 
>> image-set-window-vscroll round pdf-view-image-size frame-char-height 
>> "\\(.*\\)::\\([0-9]+\\)$"] 4 
>> ("/home/wilk/.emacs.d/elpa/org-pdfview-20160125.1254/org-pdfview.elc" . 
>> 662)] 2)
>>   
>> org-pdfview-open("/home/wilk/enseignement/2015-2016/topos/topo-tipe-beamer.pdf"
>>  "/home/wilk/enseignement/2015-2016/topos/topo-tipe-beamer.pdf")
>> --8<---cut here---end--->8---
>>
>> Is it a bug in Org-mode or should I report the issue to the org-pdfview
>> author ?
>
> Due to lexical binding in org.el there was a change in
> `org-file-apps', see Org News for version 9.0 and e. g. this thread:
> http://thread.gmane.org/gmane.emacs.orgmode/104272
> I think the most convenient would be if `org-open-file' tries to find
> out that `cmd' in this case is a function with only one argument and
> call it with just `file'.
>
> @Nicolas: Is this reasonable for you to implement?

I think the simplest solution may be to follow the advice in ORG-NEWS
and use

  (lambda (file link) (org-pdfview-open file))


Regards,

-- 
Nicolas Goaziou



Re: [O] references to arbitrary labels in org and export to latex

2016-02-05 Thread John Kitchin
Could you use footnotes for this?

Kaushal Modi writes:

> Check out this emacs.SE QnA: http://emacs.stackexchange.com/q/594/115
>
> With that solution I can neatly collect all the links at the bottom of the
> org document, using markdown style link references.
>
> That still would not give the bibliography style link references at the end
> of the exported document that you are looking for.


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] org-pdfview-open doesn't work anymore

2016-02-05 Thread Michael Brand
Hi Nicolas

On Fri, Feb 5, 2016 at 9:33 AM, Michael Brand
 wrote:

> Due to lexical binding in org.el there was a change in
> `org-file-apps', see Org News for version 9.0 and e. g. this thread:
> http://thread.gmane.org/gmane.emacs.orgmode/104272
> I think the most convenient would be if `org-open-file' tries to find
> out that `cmd' in this case is a function with only one argument and
> call it with just `file'.

Only after a closer look I saw that the single parameter of
`org-pdfview-open' is not `file' but `link'. It is probably better for
`org-open-file' to not guess in case of `cmd' with a single parameter
whether it is meant to be `file' or `link'. That leads me to suggest
the attached patch to be reviewed that checks the function signature.

Michael
From 9788cb03d2714cde555fbe2abb55ddd383a885c1 Mon Sep 17 00:00:00 2001
From: Michael Brand 
Date: Fri, 5 Feb 2016 14:44:26 +0100
Subject: [PATCH] `org-file-apps' add migration hint for function signature

* lisp/org.el (org-open-file): Add an error when the function
signature does not match.
---
 lisp/org.el | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 5a6c74e..9ebabf8 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11323,6 +11323,18 @@ If the file does not exist, an error is thrown."
 		  (when (derived-mode-p 'org-mode) (org-reveal)))
 	(search (org-link-search search
  ((functionp cmd)
+  ;; FIXME: Remove this check when most default installations of
+  ;; Emacs have at least Org 9.0.
+  (let ((arglist (help-function-arglist cmd)))
+	(when (or (memq ' arglist)
+		  (memq ' arglist)
+		  (/= 2 (length arglist)))
+	  (user-error
+	   (format
+	"%s%s%S"
+	"Please see Org News for version 9.0 about `org-file-apps', "
+	"this function signature is wrong: "
+	cmd
   (save-match-data
 	(set-match-data link-match-data)
 	(funcall cmd file link)))
@@ -11333,7 +11345,10 @@ If the file does not exist, an error is thrown."
   ;; `org-link-frame-setup' for an old usage of `org-file-apps'
   ;; with sexp instead of a function for `cmd'.
   (user-error
-   "Please see Org News for version 9.0 about `org-file-apps'"))
+   (format "%s%s%S"
+	   "Please see Org News for version 9.0 about `org-file-apps', "
+	   "this usage is wrong: "
+	   cmd)))
  (t (funcall (cdr (assq 'file org-link-frame-setup)) file)))
 (and (derived-mode-p 'org-mode)
 	 (eq old-mode 'org-mode)
-- 
2.1.3.dirty



Re: [O] references to arbitrary labels in org and export to latex

2016-02-05 Thread Christian Wittern
Hi Loris,

On 2016-02-03 16:50, Loris Bennett wrote:
> This was discussed in the following thread:
> 
> https://lists.gnu.org/archive/html/emacs-orgmode/2015-02/msg00382.html
> 
> It seems you can't use 'url:mandoku-en' because of the colon, so you
> would have to use something like 'url;mandoku-en' instead.
Yes, right, but it seems I still do not get the numbering I would like to
have, so I guess I will have to go with the Bibtex route after all.
Thanks anyway.

Christian

-- 
Christian Wittern, Kyoto



[O] Default location for "./" with respect to capture file+headline

2016-02-05 Thread John Hendy
Greetings,


I'm trying to show an Org-mode demo within a folder for a talk. I
can't show my actual work stuff as it's confidential, so I'm trying to
create a self-contained org directory.

I have a dir with a setup like so:

dir/
dir/setup/example-config
dir/libs/{org-mode, ESS, others}
dir/demo/demo-file.org

I'm loading emacs like this (after cd-ing to dir)

emacs -q -l setup/example-config

It's loading org-mode from the ./libs directory (vs. ~/.elisp) and the
first line is:

(cd "/path/to/dir/")

When I do =C-c c= to try a capture example, it's trying to file it
with respect to ~/org and I'm not sure why. Here's the capture section
of dir/setup/example-config:

(setq org-capture-templates
  '(("l" "log" entry (file+headline "./demo/org-demo_capture.org" "Log")
 "* %? \n%u " :clock-in t :clock-resume t)
("t" "task" entry (file+headline "./demo/org-demo_article.org" "Tasks")
 "* todo %? %^g\n%u" :prepend t)
("c" "clock" entry (file+datetree "./demo/org-demo_clocking.org")
 "* %?\n%u" :clock-in t :clock-keep t)))

The capture buffer wants to create the directory ~/org/demo.

Thanks for any pointers!


John



Re: [O] No image output from Maxima in Babel

2016-02-05 Thread Thomas S . Dye
Hmmm.  I don't know.  Perhaps someone else will have an idea.  The
example works fine on my Mac.

Tom

Zachary Peterson  writes:

>> Thomas S Dye  writes:
>
>> Aloha Zachary, That example works here.
>
>> Do the other maxima examples work for you and only this one fails?
>
> All the other examples work.


-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] What happened to `org-end-of-meta-data-and-drawers'?

2016-02-05 Thread Thorsten Jolitz
Nicolas Goaziou  writes:

Hello,

> Thorsten Jolitz  writes:
>
>> Hi List,
>> again an Org function I used in one of my libraries has disappeared.
>>
>> ,
>> | org-dp-lib.el:483:1:Warning: the function
>> | `org-end-of-meta-data-and-drawers'
>> | is not known to be defined.
>> `
>>
>> Two related questions:
>>
>>  - is there a replacement?
>
> (org-end-of-meta-data t)

Ok, thanks!

>>  - using Magit, how can I investigate the fate of such a lost function
>>without investing too much time and effort?
>
> You can do a regexp search in commit messages : 
>
>   l =g org-end-of-meta-data

Cool, thanks again.

>> Another rather unrelated question:
>> Byte-compiling files that require package cl, I always get one of two
>> errors:
>>  - using (require 'cl), I get
>>
>> ,
>> | org-dp.el:172:1:Warning: cl package required at runtime
>> `
>>
>>  - but, when I correctly use (eval-when-compile (require 'cl)), I see
>>several of these:
>>
>> ,
>> | org-dp-lib.el:275:40:Warning: function `remove-duplicates' from cl
>> | package
>> | called at runtime
>> `
>>
>> How to avoid both kinds of warnings? I'm probably not really up-to-date
>> here ...
>
> If you plan to base your work off master, you can as well use
>
>   (require 'cl-lib)

Not sure if I understand what "base your work off master" refers to, but
I'll try cl-lib, probably less hassle than cl.

-- 
cheers,
Thorsten




[O] Subtree export problems

2016-02-05 Thread Thomas S . Dye
Aloha all,

The following ECM gives me two problems.

1) When I export the full file, all is well, I get this pertinent part:

,--
| \section{Top Level Headline} 
| \label{sec:orgheadline2} 
| \setmarginnotefont{\itshape\footnotesize}
|  
| \subsection{Second Level Headline}   
| \label{sec:orgheadline1} 
|  
| \setmarginnotefont{\itshape\footnotesize}
`--

However, when I attempt to export the Second Level Headline subtree, I
get this pertinent part:

,
| \setmarginnotefont{nil}
`

2) Subtree export doesn't work when the Second Level Headline is
followed on the next line by the #+header: line (with no empty line or
some text between them).  I'm left in the *Org Export Dispatcher*, where
I can get out with C-g.

Org-mode version 8.3.3 (release_8.3.3-449-gd85ff3 @
/Users/dk/.emacs.d/src/org-mode/lisp/)

Here is the ECM:

#+MARGIN-NOTE-FONT: \itshape\footnotesize
#+SELECT_TAGS: export
#+EXCLUDE_TAGS: noexport

* Top Level Headline
#+header: :var marginnote-font=(jk-org-kwd "MARGIN-NOTE-FONT")
#+header: :results raw :exports results
#+begin_src emacs-lisp
(format "\\setmarginnotefont{%s}" marginnote-font)
#+end_src

** Second Level Headline
#+header: :var marginnote-font=(jk-org-kwd "MARGIN-NOTE-FONT")
#+header: :results raw :exports results
#+begin_src emacs-lisp
(format "\\setmarginnotefont{%s}" marginnote-font)
#+end_src

* Access keyword values:noexport:

#+name: jk-keywords
#+header: :results silent
#+begin_src emacs-lisp
(defun jk-org-kwds ()
  "parse the buffer and return a cons list of (property . value)
from lines like: #+PROPERTY: value"
  (org-element-map (org-element-parse-buffer 'element) '(keyword node-property)
   (lambda (keyword) (cons (org-element-property :key keyword)
   (org-element-property :value 
keyword)

(defun jk-org-kwd (KEYWORD)
  "get the value of a KEYWORD in the form of #+KEYWORD: value"
  (cdr (assoc KEYWORD (jk-org-kwds
#+end_src



-- 
Thomas S. Dye
http://www.tsdye.com



[O] using pdf as output of src-block doesn't show an inline image

2016-02-05 Thread Arun Persaud
Hi

I use org mode more and more to plot data using python source blocks. If
I create pngs, org mode will display these results as an inline image,
which is nice. Since I also export my org buffer via latex to pdf, it
would be nice to create pdf plots with python, so that I get vector
graphics in the pdf. This is easy to do in python's matplotlib, but once
I change to pdf output, the images don't get displayed inline in
org-mode anymore :( instead, I just get a file: link.

I had a quick look, but can't figure out how to enable this. Should be
relatively easy I would think, since emacs already can display pdfs and
right-clicking on the file: link will open a new frame with the
pdf. Is there any reason not to display them inline?

The closest I found is:
http://stackoverflow.com/questions/15407485/inline-pdf-images-in-org-mode

If it is not that easy, is there a way to run a pre-export and
post-export hook that changes my *.png files to *pdf before the export
and then changes them back to *.png after the export?

Here is a test file



#+STARTUP: inlineimages

* test

#+NAME: checkfilename
#+HEADER: :var fileout="test--checkfilename.pdf"
#+BEGIN_SRC python :session :results file
import numpy as np
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
X = np.linspace(1, 10)
Y = np.sin(X)
ax.plot(X, Y)
fig.savefig(fileout)
plt.close(fig)
fileout
#+END_SRC

-

to create a png, just replace the .pdf in the HEADER with .png


this uses ipython and cpaste
---

; use ipython in org mode
(setq org-babel-python-command "ipython3 --no-banner --classic
--no-confirm-exit")

; use %cpaste to paste code into ipython in org mode
(defadvice org-babel-python-evaluate-session
  (before org-python-use-cpaste
  (session body  result-type result-params) activate)
  "Add a %cpaste and '--' to the body, so that ipython does the right
thing."
  (setq body (concat "%cpaste -q\n" body "\n--")))

---

Arun



Re: [O] Default location for "./" with respect to capture file+headline

2016-02-05 Thread Kyle Meyer
Hello,

John Hendy  writes:

> When I do =C-c c= to try a capture example, it's trying to file it
> with respect to ~/org and I'm not sure why. Here's the capture section
> of dir/setup/example-config:
>
> (setq org-capture-templates
>   '(("l" "log" entry (file+headline "./demo/org-demo_capture.org" "Log")
>  "* %? \n%u " :clock-in t :clock-resume t)
> ("t" "task" entry (file+headline "./demo/org-demo_article.org" "Tasks")
>  "* todo %? %^g\n%u" :prepend t)
> ("c" "clock" entry (file+datetree "./demo/org-demo_clocking.org")
>  "* %?\n%u" :clock-in t :clock-keep t)))
>
> The capture buffer wants to create the directory ~/org/demo.

The variable org-directory affects this:

--8<---cut here---start->8---
Documentation:
Directory with Org files.
This is just a default location to look for Org files.  There is no need
at all to put your files into this directory.  It is used in the
following situations:

1. When a capture template specifies a target file that is not an
   absolute path.  The path will then be interpreted relative to
   ‘org-directory’
2. When the value of variable ‘org-agenda-files’ is a single file, any
   relative paths in this file will be taken as relative to
   ‘org-directory’.
--8<---cut here---end--->8---

-- 
Kyle