Re: [O] Patch adding from-logo commentary ox-koma-letter.el

2018-06-20 Thread Van L


> If you like the additional documentation,
> then I will update it with
> this and send a new patch.

Can the documentation in the standard distribution 
include step-by-step example using XeTeX comparing 
plain TeX and LaTeX for writing a letter to PDF 
with an SVG logo placed well?



[O] how to save script created when executing a babel block?

2018-06-20 Thread dmg
hi everybody,

is there a way to save the script created by babel that is being executed?

thank you,

-- 
--dmg

---
D M German
http://turingmachine.org



Re: [O] Patch adding from-logo commentary ox-koma-letter.el

2018-06-20 Thread Grant Rettke
On Tue, Jun 19, 2018 at 3:11 AM, Nicolas Goaziou  wrote:
> Hello,
>
> Grant Rettke  writes:
>
>> Although the function document ion mentions the markup to use, it
>> doesn't explain that the user needs to provide a logo file in the same
>> directory as the letter.
>
> Is it really necessary?

If you are comfortable with LaTeX, then it probably isn't necessary
because you already know how \includegraphics{logo} works, or you
would look it up.

When I wrote this, I felt like because ox-koma-letter makes it so easy
for non LaTeX Org users, that a reminder would help because this
variable is I think the only one that requires any LaTeX knowledge.

That was the context for my statement. I'm making a big assumption
that non latex org users would benefit here.

> Couldn't you use, e.g., \includegraphics{subdir/logo}

Yes.

If you like the additional documentation, then I will update it with
this and send a new patch.

WDYT?



[O] Speeding up agenda custom command with org-agenda-earlier & org-agenda-later

2018-06-20 Thread Zongheng Yang
Hi,

