Re: [O] [PATCH] noweb documentation update

2017-06-22 Thread Nicolas Goaziou
Kaushal Modi  writes:

> OK to push this after that change?

Sure, go ahead. Thank you.

Regards,



Re: [O] Status line change?

2017-06-22 Thread Kyle Meyer
Kyle Meyer  writes:

> That change seems to have unintentionally reversed the visibility check,
> which should be
>
> -- >8 --
> diff --git a/lisp/org.el b/lisp/org.el
> index 1e6d00973..d9b6489ff 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -12681,7 +12681,7 @@ (defun org-todo ( arg)
>   (replace-match next t t)
>   (cond ((equal this org-state)
>  (message "TODO state was already %s" (org-trim next)))
> -   ((pos-visible-in-window-p hl-pos)
> +   ((not (pos-visible-in-window-p hl-pos))
>  (message "TODO state changed to %s" (org-trim next
>   (unless head
> (setq head (org-get-todo-sequence-head org-state)

Pushed (1930a8f05ac3c09b6366491c076a3efde2f2205d).

-- 
Kyle



Re: [O] Status line change?

2017-06-22 Thread Kyle Meyer
Russell Adams  writes:

> On Thu, Jun 22, 2017 at 08:27:41PM -0400, Kyle Meyer wrote:

>> Testing with 9.0.5 and 9.0.9, I see a "TODO state changed to DONE"
>> message in the echo area, which I think is what you're referring to.
>> Not sure what the issue would be.  You could check if you see the
>> message in your *Messages* buffer.  If you do, then a subsequent message
>> is may be masking it.  You could also debug org-todo to verify that the
>> "(message "TODO state changed to %s" (org-trim next))" line is being
>> executed.
>
> I just tested it again, and the key is if the headline is on the screen I see 
> a status message. If the headline is off
> screen there is no update on the status line. That's why it's an annoyance, I 
> have to scroll back several screens to
> confirm it changes to DONE.

I see.  With the headline off the screen, I can reproduce this.  I've
bisected it down to dd17e9d29 (org.el (org-todo): When changing from one
state to the same state, throw a more accurate message, 2014-05-31).

That change seems to have unintentionally reversed the visibility check,
which should be

-- >8 --
diff --git a/lisp/org.el b/lisp/org.el
index 1e6d00973..d9b6489ff 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12681,7 +12681,7 @@ (defun org-todo ( arg)
(replace-match next t t)
(cond ((equal this org-state)
   (message "TODO state was already %s" (org-trim next)))
- ((pos-visible-in-window-p hl-pos)
+ ((not (pos-visible-in-window-p hl-pos))
   (message "TODO state changed to %s" (org-trim next
(unless head
  (setq head (org-get-todo-sequence-head org-state)



Re: [O] Status line change?

2017-06-22 Thread Russell Adams
On Thu, Jun 22, 2017 at 08:27:41PM -0400, Kyle Meyer wrote:
> Russell Adams  writes:
>
> > Since I recently upgraded my Org from an ancient v7 to 9.0.5, I noticed 
> > that when I use C-c C-t to change a headline to
> > DONE that I no longer see a message on the status bar indicating it was 
> > changed. The lack of feedback makes me often go
> > up to the headline to confirm that it changed.
>
> Testing with 9.0.5 and 9.0.9, I see a "TODO state changed to DONE"
> message in the echo area, which I think is what you're referring to.
> Not sure what the issue would be.  You could check if you see the
> message in your *Messages* buffer.  If you do, then a subsequent message
> is may be masking it.  You could also debug org-todo to verify that the
> "(message "TODO state changed to %s" (org-trim next))" line is being
> executed.

I just tested it again, and the key is if the headline is on the screen I see a 
status message. If the headline is off
screen there is no update on the status line. That's why it's an annoyance, I 
have to scroll back several screens to
confirm it changes to DONE.


--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: [O] Status line change?

2017-06-22 Thread Kyle Meyer
Russell Adams  writes:

> Since I recently upgraded my Org from an ancient v7 to 9.0.5, I noticed that 
> when I use C-c C-t to change a headline to
> DONE that I no longer see a message on the status bar indicating it was 
> changed. The lack of feedback makes me often go
> up to the headline to confirm that it changed.

Testing with 9.0.5 and 9.0.9, I see a "TODO state changed to DONE"
message in the echo area, which I think is what you're referring to.
Not sure what the issue would be.  You could check if you see the
message in your *Messages* buffer.  If you do, then a subsequent message
is may be masking it.  You could also debug org-todo to verify that the
"(message "TODO state changed to %s" (org-trim next))" line is being
executed.

-- 
Kyle



[O] Status line change?

2017-06-22 Thread Russell Adams
Since I recently upgraded my Org from an ancient v7 to 9.0.5, I noticed that 
when I use C-c C-t to change a headline to
DONE that I no longer see a message on the status bar indicating it was 
changed. The lack of feedback makes me often go
up to the headline to confirm that it changed.

I couldn't find a customization item through a casual search.

Can anyone tell me how to enable that behavior again? Getting feedback on the 
headline state change is important.

Thanks.

--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



[O] :noweb from external file

2017-06-22 Thread edgar

Hello,

I would like to know if someone knows how I can achieve something
like this (importing a block of code from another file):

Definition of the original code:

../dir1/file1.org
==
#+NAME: py-numpy
#+CAPTION: Loading Numpy and Matplotlib onto Python.
#+BEGIN_SRC python :results none
import numpy as np
from matplotlib import pyplot as pl
#+END_SRC
==


I would like something like this:

../dir2/file2.org
==
#+NAME: py-noweb
#+CAPTION: Loading Numpy and Matplotlib onto Python.
#+BEGIN_SRC python :results none :noweb yes
<<../dir1/file1.org::py-numpy>>
#+END_SRC
==


Right now, I can only do it like this:

../dir2/file3.org
==
#+INCLUDE: ../dir1/file1.org::py-numpy
#+NAME: py-noweb
#+CAPTION: Loading Numpy and Matplotlib onto Python.
#+BEGIN_SRC python :results none :noweb yes
<>
#+END_SRC
==

I know that there is Library of Babel, but I don't know
how to use it (I installed it through ELPA). The documentation
mentions a ~doc~ directory, but I don't have such a directory in
~/.emacs.d/elpa/org-*/. Besides, it may be that I don't always
want to store my functions in the library.

Thanks!

-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: [O] [PATCH] noweb documentation update

2017-06-22 Thread Kaushal Modi
On Thu, Jun 22, 2017 at 3:58 PM Nicolas Goaziou 
wrote:

> > A quick update.. the attached patch has minor formatting fixes over the
> > previous one.
>
> Thank you. It looks good.
>
> However, I think we can write Noweb, i.e., without quotes, like Emacs,
> Org or MobileOrg. Quotes impedes reading process, IMO.
>
> WDYT?
>

> Or would replacing all occurrences of ``noweb'' and noweb with Noweb be
better?

Exactly! :)


OK to push this after that change?

Thanks.
-- 

Kaushal Modi


Re: [O] org-protocol documentation

2017-06-22 Thread Nicolas Goaziou
Hello,

Mario Martelli  writes:

> I’ve incorporated the org-protocol documentation into org.texi.
>
> https://github.com/mgmart/org-mode/commit/31dd3cc13034c8501d8526e25086152a0e6538dd
>  
> 

So as to ease the reviewing process, could you send it on the ML with
git format-patch sub-command?

Also, I suggest using ox-texinfo from development version, if you can,
as the Texinfo output should be superior.

>> I assume a bug around Line 527 in org-protocol.el
>> 
>>   (let* ((base-url (plist-get (cdr prolist) :base-url))
>> —>   (wsearch (regexp-quote base-url)))   <—
>> 
>> Could anyone confirm that? I’m unsure whether it might be a local 
>> misconfiguration on my side or not.

Confirm what? Why do you think there is a bug in the line above?

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] noweb documentation update

2017-06-22 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> A quick update.. the attached patch has minor formatting fixes over the
> previous one.

Thank you. It looks good.

However, I think we can write Noweb, i.e., without quotes, like Emacs,
Org or MobileOrg. Quotes impedes reading process, IMO.

WDYT?

Regards,

-- 
Nicolas Goaziou



Re: [O] org-protocol documentation

2017-06-22 Thread Mario Martelli
I’ve incorporated the org-protocol documentation into org.texi.

https://github.com/mgmart/org-mode/commit/31dd3cc13034c8501d8526e25086152a0e6538dd
 


In a separate branch you could see the history of changes to the original 
org-protocol documentation from worg

https://github.com/mgmart/org-mode/commits/documentation/org-protocol 


Still not sure wether the open-source subprotocol is broken or not.

Kind regards
Mario
— 



> Am 22.06.2017 um 10:40 schrieb Mario Martelli :
> 
> I’m about to incorporate the new style URIs into the documentation. 
> During my tests somehow the open-source protocol does not work for me.
> 
> I assume a bug around Line 527 in org-protocol.el
> 
>   (let* ((base-url (plist-get (cdr prolist) :base-url))
> —>   (wsearch (regexp-quote base-url)))   <—
> 
> Could anyone confirm that? I’m unsure whether it might be a local 
> misconfiguration on my side or not.
> 
> I tried it with the worg example:
> 
>   emacsclient 
> "org-protocol://open-source?url=http://orgmode.org/worg/org-tutorials/org-import-rtm.html”
> 
> and escaped
> 
>   emacsclient 
> 'org-protocol://open-source?url=https%3A%2F%2Forgmode.org%2Fworg%2Forg-tutorials%2Forg-import-rtm.html’
> 
> In both cases it fails silently.
> 
>> I'm not sure why is pandoc needed here. Org can export to Texinfo
>> format, if needed.
> 
> Thank you! Output is much nicer than with pandoc. I’ve disabled it years ago 
> because not needed. So it went out of my sight ;)
> 
>> Also, if the syntax is not quite right, no worries,
>> we'll fix it.
> 
> That are great news!
> 
> Kind regards
> Mario
> — 
> 
> 
> 



Re: [O] [PATCH] noweb documentation update

2017-06-22 Thread Kaushal Modi
A quick update.. the attached patch has minor formatting fixes over the
previous one.

Please use this patch for review.

Thanks.

On Thu, Jun 22, 2017 at 3:01 PM Kaushal Modi  wrote:

> Hello,
>
> Thanks. My comments are below, and the updated patch is attached.
>
-- 

Kaushal Modi


0001-Improve-noweb-documentation.patch
Description: Binary data


Re: [O] [PATCH] noweb documentation update

2017-06-22 Thread Kaushal Modi
Hello,

Thanks. My comments are below, and the updated patch is attached.

In addition to your suggestion:

- Replaced ``Noweb'' with ``noweb'' every where. I am still bugged by the
inconsistency that some places have ``noweb'' while some places have just
noweb (no quotes). Or would replacing all occurrences of ``noweb'' and
noweb with Noweb be better?

- Added more examples under "Noweb prefix lines" sub-heading.

On Thu, Jun 22, 2017 at 3:05 AM Nicolas Goaziou 
wrote:

> I agree the latter is less clear. However, I suggest less convoluted
> wording:
>
> Org can include the @emph{results} of a code block rather than its
> body.  To that effect, append parentheses, possibly including
> arguments, to the code block name, as show below.
>

That's better, thanks.


> > -   :PROPERTIES:
> > -   :header-args: :noweb-ref fullest-disk
> > -   :END:
> > + :PROPERTIES:
> > + :header-args: :noweb-ref fullest-disk
> > + :END:
>
> I don't think the change above is meaningful here. Anyway it should be
> consistent with other examples across the manual.
>

I agree, that indentation change is reverted. By default everything is
left-flushed in org (except where you intend to have indented (see what I
did?) lists and such). So I removed that extra spaces from before the
property drawer. But I think all such property drawer instances in org.texi
have 2 leading spaces, so I will stick to that.


> What about
>
> The default is @code{:noweb no}.  Org defaults to @code{:noweb no} so
> as not to cause errors in languages where ``noweb'' syntax is
> ambiguous.  For example, @samp{Ruby} language interprets
> @samp{<>} differently.  Change Org's default to @code{:noweb
> yes} for languages where there is no risk of confusion.
>

OK. I had simply moved the prior "Note"  as it was useful to have the
information about :noweb default in one place. I have reworded it as
suggested.

Note that I don't know what <> means in Ruby.
>

Neither do I. Hope this is fine -- I have removed that line as there is no
clear reference to that statement. Quick searching through this also
doesn't show anything like <>:
http://ruby-doc.com/docs/ProgrammingRuby/. Also this answer (
https://stackoverflow.com/a/6852104/1219634 ) has reference to "<<", but
all it says is that "<<" is an operator.. like in many other languages too.


> > +Notice the difference in how they get exported:
> > +@example
> > +In Python 3, with "str='foo'", "print(str)" would print:
> > +
> > +foo
> > +
> > +@end example
>
> Would it be better to split it into two distinct examples?
>

Done.
-- 

Kaushal Modi


0001-Improve-noweb-documentation.patch
Description: Binary data


Re: [O] org table toggle narrowing and true column hiding

2017-06-22 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> Googling showed me that the question has been asked 2 years ago, so I
> repeat it just in case:
>
> Any plans to implement true column hiding for org tables?

What is true column hiding? What is the question you are referring to?

> In a org mode buffer (not here in a message buffer even with orgtbl-mode
> enabled)
>
> C-c C-C gives
>
> | Name | <2> | Other |
> |  | <2> |   |
> | John Doe | <2> |   |
>
>
> The question is simple: how can a toggle narrowing?

I don't understand your question.

Regards,

-- 
Nicolas Goaziou



[O] [SOLVED] Re: Mouse-over on bibliographic citation

2017-06-22 Thread Sharon Kimble
John Kitchin  writes:

> Can you add this to your org-file, run it and tell me what the output is:
>
> #+BEGIN_SRC emacs-lisp
> (org-ref-find-bibliography)
> #+END_SRC
>
> Also run M-x org-ref to see what bibliography org-ref thinks it is
> using in that file. There were some recent changes to
> (org-ref-find-bibliography) that might be causing this problem.

--8<---cut here---start->8---
Bibliography
No bibliographystyle found.
Using these bibtex files: (/home/boudiccas/research/hair17/hair17.bib 
/home/boudiccas/research/age-and-trans/cancer/cancer.bib)
--8<---cut here---end--->8---

>
> Do you have a bibliography link in the file you are working in?
>

This is in a file called hair17.org and this is its bibliography
install -

--8<---cut here---start->8---
#+latex_header: 
\usepackage[backend=biber,style=authoryear,doi=true,hyperref=true,backref=true,backrefstyle=two,date=year,maxcitenames=3]{biblatex}
#+LATEX_HEADER: \addbibresource{/home/boudiccas/research/hair17/hair17.bib}
--8<---cut here---end--->8---

Right, I've sorted the problem out. Somehow I had various things that I
was building the pdf with, meaning #+latex_header:, which included a
reference to 'cancer.bib'. I thought that it was commented out, but when
I deleted all comments out latex_headers I've found that it is only
referencing hair17.bib as shown in this output.

--8<---cut here---start->8---
Bibliography
No bibliographystyle found.
Using these bibtex files: (/home/boudiccas/research/hair17/hair17.bib)
--8<---cut here---end--->8---

Sorry for all the hassle and noise that I've caused.

Sorry
Sharon.

>
> Sharon Kimble writes:
>
>> John Kitchin  writes:
>>
>>> this is a bug in the current org-mode 9.0.8. You have to revert it to org 
>>> 9.0.7 for now. It has been fixed, but I am not sure when it will show up.
>>
>> Thanks for this John.
>>
>> I can confirm that with today's release of 'org-mode plus contribs' the
>> desired over effect has returned, but with a caveat - its showing the
>> wrong bibliographic entry! I have this in my config file -
>>
>> --8<---cut here---start->8---
>> #+begin_src emacs-lisp
>> (require 'org-ref)
>> (setq reftex-default-bibliography '("~/research/death/death.bib"))
>>
>> ;; see org-ref for use of these variables
>> (setq org-ref-bibliography-notes "~/research/notes.org"
>>   org-ref-default-bibliography '("~/research/death/death.bib")
>>   org-ref-pdf-directory "~/research/death/pdfs")
>>
>> (setq bibtex-completion-bibliography "~/research/death/death.bib"
>>   bibtex-completion-library-path "~/research/death/pdfs"
>>   bibtex-completion-notes-path "~/research/death/helm-bibtex-notes")
>> #+end_src
>> [2016-09-20 Tue 04:15]
>> [2017-01-17 Tue 11:34]
>> --8<---cut here---end--->8---
>>
>> Going back to '(cite:0072)' the mouse-over now shows 'NHS, , /Ovarian
>> cancer/ (2015).', which is the reference in 'death.bib'!
>>
>> I'm using the exact same code-block as pre-the updated org-mode, and
>> I've restarted emacs, so I'm not sure what ought to be changed, if
>> anything, but I'm unhappy with what its now showing as its not correct.
>>
>> Do I need to revamp my code-block, and if so, how please?
>>
>> Thanks
>> Sharon.
>>
>>>
>>> On Wed, Jun 21, 2017 at 5:50 PM, Sharon Kimble  
>>> wrote:
>>>
>>> I've got this strange problem and I'm not sure when it started, possibly
>>> when this new computer was first put to use last Friday afternoon with a
>>> fresh install of Debian 9, or maybe before then, I'm not sure.
>>>
>>> Anyway, whenever I mouse-over a bibliographic citation in an org-mode
>>> document, it used to say for (cite:0072) '\Hair loss, 2015,
>>> http://www.regrowth.com/hair-loss-articles/ \' but now just shows
>>> 'LINK:cite:0072'.
>>>
>>> I am using 'org-ref' which is up to date, as is org-mode, and both from
>>> ELPA.
>>>
>>> This is what my bibliography item actually is -
>>>
>>> --8<---cut here---start->8---
>>> @Online{0072,
>>>  Title  = {Hair loss},
>>>  Author = {regrowth},
>>>  Url   = {http://www.regrowth.com/hair-loss-articles/},
>>>  Year  = {2015}
>>> }
>>> --8<---cut here---end--->8---
>>>
>>> So how can I regain my previous mouse-over abilities please?
>>>
>>> Thanks
>>> Sharon.
>>> --
>>> A taste of linux = http://www.sharons.org.uk
>>> TGmeds = http://www.tgmeds.org.uk
>>> DrugFacts = https://www.drugfacts.org.uk
>>> Debian 9.0, fluxbox 1.3.5-2, emacs 25.1.1, org-mode 9.0.7
>>>
>
>
> --
> Professor 

Re: [O] rounding (up)

2017-06-22 Thread Uwe Brauer
>>> "John" == John Kitchin  writes:

   > #+BEGIN_SRC emacs-lisp
   > (list (custom-round 0.4875 2 'floor) (custom-round 0.975 2 'floor))
   > #+END_SRC

Thanks I will have a look into that code.




Re: [O] Bug in org-insert-link

2017-06-22 Thread Nicolas Goaziou
Hello,

Dieter Faulbaum  writes:

> "Normally" you are right (sorry for the noise) but I have anniversary
> entries like this:
>
> %%(org-anniversary 1950 12 31)  
> [[bbdb:B%C3%A4rbel%20M%C3%BCnsterfr%C3%A4%C3%9F][Bärbel]] wird %d

OK. The issue was different. It is now fixed.

Thank you.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] problem with babel call with post action

2017-06-22 Thread Eric S Fraga
Helps if I attached the file...  

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-551-g92e8c8
A small example in which the ~call~ statement below fails with error message:
Successfully reloaded Org
#+begin_example
Org mode version 9.0.9 (release_9.0.9-551-g92e8c8 @ /home/ucecesf/git/org-mode/lisp/)
Evaluate this emacs-lisp code block on your system? (y or n) y
executing Emacs-Lisp code block...

(options (quote "rankdir=LR;"))

(nodes (quote (("start" "start" "ellipse" "" "") ("one" "first" "" "" "the first task") ("two" "second" "" "" "second task") ("end" "End" "ellipse" "" "project complete"

(graph (quote (("start" "one" "") ("start" "two" "") ("one" "end" "test") ("two" "end" ""

Evaluate this dot code block (plot-graph) on your system? (y or n) y
executing Dot code block (plot-graph)...
Wrote /tmp/babel-7617mN6/ob-input-7617ncr
"[[file:dependency-graph.pdf]]"
org-indent-add-properties: Wrong type argument: arrayp, nil
#+end_example

* Overview   :ignoreheading:
#+call: graph-from-tables(options="rankdir=LR;",nodes=subtasks-table[2:-1],graph=dependency-table[2:-1]) :exports results :results file :post plot-graph[:results file :exports results :file dependency-graph.pdf](graph=*this*)



#+name: subtasks-table
| node | label| shape   | colour | description  |
|--+--+-++--|
| start| start| ellipse ||  |
| one  | first| || the first task   |
| two  | second   | || second task  |
| end  | End  | ellipse || project complete |

#+name: dependency-table
| from | to   | label |
|--+--+---|
| start| one  |   |
| start| two  |   |
| one  | end  | test  |
| two  | end  |   |

* graph from table
#+name: graph-from-tables
#+header: :var options="" :var nodes='() graph='()
#+BEGIN_SRC emacs-lisp :wrap src dot
  (concat
   "digraph {\n"
   options "\n"   ;; "//rankdir=LR;\n" ;; remove comment characters '//' for horizontal layout; add for vertical layout
   (mapconcat
(lambda (x)
  (format "%s [label=\"%s\" shape=%s style=\"filled\" fillcolor=\"%s\"]"
  (car x)
  (nth 1 x)
  (if (string= "" (nth 2 x)) "box" (nth 2 x))
  (if (string= "" (nth 3 x)) "none" (nth 3 x))
  )) nodes "\n")
   "\n"
   (mapconcat
(lambda (x)
  (format "%s -> %s [taillabel=\"%s\"]"
  (car x) (nth 1 x) (nth 2 x))) graph "\n")
   "}\n")
#+END_SRC

#+name: plot-graph
#+begin_src dot :var graph="digraph { anode;}" :file graph.pdf
$graph
#+end_src


signature.asc
Description: PGP signature


Re: [O] problem with babel call with post action

2017-06-22 Thread Eric S Fraga
On Thursday, 22 Jun 2017 at 07:30, Nicolas Goaziou wrote:

[...]

> I don't understand it either. Could you edebug `org-babel-read-table',
> or post an ECM? Anyway, this seems unrelated to babel call parsing.

Hi Nicolas,

I'm not au fait with using edebug.  Will try to learn it (about time,
probably).  In the meantime, here is an ECM which definitely fails for
me with my normal configuration but which almost works with emacs
-Q.  The almost is that the final output looks like this:

#+begin_src org
  ,#+RESULTS:
  ,#+BEGIN_src dot
  [[file:dependency-graph.pdf]]
  ,#+END_src
#+end_src

where I did not expect the wrapping within a src block.

The error using my configuration is

: org-indent-add-properties: Wrong type argument: arrayp, nil

I will try to debug when I get a chance.

Thanks again,
eric

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-551-g92e8c8


signature.asc
Description: PGP signature


Re: [O] org-cdlatex is driving me nuts

2017-06-22 Thread Carsten Dominik
On Thu, Jun 22, 2017 at 8:07 AM, Rasmus  wrote:

> Guy Mayraz  writes:
>
> > (ii) change the org-cdlatex math
> > symbol to something totally obscure that wouldn't interfere with my
> normal
> > work?
>
> For what it is worth, option (ii) can be archived with something like this,
>
> (with-eval-after-load 'org
>   (define-key org-cdlatex-mode-map "`" nil)
>   (org-defkey org-cdlatex-mode-map "¨" 'cdlatex-math-symbol)
>   (org-defkey org-cdlatex-mode-map "'" 'org-cdlatex-math-modify))
>
>
Yes.  Or we could make Org use cdlatex-math-symbol-prefix
and cdlatex-math-modify-prefix, if more people would like to use a
different prefix.

Carsten


Re: [O] rounding (up)

2017-06-22 Thread Marco Wahl
Uwe Brauer  writes:

> Hi
>
> It seems that org-table (and the underlying calc implementation) round
> down not up.
>
>
> Please consider
>
> | 3.25 | 0.4875 |
> |  6.5 |  0.975 |
>
> #+TBLFM: $2=$1*0.15;
>
>
> | 3.25 | 0.49 |
> |  6.5 | 0.97 |
>
> #+TBLFM: $2=$1*0.15;%.2f
>
> Is there a way to obtain
>
> | 3.25 | 0.49 |
> |  6.5 | 0.98 |
>
> #+TBLFM: $2=$1*0.15;%.2f
>
> That is to replace rounding down to rounding up?


(info "(calc) Integer Truncation") has

#v+
The ‘R’ (‘calc-round’) [‘round’ or ‘fround’] command rounds to the
nearest integer.  When the fractional part is .5 exactly, this command
rounds away from zero.  (All other rounding in the Calculator uses this
convention as well.)  Thus ‘3.5 R’ produces 4 but ‘3.4 R’ produces 3;
‘_3.5 R’ produces -4.
#v-

and

#v+
Each of these functions, when written in algebraic formulas, allows a
second argument which specifies the number of digits after the decimal
point to keep.  For example, ‘round(123.4567, 2)’ will produce the
answer 123.46, and ‘round(123.4567, -1)’ will produce 120 (i.e., the
cutoff is one digit to the _left_ of the decimal point).  A second
argument of zero is equivalent to no second argument at all.
#v-

So I suggest the following:

| 3.25 | |
|  6.5 | |
#+TBLFM: $2=round($1*0.15,2);%.2f


Ciao
Marco






Re: [O] Mouse-over on bibliographic citation

2017-06-22 Thread John Kitchin
Can you add this to your org-file, run it and tell me what the output is:

#+BEGIN_SRC emacs-lisp
(org-ref-find-bibliography)
#+END_SRC

Also run M-x org-ref to see what bibliography org-ref thinks it is
using in that file. There were some recent changes to
(org-ref-find-bibliography) that might be causing this problem.

Do you have a bibliography link in the file you are working in?


Sharon Kimble writes:

> John Kitchin  writes:
>
>> this is a bug in the current org-mode 9.0.8. You have to revert it to org 
>> 9.0.7 for now. It has been fixed, but I am not sure when it will show up.
>
> Thanks for this John.
>
> I can confirm that with today's release of 'org-mode plus contribs' the
> desired over effect has returned, but with a caveat - its showing the
> wrong bibliographic entry! I have this in my config file -
>
> --8<---cut here---start->8---
> #+begin_src emacs-lisp
> (require 'org-ref)
> (setq reftex-default-bibliography '("~/research/death/death.bib"))
>
> ;; see org-ref for use of these variables
> (setq org-ref-bibliography-notes "~/research/notes.org"
>   org-ref-default-bibliography '("~/research/death/death.bib")
>   org-ref-pdf-directory "~/research/death/pdfs")
>
> (setq bibtex-completion-bibliography "~/research/death/death.bib"
>   bibtex-completion-library-path "~/research/death/pdfs"
>   bibtex-completion-notes-path "~/research/death/helm-bibtex-notes")
> #+end_src
> [2016-09-20 Tue 04:15]
> [2017-01-17 Tue 11:34]
> --8<---cut here---end--->8---
>
> Going back to '(cite:0072)' the mouse-over now shows 'NHS, , /Ovarian
> cancer/ (2015).', which is the reference in 'death.bib'!
>
> I'm using the exact same code-block as pre-the updated org-mode, and
> I've restarted emacs, so I'm not sure what ought to be changed, if
> anything, but I'm unhappy with what its now showing as its not correct.
>
> Do I need to revamp my code-block, and if so, how please?
>
> Thanks
> Sharon.
>
>>
>> On Wed, Jun 21, 2017 at 5:50 PM, Sharon Kimble  
>> wrote:
>>
>> I've got this strange problem and I'm not sure when it started, possibly
>> when this new computer was first put to use last Friday afternoon with a
>> fresh install of Debian 9, or maybe before then, I'm not sure.
>>
>> Anyway, whenever I mouse-over a bibliographic citation in an org-mode
>> document, it used to say for (cite:0072) '\Hair loss, 2015,
>> http://www.regrowth.com/hair-loss-articles/ \' but now just shows
>> 'LINK:cite:0072'.
>>
>> I am using 'org-ref' which is up to date, as is org-mode, and both from
>> ELPA.
>>
>> This is what my bibliography item actually is -
>>
>> --8<---cut here---start->8---
>> @Online{0072,
>>  Title  = {Hair loss},
>>  Author = {regrowth},
>>  Url   = {http://www.regrowth.com/hair-loss-articles/},
>>  Year  = {2015}
>> }
>> --8<---cut here---end--->8---
>>
>> So how can I regain my previous mouse-over abilities please?
>>
>> Thanks
>> Sharon.
>> --
>> A taste of linux = http://www.sharons.org.uk
>> TGmeds = http://www.tgmeds.org.uk
>> DrugFacts = https://www.drugfacts.org.uk
>> Debian 9.0, fluxbox 1.3.5-2, emacs 25.1.1, org-mode 9.0.7
>>


--
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-cdlatex is driving me nuts

2017-06-22 Thread Rasmus
Guy Mayraz  writes:

> (ii) change the org-cdlatex math
> symbol to something totally obscure that wouldn't interfere with my normal
> work?

For what it is worth, option (ii) can be archived with something like this,

(with-eval-after-load 'org
  (define-key org-cdlatex-mode-map "`" nil)
  (org-defkey org-cdlatex-mode-map "¨" 'cdlatex-math-symbol)
  (org-defkey org-cdlatex-mode-map "'" 'org-cdlatex-math-modify))

Rasmus

-- 
And I faced endless streams of vendor-approved Ikea furniture. . .




Re: [O] rounding (up)

2017-06-22 Thread John Kitchin
It appears Emacs uses Banker's rounding (http://wiki.c2.com/?BankersRounding):

#+BEGIN_SRC emacs-lisp
(list (round 4.5) (round 5.5))
#+END_SRC

#+RESULTS:
| 4 | 6 |

Here is some lightly tested code to get different styles of rounding:

#+BEGIN_SRC emacs-lisp
(defun custom-round (number  N direction)
  "Round NUMBER to N decimal places.
DIRECTION is a symbol of how to round.
`round' does Banker's rounding.
`ceiling' rounds up.
`floor' rounds down.
`truncate' rounds towards zero.
https://en.wikipedia.org/wiki/Rounding;
  (setq N (or N 0)
direction (or direction 'ceiling))
  (let ((m (float (expt 10 (* -1 N)
(* (funcall direction (/ number m)) m)))

(list (custom-round 0.4875 2 'ceiling) (custom-round 0.975 2 'ceiling))
#+END_SRC

#+RESULTS:
| 0.49 | 0.98 |

#+BEGIN_SRC emacs-lisp
(list (custom-round 0.4875 2 'floor) (custom-round 0.975 2 'floor))
#+END_SRC

#+RESULTS:
| 0.48 | 0.97 |


Uwe Brauer writes:

> Hi
>
> It seems that org-table (and the underlying calc implementation) round
> down not up.
>
>
> Please consider
>
> | 3.25 | 0.4875 |
> |  6.5 |  0.975 |
> #+TBLFM: $2=$1*0.15;
>
>
> | 3.25 | 0.49 |
> |  6.5 | 0.97 |
> #+TBLFM: $2=$1*0.15;%.2f
>
> Is there a way to obtain
>
> | 3.25 | 0.49 |
> |  6.5 | 0.98 |
> #+TBLFM: $2=$1*0.15;%.2f
>
> That is to replace rounding down to rounding up?
>
> Thanks
>
> Uwe Brauer


--
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] Mouse-over on bibliographic citation

2017-06-22 Thread Sharon Kimble
John Kitchin  writes:

> this is a bug in the current org-mode 9.0.8. You have to revert it to org 
> 9.0.7 for now. It has been fixed, but I am not sure when it will show up.

Thanks for this John.

I can confirm that with today's release of 'org-mode plus contribs' the
desired over effect has returned, but with a caveat - its showing the
wrong bibliographic entry! I have this in my config file -

--8<---cut here---start->8---
#+begin_src emacs-lisp
(require 'org-ref)
(setq reftex-default-bibliography '("~/research/death/death.bib"))

;; see org-ref for use of these variables
(setq org-ref-bibliography-notes "~/research/notes.org"
  org-ref-default-bibliography '("~/research/death/death.bib")
  org-ref-pdf-directory "~/research/death/pdfs")

(setq bibtex-completion-bibliography "~/research/death/death.bib"
  bibtex-completion-library-path "~/research/death/pdfs"
  bibtex-completion-notes-path "~/research/death/helm-bibtex-notes")
#+end_src
[2016-09-20 Tue 04:15]
[2017-01-17 Tue 11:34]
--8<---cut here---end--->8---

Going back to '(cite:0072)' the mouse-over now shows 'NHS, , /Ovarian
cancer/ (2015).', which is the reference in 'death.bib'!

I'm using the exact same code-block as pre-the updated org-mode, and
I've restarted emacs, so I'm not sure what ought to be changed, if
anything, but I'm unhappy with what its now showing as its not correct.

Do I need to revamp my code-block, and if so, how please?

Thanks
Sharon.

>
> On Wed, Jun 21, 2017 at 5:50 PM, Sharon Kimble  
> wrote:
>
> I've got this strange problem and I'm not sure when it started, possibly
> when this new computer was first put to use last Friday afternoon with a
> fresh install of Debian 9, or maybe before then, I'm not sure.
>
> Anyway, whenever I mouse-over a bibliographic citation in an org-mode
> document, it used to say for (cite:0072) '\Hair loss, 2015,
> http://www.regrowth.com/hair-loss-articles/ \' but now just shows
> 'LINK:cite:0072'.
>
> I am using 'org-ref' which is up to date, as is org-mode, and both from
> ELPA.
>
> This is what my bibliography item actually is -
>
> --8<---cut here---start->8---
> @Online{0072,
>   Title                    = {Hair loss},
>   Author                   = {regrowth},
>   Url                      = 
> {http://www.regrowth.com/hair-loss-articles/},
>   Year                     = {2015}
> }
> --8<---cut here---end--->8---
>
> So how can I regain my previous mouse-over abilities please?
>
> Thanks
> Sharon.
> --
> A taste of linux = http://www.sharons.org.uk
> TGmeds = http://www.tgmeds.org.uk
> DrugFacts = https://www.drugfacts.org.uk
> Debian 9.0, fluxbox 1.3.5-2, emacs 25.1.1, org-mode 9.0.7
>

-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk  
Debian 9.0, fluxbox 1.3.5-2, emacs 25.1.1, org-mode 9.0.7


signature.asc
Description: PGP signature


Re: [O] Controlling new line characters during tangle

2017-06-22 Thread Giacomo M

  
  
Ok, rudimentary elisp knowledge seems to help here:
#+BEGIN_SRC emacs-lisp
  (defun jack/dos2unix-post-tangle-hook ()
    (set-buffer-file-coding-system 'unix 't)
    (save-buffer)
    )
  (add-hook 'org-babel-post-tangle-hook
  'jack/dos2unix-post-tangle-hook)
  #+END_SRC

Thanks,

Giacomo

Il 6/21/2017 1:02 PM, Kaushal Modi ha
  scritto:


  
On Wed, Jun 21, 2017, 5:21 AM Giacomo M 
  wrote:

Hi all,
  
  I'm using emacs also under Windows, and would need to tangle
  scripts/config files to be used under Unix.
  
  
  
  
 Is there
  any header argument
  to enforce the desired new line characters in the tangled
  files?

  
  
  
  At which point would you like to enforce the new line
characters?
  
  
  Can you post a MWE and explain what that it tangles to vs
what you'd actually like to see in the tangled file?
  


  
  -- 
  
  
Kaushal Modi
  


  




Re: [O] org-protocol documentation

2017-06-22 Thread Mario Martelli
I’m about to incorporate the new style URIs into the documentation. 
During my tests somehow the open-source protocol does not work for me.

I assume a bug around Line 527 in org-protocol.el

   (let* ((base-url (plist-get (cdr prolist) :base-url))
—>   (wsearch (regexp-quote base-url)))   <—

Could anyone confirm that? I’m unsure whether it might be a local 
misconfiguration on my side or not.

I tried it with the worg example:

emacsclient 
"org-protocol://open-source?url=http://orgmode.org/worg/org-tutorials/org-import-rtm.html”

and escaped

emacsclient 
'org-protocol://open-source?url=https%3A%2F%2Forgmode.org%2Fworg%2Forg-tutorials%2Forg-import-rtm.html’

In both cases it fails silently.

> I'm not sure why is pandoc needed here. Org can export to Texinfo
> format, if needed.

Thank you! Output is much nicer than with pandoc. I’ve disabled it years ago 
because not needed. So it went out of my sight ;)

> Also, if the syntax is not quite right, no worries,
> we'll fix it.

That are great news!

Kind regards
Mario
— 






Re: [O] org-cdlatex is driving me nuts

2017-06-22 Thread Guy Mayraz
O.k. Thanks! It turns out the fault was in my desktop file, which had
cdlatex mode listed in all my org files.

Cheers,

Guy


Guy Mayraz | Lecturer (assistant professor) | Department of Economics |
University of Melbourne
Tel: +61 3 9035 8141 | Mobile: +61 422 893 184

On 22 June 2017 at 17:09, Nicolas Goaziou  wrote:

> Hello,
>
> Guy Mayraz  writes:
>
> > Org-cdlatex is automatically enabled on all org files
>
> This is not true. You may want to check your configuration files.
>
> Regards,
>
> --
> Nicolas Goaziou
>
>


Re: [O] empty cells in columns should be left emtpy when manipulating columns

2017-06-22 Thread Uwe Brauer

   > Hello,
   > Uwe Brauer  writes:


   > One possibility:

   > | 3.25 | 0.4875 |
   > |  ||
   > | 2.25 | 0.3375 |

   > #+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15);E

Great but how can I round?

#+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15;%.1f);E

And friends did not work any more

| 3.25 | 0.5) |
|  | 0.0) |
#+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15;%.1f);E




Re: [O] empty cells in columns should be left emtpy when manipulating columns

2017-06-22 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> Please consider this
>
> | 3.25 | 0.4875 |
> |  | 0. |
> | 2.25 | 0.3375 |
>
> #+TBLFM: $2=$1*0.15
>
> How can I avoid the entry 0.  ?

One possibility:

| 3.25 | 0.4875 |
|  ||
| 2.25 | 0.3375 |
#+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15);E


Regards,

-- 
Nicolas Goaziou



Re: [O] problem with babel call with post action

2017-06-22 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> I think it's a symptom of being lazy and spending way too much time on
> codes to make life easier...  as in "The tale of the man who was too
> lazy to fail" by Robert Heinlein [1].

Thank you for the reference. I hadn't heard about this novel before.

>> I improved babel call arguments parsing. Could you confirm that your
>> wizardry is in order now?
>
> I got further but there's still an error.  See attached debug output.  I
> don't understand as org-table-to-lisp does exist.  I don't think it's a
> configuration problem but...

I don't understand it either. Could you edebug `org-babel-read-table',
or post an ECM? Anyway, this seems unrelated to babel call parsing.

Regards,

-- 
Nicolas Goaziou



[O] rounding (up)

2017-06-22 Thread Uwe Brauer

Hi

It seems that org-table (and the underlying calc implementation) round
down not up.


Please consider

| 3.25 | 0.4875 |
|  6.5 |  0.975 |
#+TBLFM: $2=$1*0.15;


| 3.25 | 0.49 |
|  6.5 | 0.97 |
#+TBLFM: $2=$1*0.15;%.2f

Is there a way to obtain

| 3.25 | 0.49 |
|  6.5 | 0.98 |
#+TBLFM: $2=$1*0.15;%.2f

That is to replace rounding down to rounding up?

Thanks

Uwe Brauer 




[O] empty cells in columns should be left emtpy when manipulating columns

2017-06-22 Thread Uwe Brauer

Please consider this

| 3.25 | 0.4875 |
|  | 0. |
| 2.25 | 0.3375 |
#+TBLFM: $2=$1*0.15

How can I avoid the entry 0.  ?

I could insert **

Giving

| 3.25 |  0.4875 |
|   ** |  #ERROR |
| 2.25 |  0.3375 |
#+TBLFM: $2=$1*0.15

But this is cumbersome, any other possibilities?

Thanks

Uwe Brauer 




Re: [O] org-cdlatex is driving me nuts

2017-06-22 Thread Nicolas Goaziou
Hello,

Guy Mayraz  writes:

> Org-cdlatex is automatically enabled on all org files

This is not true. You may want to check your configuration files.

Regards,

-- 
Nicolas Goaziou



[O] org-cdlatex is driving me nuts

2017-06-22 Thread Guy Mayraz
Org-cdlatex is automatically enabled on all org files, and it overrides the
back quote symbol, which I like using for back quote. I know how to disable
org-cdlatex in the current buffer, but that's not a good solution given the
number of org buffers I use. Can I (i) shift the default to org-cdlatex
being disabled (best option probably), or (ii) change the org-cdlatex math
symbol to something totally obscure that wouldn't interfere with my normal
work?

Thanks!!

Guy Mayraz | Lecturer (assistant professor) | Department of Economics |
University of Melbourne
Tel: +61 3 9035 8141 | Mobile: +61 422 893 184


Re: [O] [PATCH] noweb documentation update

2017-06-22 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> I have attached a patch (rebased off maint) that attempts at clarifying how
> certain aspects of noweb work based on my experience, with few complete
> examples.

Thank you. Some comments follow.

> Note: I had to also revert a little bit of wording change that was made
> recently. I found pre-wording-change version easier to understand. Copying
> Lambda Coder to comment on that.
>
> This is what the current patch has in the "Noweb reference syntax section":
>
> =
> It is possible to include the @emph{results} of a code block rather than the
> body.  This is done by appending parentheses to the code block name which
> may
> optionally contain arguments to the code block as shown below.
> =
>
> Earlier it was:
>
> =
> Org can handle naming of @emph{results} block, rather than the body of the
> @samp{src} code block, using ``noweb'' style references.
>
> For ``noweb'' style reference, append parenthesis to the code block name for
> arguments, as shown in this example:
> =

I agree the latter is less clear. However, I suggest less convoluted
wording:

Org can include the @emph{results} of a code block rather than its
body.  To that effect, append parentheses, possibly including
arguments, to the code block name, as show below.


> -   :PROPERTIES:
> -   :header-args: :noweb-ref fullest-disk
> -   :END:
> + :PROPERTIES:
> + :header-args: :noweb-ref fullest-disk
> + :END:

I don't think the change above is meaningful here. Anyway it should be
consistent with other examples across the manual.

>   ** query all mounted disks
>   #+BEGIN_SRC sh
> @@ -16756,25 +16769,49 @@ references in the @samp{src} code block before 
> evaluation.
>  For the header argument @code{:noweb no}, Org does not expand ``noweb'' style
>  references in the @samp{src} code block before evaluation.
>  
> -The default is @code{:noweb no}.
> +The default is @code{:noweb no}.  Org defaults to @code{:noweb no} so as not
> +to cause errors in languages such as @samp{Ruby} where ``noweb'' syntax is
> +equally valid characters.  For example, @code{<>}.  Change Org's default
> +to @code{:noweb yes} for languages where there is no risk of confusion.

What about

The default is @code{:noweb no}.  Org defaults to @code{:noweb no} so
as not to cause errors in languages where ``noweb'' syntax is
ambiguous.  For example, @samp{Ruby} language interprets
@samp{<>} differently.  Change Org's default to @code{:noweb
yes} for languages where there is no risk of confusion.

Note that I don't know what <> means in Ruby.

> -Org can handle naming of @emph{results} block, rather than the body of the
> -@samp{src} code block, using ``noweb'' style references.
> -
> -For ``noweb'' style reference, append parenthesis to the code block name for
> -arguments, as shown in this example:
> +It is possible to include the @emph{results} of a code block rather than the
> +body.  This is done by appending parentheses to the code block name which may
> +optionally contain arguments to the code block as shown below.

See above.

> +Notice the difference in how they get exported:
> +@example
> +In Python 3, with "str='foo'", "print(str)" would print:
> +
> +foo
> +
> +@end example

Would it be better to split it into two distinct examples?

Regards,

-- 
Nicolas Goaziou



Re: [O] org-table export to ods/xlsx etc

2017-06-22 Thread Uwe Brauer
>>> "Eric" == Eric S Fraga  writes:

   > On Wednesday, 21 Jun 2017 at 13:01, Uwe Brauer wrote:
   >> Debugger entered--Lisp error: (error "Cannot convert from csv format
   >> to xlsx format?")

   > What does (org-odt-do-reachable-formats "csv") return?
Ha thanks

I had to set

(add-to-list 'org-odt-convert-processes '("gnumeric" "/usr/bin/ssconvert %i 
%o"))

Otherwise ssconvert was not found.
I reported the misbehavior of LO/OO concerning the coding in the
relevant list. Maybe it is a bug.