Here's an agenda custom command that acts as the main interface I interact
with org (in fact, emacs :)).

  (setq org-agenda-custom-commands
'(("c" "Simple agenda view"
   ((agenda "")
(tags "PRIORITY=\"A\""
  ((org-agenda-files '("~/org/work.org" "~/org/ideas.org"))
   (org-agenda-skip-function '(org-agenda-skip-entry-if
'todo 'done))
   (org-agenda-overriding-header "High-priority tasks:")
   ))
(tags-todo "PRIORITY=\"C\""
   ((org-agenda-files '("~/org/work.org" "~/org/
ideas.org"))
(org-agenda-overriding-header "Long-term:")))
(alltodo ""
 ((org-agenda-skip-function
   '(or (zongheng-org-skip-subtree-if-priority ?A)
(zongheng-org-skip-subtree-if-priority ?C)
(org-agenda-skip-if nil '(scheduled deadline
  (org-agenda-overriding-header "Other tasks:")))


After I get into this view, I frequently issue many "org-agenda-earlier" &
"org-agenda-later" commands, often in a back-and-forth fashion, to inspect
what I've done around certain periods.

In such a use case, it seems there's *no reason to not cache results*.
Without such caching currently *the latency of switching is really high*;
with such a caching, I'm happy to pay an one-time latency/CPU cost for the
first command, as long as successive commands can be sped up.

Is a feature like this planned?

Thanks,
Zongheng


[O] [PATCH] ob-scheme.el: Fix scheme blocks ignoring :results in formatting

2018-06-20 Thread Henry Blevins
Currently, scheme babel blocks ignore :results header arguments like
'verbatim' and attempt to format all output as tables. This patch corrects
that and performs the user supplied formatting.

This is my first time contributing a patch, so I apologize if I have made
any mistakes in submitting this.

Regards,

Henry Blevins
From f93f086cbb16926c883a31fe8ad796e0da8bc8f7 Mon Sep 17 00:00:00 2001
From: Henry Blevins 
Date: Wed, 20 Jun 2018 14:38:47 -0400
Subject: [PATCH] ob-scheme.el: Fix scheme blocks ignoring :results in
 formatting

* ob-scheme.el (org-babel-execute:scheme): Process the :result header
argument to conditionally and appropriately format output.

Currently, `org-babel-execute:scheme' ignores the user specified :result header
argument found in the :result-param parameter and process all output as a table.
The fix is to pass the `result' and :result-param to the `org-babel-result-cond'
function to invoke the corresponding formatting.

For example, the following block incorrectly formats its output as a table:

(list 1 2 3)

| 1 | 2 | 3 |

This patch results in the correct behavior:

(list 1 2 3)

: (1 2 3)

Bringing it inline with the result using Emacs lisp:

(list 1 2 3)

: (1 2 3)
---
 lisp/ob-scheme.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el
index 0abac7462..fb7c48bbc 100644
--- a/lisp/ob-scheme.el
+++ b/lisp/ob-scheme.el
@@ -212,6 +212,7 @@ This function is called by `org-babel-execute-src-block'"
 	 (session (org-babel-scheme-make-session-name
 		   source-buffer-name (cdr (assq :session params)) impl))
 	 (full-body (org-babel-expand-body:scheme body params))
+	 (result-params (cdr (assq :result-params params)))
 	 (result
 	  (org-babel-scheme-execute-with-geiser
 	   full-body		   ; code
@@ -225,7 +226,9 @@ This function is called by `org-babel-execute-src-block'"
  (cdr (assq :colnames params)))
 		(org-babel-pick-name (cdr (assq :rowname-names params))
  (cdr (assq :rownames params))
-	  (org-babel-scheme--table-or-string table))
+	  (org-babel-result-cond result-params
+	result
+	(org-babel-scheme--table-or-string table)))
 
 (provide 'ob-scheme)
 
-- 
2.17.0



Re: [O] very long table calc expressions ?

2018-06-20 Thread Thierry Banel

Le 20/06/2018 11:09, Uwe Brauer a écrit :

> Le 19/06/2018 19:21, Uwe Brauer a écrit :

> You may want to take a look at the orgtbl-aggregate package available on
> Melpa.



Thanks very much. I have already installed that package but the example
presented in the documentation were too sophisticated for my purpose. May
I suggest to include this example in the documentation, because your
package is a real time saver!!


I included such an example (and added your name to the contributors list).


I take the opportunity to ask whether your package can also easily
deal with the following problem (which is very important to me and
drives my crazy)
Not easily. orgaggregate groups rows using equality, whereas you need to 
group rows based on intervals (between 5 and 6.9 for example).


But you can prepare the data table with a new, computed column, telling 
in which interval each value falls:


#+TBLNAME: raw-data
| Test | Interval |
|--+--|
|0 | SS   |
|1 | SS   |
|2 | SS   |
|3 | SS   |
|4 | SS   |
|5 | AP   |
|6 | AP   |
|7 | NT   |
|8 | NT   |
|9 | SB   |
|  | NP   |
|  | NP   |
|  | NP   |
#+TBLFM: $2= "nan"="$1" ? string("NP") : 0<=$1 && $1<=4.9 ? string("SS") 
: 5<=$1 && $1<=6.9 ? string("AP") : 7<=$1 && $1<=8.9 ? string("NT") : 
9<=$1 && $1<=10  ? string("SB") : string("OTHER");E


And then orgaggregate can handle it:

#+BEGIN: aggregate :table "raw-data" :cols "Interval count()"
| Interval | count() |
|--+-|
| SS   |   5 |
| AP   |   2 |
| NT   |   2 |
| SB   |   1 |
| NP   |   3 |
#+END:



#+TBLFM: $4='(length (org-lookup-all '($2 $3) '(remote(raw-data,@2$1..@>$1)) 
nil 'in-interval));N


However that function can not deal with empty strings (I could replace
the empty string by some string but then the function does not
distinguish between the string and 0). So I want that the entry NP
represents the counts of the empty strings: there are three in that column.

So can your package deal with this situation?

Thanks again

Uwe Brauer

I don't have a solution out of my hat. But I guess the problem you face 
may originate from the remote() function. It filters out empty values. 
However you can change this behavior using the ;E modifier.


| [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
#+TBLFM: $1=remote(raw-data,@2$1..@>$1)

| [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, nan, nan, nan] |
#+TBLFM: $1=remote(raw-data,@2$1..@>$1);E

Regards
Thierry








Re: [O] Bug: Inherited tags alignment problem in block agendas [9.1.13 (release_9.1.13-751-g9dcc52 @ c:/D-Drive/bin/org-mode/lisp/)]

2018-06-20 Thread Bernt Hansen
Nicolas Goaziou  writes:

> Hello,
>
> Bernt Hansen  writes:
>
>
>> There seems to be an issue with inherited tag alignment in block agendas
>> in the master branch.
>>
>> ECM follows.
>
> I cannot reproduce this issue. Was it somehow fixed since your report?
>
> Regards,

Yes this was fixed in a previous commit on master since reporting the
problem.  It is working fine now.

I have another annoying bug I run into once a week which I will report
separately.

Short version:

  In the daily agenda showing a single day
  if you jump back 3 days
  turn on log mode (or set a restriction or start clock check mode)
  and then jump back to today
  you can't turn those modes off again.

  My workaround is to jump back 3 days again to turn it off and then it
  works normally.

Will send an ECM when I have time later this week.

Thanks,
Bernt



Re: [O] Bug: Inherited tags alignment problem in block agendas [9.1.13 (release_9.1.13-751-g9dcc52 @ c:/D-Drive/bin/org-mode/lisp/)]

2018-06-20 Thread Nicolas Goaziou
Hello,

Bernt Hansen  writes:


> There seems to be an issue with inherited tag alignment in block agendas
> in the master branch.
>
> ECM follows.

I cannot reproduce this issue. Was it somehow fixed since your report?

Regards,

-- 
Nicolas Goaziou



Re: [O] very long table calc expressions ?

2018-06-20 Thread Uwe Brauer

   > Le 19/06/2018 19:21, Uwe Brauer a écrit :

   > You may want to take a look at the orgtbl-aggregate package available on 
   > Melpa.

   > #+BEGIN: aggregate :table "data" :cols "'Cual 1' count()"
   > | 'Cual 1' | count() |

   > |--+-|
   > | NT   |   3 |
   > | MH   |   2 |
   > | AP   |   5 |
   > | SS   |   1 |
   > | NP   |   3 |
   > | SB   |   1 |
   > #+END:

   > It features the count() function which computes frequency, but also sum, 
   > mean, filtering and much more.
   > Documentation here: https://github.com/tbanel/orgaggregate


Thanks very much. I have already installed that package but the example
presented in the documentation were too sophisticated for my purpose. May
I suggest to include this example in the documentation, because your
package is a real time saver!!


I take the opportunity to ask whether your package can also easily
deal with the following problem (which is very important to me and
drives my crazy)

Take the following table
#+TBLNAME: raw-data
| Test |
|--|
|0 |
|1 |
|2 |
|3 |
|4 |
|5 |
|6 |
|7 |
|8 |
|9 |
|  |
|  |
|  |

Important are the last three empty strings. 

I know, thanks to the
https://orgmode.org/worg/org-tutorials/org-lookups.html
how to count the frequencies of the numbers in the column in an interval  using 
the 
function 

#+TBLNAME: stat-table
#+ATTR_HTML: :border 2 :rules all :frame border
|| lower bound | upper bound | frequency |
|+-+-+---|
| NP |   0 |   0 | 1 |
| SS |   0 | 4.9 | 5 |
| AP |   5 | 6.9 | 2 |
| NT |   7 | 8.9 | 2 |
| SB |   9 |  10 | 1 |
#+TBLFM: $4='(length (org-lookup-all '($2 $3) '(remote(raw-data,@2$1..@>$1)) 
nil 'in-interval));N


#+BEGIN_SRC emacs-lisp
  (defun in-interval (bounds el)
(and (>= el (car bounds)) (<= el (cadr bounds
#+END_SRC

However that function can not deal with empty strings (I could replace
the empty string by some string but then the function does not
distinguish between the string and 0). So I want that the entry NP
represents the counts of the empty strings: there are three in that column.

So can your package deal with this situation?

Thanks again

Uwe Brauer



smime.p7s
Description: S/MIME cryptographic signature


Re: [O] very long table calc expressions ?

2018-06-20 Thread Thierry Banel

Le 19/06/2018 19:21, Uwe Brauer a écrit :


Hi

Take the following example


#+TBLNAME: data
  | Name | Cual 1 |
  |--+|
  | A| NT |
  | B| NT |
  | C| MH |
  | D| AP |
  | E| MH |
  | F| SS |
  | G| NP |
  | H| NP |
  | I| NP |
  |  | NT |
  |  | AP |
  |  | AP |
  |  | AP |
  |  | AP |
  |  | SB |


#+TBLNAME: stat-final2
|| Frequency |
|+---|
| SS | 1 |
| AP | 5 |
| NT | 3 |
| SB | 1 |
| MH | 2 |
| NP | 3 |
#+TBLFM: @>$2='(length (org-lookup-all "NP" '(remote(data,@2$2..@>I$2)) nil))::@>>$2='(length (org-lookup-all "MH" '(remote(data,@2$2..@>I$2)) nil))::@>>>$2='(length 
(org-lookup-all "SB" '(remote(data,@2$2..@>I$2)) nil))::@$2='(length (org-lookup-all "NT" '(remote(data,@2$2..@>I$2)) nil))::@>$2='(length (org-lookup-all 
"AP" '(remote(data,@2$2..@>I$2)) nil))::@>>$2='(length (org-lookup-all "SS" '(remote(data,@2$2..@>I$2)) nil))


Are there any rules to break this very long expression?

Thanks

Uwe Brauer





You may want to take a look at the orgtbl-aggregate package available on 
Melpa.


#+BEGIN: aggregate :table "data" :cols "'Cual 1' count()"
| 'Cual 1' | count() |
|--+-|
| NT   |   3 |
| MH   |   2 |
| AP   |   5 |
| SS   |   1 |
| NP   |   3 |
| SB   |   1 |
#+END:

It features the count() function which computes frequency, but also sum, 
mean, filtering and much more.

Documentation here: https://github.com/tbanel/orgaggregate

To gain access to the Melpa repository I have those settings in my 
.emacs file:


(require 'package)
(setq package-enable-at-startup nil)   ; To prevent initialising twice
(add-to-list 'package-archives '("gnu"   . 
"http://elpa.gnu.org/packages/; ) t)
(add-to-list 'package-archives '("melpa" . 
"http://melpa.milkbox.net/packages/;) t)

(package-initialize)

Have fun
Thierry









[O] org-ctrl-k-protect-subtree stopped working

2018-06-20 Thread Marcin Borkowski
Hi all,

I have

(setq org-ctrl-k-protect-subtree t)

in my init.el.  After an upgrade from an ancient version, Org stopped
asking me whether to kill a subtree.

Org mode version 9.1.13 (release_9.1.13-791-g842002)

Is it a bug?

--
Marcin Borkowski
http://mbork.pl