Re: [O] [PATCH] add "link" :results type for Babel

2018-04-11 Thread stardiviner


On 04/12/2018 04:55 AM, Nicolas Goaziou wrote:

Hello,

stardiviner  writes:


This patch try to support following way:

#+begin_src sh :results link :file "/tmp/test.txt"
echo "hello" > /tmp/test.txt
echo "test"
#+end_src

#+RESULTS:
[[file:/tmp/test.txt]]

Because:

- ~org-babel-execute-src-block~
   - ~(org-babel-get-src-block-info)~
 - (let* ((info .. (apply #'org-babel-merge-params ...
   - ~org-babel-merge-params~
 - [ ] *because* code ~(`(,(or :file :file-ext) . ,value) ...)~
   lines logic in function ~org-babel-get-src-block-info~, it
   merge "file" ~:results~, so override params plist :results
   value ~link~.
 - [ ] So I put ~link~ and ~graphics~ "~:results~" type into a
   separate group in constant
   ~org-babel-common-header-args-w-values~.

If anybody has better way, please improve my code.

IIRC, there is no technical difference between ":results graphics" and
":results link". So, what about simply stating that `link' and
`graphics' are equivalent, like, e.g., `table' and `vector' or `scalar'
and `verbatim'?

Note that `graphics' results are not properly documented in the current
manual. They should probably go in "Working with Source Code/Results of
Evaluation/Format" section.

updated.



-(results   . ((file list vector table scalar verbatim)
+(results   . (
+  ;; separate group to avoid been override by "file"
+  ;; :results in `org-babel-merge-params'.
+  (link)

`link' is not an output type. `graphics' is not defined here either.

Updated. I put "link" and "graphics" into result format group now.
This is really good. I have not come up with this.



+(ert-deftest test-ob/result-file-link-type-header-argument ()
+  "Ensure that the result is a link to a file.
+The file is just a link to :file value. Inhibit non-empty result write to 
:file."
+  (org-test-with-temp-text "#+begin_src shell :results value link :file 
\"/tmp/test.txt\"
+echo \"hello\" > /tmp/test.txt
+echo \"test\"
+#+end_src"
+   (org-babel-execute-src-block)
+   (goto-char (point-min))
+   (should (search-forward "[[file:/tmp/test.txt]]" nil nil))
+   (should (with-temp-buffer
+(insert-file-contents "/tmp/test.txt")
+(string=
+ "hello\n"
+ (buffer-substring-no-properties (point-min) (point-max)))

Note that this test already passes when "link" is substituted with "graphics".

Regards,

I think keep "graphics" result format test is necessary. Even though is 
is almost same way "link" result format test. Because I have some ideas 
on graphics result format. Might add in the future. Also it provide 
straight mean for result format. People can understand it clearly. What 
do you think?


I attached new generated patches.
>From 148d084ef100fb4ca32f8f19e36d4dcbe643b6b4 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Sun, 8 Apr 2018 20:56:28 +0800
Subject: [PATCH 1/2] ob-core.el: add "link" :results format for babel.

* lisp/ob-core.el (org-babel-execute-src-block): handle "link" :results
  format. Don't write result to :file specified file.

* etc/ORG-NEWS: declare new "link" :results format.

* doc/org-manual.org: add document for new result format "link".

* testing/lisp/test-ob.el (test-ob/result-file-link-type-header-argument):
  Add test for new added :results format "link".
---
 doc/org-manual.org  | 12 
 etc/ORG-NEWS|  9 +
 lisp/ob-core.el | 12 ++--
 testing/lisp/test-ob.el | 16 
 4 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index d787e5da4..afd968a38 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -17224,6 +17224,18 @@ follows from the type specified above.
  =raw= or =org= results for later scripting and automated
  processing.  Usage example: =:results value drawer=.
 
+- =link= ::
+
+ #+cindex: @samp{link}, header argument
+ When this result type used with header argument =:file=. Generate a
+ link to =:file= specified file. Instead of writing src block
+ evaluate non-empty result to =:file= specified file. Like following
+ example:
+
+ #+begin_src shell :results link :file "download.tar.gz"
+ wget -c "http://example.com/download.tar.gz;
+ #+end_src
+
 *** Handling
 :PROPERTIES:
 :UNNUMBERED: notoc
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0edd77115..3833b57b2 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -113,6 +113,15 @@ now sort according to the locale’s collation rules instead of by
 code-point.
 
 ** New features
+*** Add ~:results link~ support for org-babel
+This will support only insert file link without writing result to file.
+Like this case:
+#+begin_src shell :dir "data/tmp" :results link :file "crackzor_1.0.c.gz"
+wget -c "http://ben.akrin.com/crackzor/crackzor_1.0.c.gz;
+#+end_src
+
+#+RESULTS:

Re: [O] [ANN] OrgStruct is dead. Long live Orgalist.

2018-04-11 Thread stardiviner
Yes, seems no obviously advantage. (Why want to do the same thing like 
MELPA, right, maybe someday Org-mode ELPA has CI or etc, can be easily 
integrated???) But if want to outof contrib/, I thinkthis is a thinking too.



On 04/09/2018 10:47 AM, stardiviner wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Nicolas Goaziou  writes:


It cloud even be in an Org ELPA

Do You mean can publish package like MELPA separately?

- -- 
[ stardiviner ] don't need to convince with trends.

Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
   
-BEGIN PGP SIGNATURE-


iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAlrK1EgACgkQG13xyVro
msOgtwgAoMTgjrRsiK1FQ/bk+vmS5+RVx54ITtPTb2LLf/Kiur+IxixsDJ4mvD/5
Dej6I8kc7tM0QXFvH83j1VqJphBa+D88e5hjYZajyyd6ffeGofX/pfzPUnlw/Vur
WwEHi7IivhKO93gMTMVwtcfb8G4aps9s7gXGL7FZ24H7is+KMK2EthH4p03A4x0e
L9J4ha2WWblo+gGiBzWjwN5WhjyaT8IDZajoiEurxMHLlPdy7dG+rxs9OlnhC84/
HP/bpajRYt1C4d4HVhqKuEFwOIKbEoSmRb5+xPofM9n6mf7lsXlPEecZbdNzvBou
sLKV+XtaXYbyeUkgome5M3DFFbH6RQ==
=+YLO
-END PGP SIGNATURE-





[O] [PATCH] org-capture: Add a custom to control save target file or not.

2018-04-11 Thread tumashu
I use org-capture to capture text to a file of my mobile phone
with the help of tramp and termux's sshd, the save buffer is very
slow, so I want to org-capture-finalize just update buffer, and
I save buffer manually when need.


By the way, can we contribute org-mode with the help of PR feature in 
code.orgmode.org?


0001-org-capture-Add-a-custom-to-control-save-target-file.patch
Description: Binary data


Re: [O] Bug: org-capture files wrong date in capture template [9.1.7 (9.1.7-elpaplus @ /Users/rmirelan/.emacs.d/elpa/org-plus-contrib-20180226/)]

2018-04-11 Thread Nicolas Goaziou
Hello,

Robert Irelan  writes:

> Hi, that ended up being the problem. Specifically, the line at
> https://code.orgmode.org/bzg/org-mode/src/442e7a2911e3e0229b1b6dd1fe0449653274ec31/lisp/org-capture.el#L1013
> needs to be fixed to read instead
>
> (append `(0 0 ,org-extend-today-until)

You are right. Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Library of Babel confusion

2018-04-11 Thread Thomas S. Dye

Aloha Lawrence,

Lawrence Bottorff writes:

I'll try that, Thomas, but this was set up by simply doing the 
on-board
customize, i.e., it needs to have this corrected. So how do I 
request this

correction?


There are instructions here:

https://orgmode.org/org.html#Feedback

You'll need to indicate which customization option you've set and 
what you expected to happen vs. what actually happened.


I don't use customize and am not familiar with it, but when I 
looked through the Babel section this morning I didn't find an 
option to ingest a library of babel.  Perhaps I missed it, or it 
is found somewhere else?


All the best,
Tom



On Tue, Apr 10, 2018 at 3:26 PM, Thomas S. Dye  
wrote:



Aloha Lawrence,

You probably want (org-babel-lob-ingest  FILE)

All the best,
Tom


Lawrence Bottorff writes:

Thanks for the help. However, one mystery still remains: Why is 
this


 '(org-babel-lob-files (quote 
 ("~/org/worg/library-of-babel.org")))


in my init.el's custom-set-variables not getting handled? I 
always have to
do an org-babel-lob-ingest to actually get 
library-of-babel.org loaded.


On Fri, Apr 6, 2018 at 10:38 PM, Berry, Charles 
 wrote:





> On Apr 6, 2018, at 4:59 PM, Thomas S. Dye  > 
> wrote:

>

[Tom's response covering the main issues deleted]

> hth,
> Tom
>
> Lawrence Bottorff writes:
>
>> I guess I need more information. For example, what is C-c 
>> >> C-v v

doing
>> exactly? Then C-x C-e? And  M-x (symbol-function >> 
>> 'myelsquare)

doesn't
work.


`C-h k' is really your friend here. If you do not know it, 
try typing it

twice `C-h k C-h k'.

As for the specific keystrokes mentioned above:

,[ C-h k C-c C-v v ]
| C-c C-v v runs the command org-babel-expand-src-block 
(found in
| org-mode-map), which is an interactive autoloaded compiled 
Lisp

| function in ‘ob-core.el’.
|
| It is bound to C-c C-v v, C-c C-v C-v.
|
| (org-babel-expand-src-block  ARG INFO PARAMS)
|
| Expand the current source code block.
| Expand according to the source code block’s header
| arguments and pop open the results in a preview buffer.
|
| [back]
`

In your case, it shows that the `mtelsquare' src block 
expands to:



,
| (let ((x (quote 0)))
| (defun myelsquare (x)
|   (* x x))
| )
`


,[ C-h k C-x C-e ]
| C-x C-e runs the command eval-last-sexp (found in 
global-map), which
| is an interactive compiled Lisp function in 
‘elisp-mode.el’.

|
| It is bound to C-x C-e.
|
| (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)
|
| Evaluate sexp before point; print value in the echo area.
| Interactively, with prefix argument, print output into 
current buffer.

|
| Normally, this function truncates long output according to 
the value

| of the variables ‘eval-expression-print-length’ and
| ‘eval-expression-print-level’.  With a prefix argument of 
zero,
| however, there is no such truncation.  Such a prefix 
argument
| also causes integers to be printed in several additional 
formats

| (octal, hexadecimal, and character).
|
| If ‘eval-expression-debug-on-error’ is non-nil, which is 
the default,

| this command arranges for all errors to enter the debugger.
|
| [back]
`

So with point at the end of the preview buffer for myelsquare 
(which has

one `let' expression it it) it has the same effect as running
`eval-buffer'. viz, the elisp function `myelsquare' is 
created.


If you have gotten this far, there is an lisp function called
`myelsquare'
and the `symbol-function' expression will return its value 
when properly

`eval'ed. I misspoke before. I should have said

M-: (symbol-function 'myelsquare) RET

And that value is `(lambda (x) (* x x))'. Which simply shows 
you have

defun'ed a function and what it is.

Once you have an elisp function, the natural way to call it 
is

src_emacs-lisp{(myelsquare 1.5)}.

One thing you can do with LOB blocks is use them in header 
args of src

blocks just as you would use calls to ordinary src blocks.

HTH,

Chuck






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




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



Re: [O] [PATCH] add "link" :results type for Babel

2018-04-11 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> This patch try to support following way:
>
> #+begin_src sh :results link :file "/tmp/test.txt"
> echo "hello" > /tmp/test.txt
> echo "test"
> #+end_src
>
> #+RESULTS:
> [[file:/tmp/test.txt]]
>
> Because:
>
> - ~org-babel-execute-src-block~
>   - ~(org-babel-get-src-block-info)~
> - (let* ((info .. (apply #'org-babel-merge-params ...
>   - ~org-babel-merge-params~
> - [ ] *because* code ~(`(,(or :file :file-ext) . ,value) ...)~
>   lines logic in function ~org-babel-get-src-block-info~, it
>   merge "file" ~:results~, so override params plist :results
>   value ~link~.
> - [ ] So I put ~link~ and ~graphics~ "~:results~" type into a
>   separate group in constant
>   ~org-babel-common-header-args-w-values~.
>
> If anybody has better way, please improve my code.

IIRC, there is no technical difference between ":results graphics" and
":results link". So, what about simply stating that `link' and
`graphics' are equivalent, like, e.g., `table' and `vector' or `scalar'
and `verbatim'?

Note that `graphics' results are not properly documented in the current
manual. They should probably go in "Working with Source Code/Results of
Evaluation/Format" section.

> -(results . ((file list vector table scalar verbatim)
> +(results . (
> +;; separate group to avoid been override by "file"
> +;; :results in `org-babel-merge-params'.
> +(link)

`link' is not an output type. `graphics' is not defined here either.

> +(ert-deftest test-ob/result-file-link-type-header-argument ()
> +  "Ensure that the result is a link to a file.
> +The file is just a link to :file value. Inhibit non-empty result write to 
> :file."
> +  (org-test-with-temp-text "#+begin_src shell :results value link :file 
> \"/tmp/test.txt\"
> +echo \"hello\" > /tmp/test.txt
> +echo \"test\"
> +#+end_src"
> +   (org-babel-execute-src-block)
> +   (goto-char (point-min))
> +   (should (search-forward "[[file:/tmp/test.txt]]" nil nil))
> +   (should (with-temp-buffer
> +  (insert-file-contents "/tmp/test.txt")
> +  (string=
> +   "hello\n"
> +   (buffer-substring-no-properties (point-min) (point-max)))

Note that this test already passes when "link" is substituted with "graphics".

Regards,

-- 
Nicolas Goaziou



Re: [O] org-move-subtree-down whitespace dance

2018-04-11 Thread Nicolas Goaziou
Hello,

Marco Wahl  writes:

> After having stumbled over
>
> 
> https://emacs.stackexchange.com/questions/32144/org-mode-org-move-subtree-down-function-strange-behavior
>
> I also think the behavior of org-move-subtree-down is strange.
>
> What about pulling out the dance with the whitespace from
> org-move-subtree-down and just move the subtree as it is?

There's at least a minor issue. I you like to separate your heading with
N spaces, you must keep N blank lines at the end of the buffer at all
time. Granted, the current implementation requires the same thing before
the first headline, but those are easier to see and maintain.

Intuitively, I would say the current behaviour is better, but feel free
to provide a patch so we can test the other way.

Regards,

-- 
Nicolas Goaziou



Re: [O] Library of Babel confusion

2018-04-11 Thread Thomas S. Dye

Aloha Lawrence,

You probably want (org-babel-lob-ingest  FILE)

All the best,
Tom

Lawrence Bottorff writes:

Thanks for the help. However, one mystery still remains: Why is 
this


 '(org-babel-lob-files (quote 
 ("~/org/worg/library-of-babel.org")))


in my init.el's custom-set-variables not getting handled? I 
always have to
do an org-babel-lob-ingest to actually get library-of-babel.org 
loaded.


On Fri, Apr 6, 2018 at 10:38 PM, Berry, Charles 
 wrote:





> On Apr 6, 2018, at 4:59 PM, Thomas S. Dye  
> wrote:

>

[Tom's response covering the main issues deleted]

> hth,
> Tom
>
> Lawrence Bottorff writes:
>
>> I guess I need more information. For example, what is C-c 
>> C-v v doing
>> exactly? Then C-x C-e? And  M-x (symbol-function 
>> 'myelsquare) doesn't

work.


`C-h k' is really your friend here. If you do not know it, try 
typing it

twice `C-h k C-h k'.

As for the specific keystrokes mentioned above:

,[ C-h k C-c C-v v ]
| C-c C-v v runs the command org-babel-expand-src-block (found 
in
| org-mode-map), which is an interactive autoloaded compiled 
Lisp

| function in ‘ob-core.el’.
|
| It is bound to C-c C-v v, C-c C-v C-v.
|
| (org-babel-expand-src-block  ARG INFO PARAMS)
|
| Expand the current source code block.
| Expand according to the source code block’s header
| arguments and pop open the results in a preview buffer.
|
| [back]
`

In your case, it shows that the `mtelsquare' src block expands 
to:



,
| (let ((x (quote 0)))
| (defun myelsquare (x)
|   (* x x))
| )
`


,[ C-h k C-x C-e ]
| C-x C-e runs the command eval-last-sexp (found in 
global-map), which

| is an interactive compiled Lisp function in ‘elisp-mode.el’.
|
| It is bound to C-x C-e.
|
| (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)
|
| Evaluate sexp before point; print value in the echo area.
| Interactively, with prefix argument, print output into 
current buffer.

|
| Normally, this function truncates long output according to 
the value

| of the variables ‘eval-expression-print-length’ and
| ‘eval-expression-print-level’.  With a prefix argument of 
zero,

| however, there is no such truncation.  Such a prefix argument
| also causes integers to be printed in several additional 
formats

| (octal, hexadecimal, and character).
|
| If ‘eval-expression-debug-on-error’ is non-nil, which is the 
default,

| this command arranges for all errors to enter the debugger.
|
| [back]
`

So with point at the end of the preview buffer for myelsquare 
(which has

one `let' expression it it) it has the same effect as running
`eval-buffer'. viz, the elisp function `myelsquare' is created.

If you have gotten this far, there is an lisp function called 
`myelsquare'
and the `symbol-function' expression will return its value when 
properly

`eval'ed. I misspoke before. I should have said

M-: (symbol-function 'myelsquare) RET

And that value is `(lambda (x) (* x x))'. Which simply shows 
you have

defun'ed a function and what it is.

Once you have an elisp function, the natural way to call it is
src_emacs-lisp{(myelsquare 1.5)}.

One thing you can do with LOB blocks is use them in header args 
of src

blocks just as you would use calls to ordinary src blocks.

HTH,

Chuck






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



Re: [O] Library of Babel confusion

2018-04-11 Thread Berry, Charles


> On Apr 11, 2018, at 6:29 AM, Lawrence Bottorff  wrote:
> 
> I'll try that, Thomas, but this was set up by simply doing the on-board 
> customize, i.e., it needs to have this corrected. So how do I request this 
> correction?

The idiom Tom gave you is correct. There are no variables for you to handle 
yourself - it all happens under the hood.

Chuck

> 
> On Tue, Apr 10, 2018 at 3:26 PM, Thomas S. Dye  wrote:
> Aloha Lawrence,
> 
> You probably want (org-babel-lob-ingest  FILE)
> 
> All the best,
> Tom
> 
> 
> Lawrence Bottorff writes:
> 
> Thanks for the help. However, one mystery still remains: Why is this
> 
>  '(org-babel-lob-files (quote  ("~/org/worg/library-of-babel.org")))
> 
> in my init.el's custom-set-variables not getting handled? I always have to
> do an org-babel-lob-ingest to actually get library-of-babel.org loaded.
> 
> On Fri, Apr 6, 2018 at 10:38 PM, Berry, Charles  wrote:
> 
> 
> 
> > On Apr 6, 2018, at 4:59 PM, Thomas S. Dye  > wrote:
> >
> 
> [Tom's response covering the main issues deleted]
> 
> > hth,
> > Tom
> >
> > Lawrence Bottorff writes:
> >
> >> I guess I need more information. For example, what is C-c >> C-v v doing
> >> exactly? Then C-x C-e? And  M-x (symbol-function >> 'myelsquare) doesn't
> work.
> 
> 
> `C-h k' is really your friend here. If you do not know it, try typing it
> twice `C-h k C-h k'.
> 
> As for the specific keystrokes mentioned above:
> 
> ,[ C-h k C-c C-v v ]
> | C-c C-v v runs the command org-babel-expand-src-block (found in
> | org-mode-map), which is an interactive autoloaded compiled Lisp
> | function in ‘ob-core.el’.
> |
> | It is bound to C-c C-v v, C-c C-v C-v.
> |
> | (org-babel-expand-src-block  ARG INFO PARAMS)
> |
> | Expand the current source code block.
> | Expand according to the source code block’s header
> | arguments and pop open the results in a preview buffer.
> |
> | [back]
> `
> 
> In your case, it shows that the `mtelsquare' src block expands to:
> 
> 
> ,
> | (let ((x (quote 0)))
> | (defun myelsquare (x)
> |   (* x x))
> | )
> `
> 
> 
> ,[ C-h k C-x C-e ]
> | C-x C-e runs the command eval-last-sexp (found in global-map), which
> | is an interactive compiled Lisp function in ‘elisp-mode.el’.
> |
> | It is bound to C-x C-e.
> |
> | (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)
> |
> | Evaluate sexp before point; print value in the echo area.
> | Interactively, with prefix argument, print output into current buffer.
> |
> | Normally, this function truncates long output according to the value
> | of the variables ‘eval-expression-print-length’ and
> | ‘eval-expression-print-level’.  With a prefix argument of zero,
> | however, there is no such truncation.  Such a prefix argument
> | also causes integers to be printed in several additional formats
> | (octal, hexadecimal, and character).
> |
> | If ‘eval-expression-debug-on-error’ is non-nil, which is the default,
> | this command arranges for all errors to enter the debugger.
> |
> | [back]
> `
> 
> So with point at the end of the preview buffer for myelsquare (which has
> one `let' expression it it) it has the same effect as running
> `eval-buffer'. viz, the elisp function `myelsquare' is created.
> 
> If you have gotten this far, there is an lisp function called `myelsquare'
> and the `symbol-function' expression will return its value when properly
> `eval'ed. I misspoke before. I should have said
> 
> M-: (symbol-function 'myelsquare) RET
> 
> And that value is `(lambda (x) (* x x))'. Which simply shows you have
> defun'ed a function and what it is.
> 
> Once you have an elisp function, the natural way to call it is
> src_emacs-lisp{(myelsquare 1.5)}.
> 
> One thing you can do with LOB blocks is use them in header args of src
> blocks just as you would use calls to ordinary src blocks.
> 
> HTH,
> 
> Chuck
> 
> 
> 
> 
> 
> --
> Thomas S. Dye
> http://www.tsdye.com
> 



Re: [O] statistics with R, convert the result into an org table

2018-04-11 Thread Uwe Brauer
>>> "William" == William Denton  writes:

   > I don't think it is possible without a step in the middle, because
   > "Min.   :2." is all one string (in a cell in a matrix).

Correct is leaves the :

But I can live with that.




Re: [O] Bug: Editing cookie in table column breaks tabbing [9.1.9 (9.1.9-3-gb1a639-elpa @ /home/foo/.emacs.d/elpa/org-20180402/)]

2018-04-11 Thread Sebastian P . Luque
On Wed, 11 Apr 2018 13:17:49 +0200,
Nicolas Goaziou  wrote:

> Hello, "Sebastian P. Luque"  writes:

>> When `org-startup-align-all-tables' is t, then editing the  cookie
>> in a table causes subsequent tabbing inside the table to throw the
>> following trace:

>> Debugger entered--Lisp error: (args-out-of-range #("abcde" 0 1
>> (help-echo "Clipped table field, use `\\[org-table-edit-field]' to
>> edit.  Full value is:

> Could you provide an ECM? I couldn't reproduce the issue.

Biensur:

╭─ [ emacs_init.el ]
│ (package-initialize)
│ (toggle-debug-on-error)
│ (setq org-startup-align-all-tables t)
╰─

First line is to ensure the Elpa Org package is available.

╭─ [ bug.org ]
│ * Column width alignment
│ 
│ |   A |B | C |
│ | |  | <5>   |
│ | 123 | 1234 | 56789 |
╰─

and then do:

emacs -q -l emacs_init.el bug.org

Now edit the column width cookie a few times, hitting TAB after each
edit.  I haven't yet found what sequence of edits that triggers the
error in this example, as it seems inconsistent.  I tried switching
between different permutations of 2, 3, 4, 5, and eventually the
debugger is entered.  During normal use cases, I get into the error
right away.

-- 
Seb




Re: [O] statistics with R, convert the result into an org table

2018-04-11 Thread Uwe Brauer

   > 2018-04-11T14:30:58+0200 Uwe Brauer wrote:

   > Remove ":results output"

Thanks! That works nicely.




Re: [O] statistics with R, convert the result into an org table

2018-04-11 Thread William Denton

I don't think it is possible without a step in the middle, because
"Min.   :2." is all one string (in a cell in a matrix).

#+begin_src R :results output :var qual=qual :colnames yes
s <- summary(qual)
s[1]
#+end_src

#+RESULTS:
: [1] "Min.   :2.000  "

You would have to split each cell into two parts by splitting on the colon.  I 
think extract from tidyr [1] might do the job.


Bill

[1] http://tidyr.tidyverse.org/reference/extract.html

On 11 April 2018, Uwe Brauer wrote:


Hi

I use structure like this

Statistics with R

#+tblname: qual
| 8.3 | 1.4 |
| 7.3 | 5.6 |
|   2 | 1.3 |
| 5.7 | 9.3 |
| 5.3 | 5.9 |
|   4 | |
| 6.9 | |
#+begin_src R :results output :var qual=qual
summary(qual)
#+end_src

And obtain

#+RESULTS:
:V1  V2
:  Min.   :2.000   Min.   :1.3
:  1st Qu.:4.650   1st Qu.:1.4
:  Median :5.700   Median :5.6
:  Mean   :5.643   Mean   :4.7
:  3rd Qu.:7.100   3rd Qu.:5.9
:  Max.   :8.300   Max.   :9.3
:  NA's   :2.0

Is there a way to have the result already translated into an org table
resulting in

| V1  |   | |  V2 |   |
| Min.| 2.000 | Min.| 1.3 |   |
| 1st Qu. | 4.650 | 1st Qu. | 1.4 |   |
| Median  | 5.700 | Median  | 5.6 |   |
| Mean| 5.643 | Mean| 4.7 |   |
| 3rd Qu. | 7.100 | 3rd Qu. | 5.9 |   |
| Max.| 8.300 | Max.| 9.3 |   |


Uwe Brauer





--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ ---   GHG.EARTH: http://ghg.earth/
Caveat lector.  ---   STAPLR: http://staplr.org/



Re: [O] statistics with R, convert the result into an org table

2018-04-11 Thread Adonay Felipe Nogueira
2018-04-11T14:30:58+0200 Uwe Brauer wrote:
> #+tblname: qual
> | 8.3 | 1.4 |
>
> | 7.3 | 5.6 |
> |   2 | 1.3 |
> | 5.7 | 9.3 |
> | 5.3 | 5.9 |
> |   4 | |
> | 6.9 | |
>
> #+begin_src R :results output :var qual=qual
> summary(qual)
> #+end_src

Remove ":results output"

-- 
- Formas de contato: https://libreplanet.org/wiki/User:Adfeno#vCard

- Ativista do /software/ livre (não confundir com gratuito). Avaliador
  da liberdade de /software/ e de /sites/.

- Membro do LibrePlanet Brasil:
  https://libreplanet.org/wiki/Group:LibrePlanet_Brasil

- Comunicações sociais federadas padronizadas, onde o "social"
  permanece independente do fornecedor.

- #DeleteWhatsApp. Use o pai dele, #XMPP, federado e com padrão
  internacional: https://libreplanet.org/wiki/XMPP.pt

- #DeleteFacebook #DeleteInstagram #DeleteTwitter #DeleteYouTube. Use
  redes sociais federadas que suportam #ActivityPub, padrão
  internacional, como a rede Mastodon: https://joinmastodon.org/

- #DeleteNetflix #CancelNetflix. Evite #DRM:
  https://www.defectivebydesign.org/

- Quer enviar arquivos para mim? Veja:
  https://libreplanet.org/wiki/User:Adfeno#Arquivos

- Quer doar para mim, ou me contratar? Veja:
  https://libreplanet.org/wiki/User:Adfeno#Suporte

- Minhas contribuições:
  https://libreplanet.org/wiki/User:Adfeno#Contributions



Re: [O] Library of Babel confusion

2018-04-11 Thread Lawrence Bottorff
I'll try that, Thomas, but this was set up by simply doing the on-board
customize, i.e., it needs to have this corrected. So how do I request this
correction?

On Tue, Apr 10, 2018 at 3:26 PM, Thomas S. Dye  wrote:

> Aloha Lawrence,
>
> You probably want (org-babel-lob-ingest  FILE)
>
> All the best,
> Tom
>
>
> Lawrence Bottorff writes:
>
> Thanks for the help. However, one mystery still remains: Why is this
>>
>>  '(org-babel-lob-files (quote  ("~/org/worg/library-of-babel.org")))
>>
>> in my init.el's custom-set-variables not getting handled? I always have to
>> do an org-babel-lob-ingest to actually get library-of-babel.org loaded.
>>
>> On Fri, Apr 6, 2018 at 10:38 PM, Berry, Charles  wrote:
>>
>>
>>>
>>> > On Apr 6, 2018, at 4:59 PM, Thomas S. Dye  > wrote:
>>> >
>>>
>>> [Tom's response covering the main issues deleted]
>>>
>>> > hth,
>>> > Tom
>>> >
>>> > Lawrence Bottorff writes:
>>> >
>>> >> I guess I need more information. For example, what is C-c >> C-v v
>>> doing
>>> >> exactly? Then C-x C-e? And  M-x (symbol-function >> 'myelsquare)
>>> doesn't
>>> work.
>>>
>>>
>>> `C-h k' is really your friend here. If you do not know it, try typing it
>>> twice `C-h k C-h k'.
>>>
>>> As for the specific keystrokes mentioned above:
>>>
>>> ,[ C-h k C-c C-v v ]
>>> | C-c C-v v runs the command org-babel-expand-src-block (found in
>>> | org-mode-map), which is an interactive autoloaded compiled Lisp
>>> | function in ‘ob-core.el’.
>>> |
>>> | It is bound to C-c C-v v, C-c C-v C-v.
>>> |
>>> | (org-babel-expand-src-block  ARG INFO PARAMS)
>>> |
>>> | Expand the current source code block.
>>> | Expand according to the source code block’s header
>>> | arguments and pop open the results in a preview buffer.
>>> |
>>> | [back]
>>> `
>>>
>>> In your case, it shows that the `mtelsquare' src block expands to:
>>>
>>>
>>> ,
>>> | (let ((x (quote 0)))
>>> | (defun myelsquare (x)
>>> |   (* x x))
>>> | )
>>> `
>>>
>>>
>>> ,[ C-h k C-x C-e ]
>>> | C-x C-e runs the command eval-last-sexp (found in global-map), which
>>> | is an interactive compiled Lisp function in ‘elisp-mode.el’.
>>> |
>>> | It is bound to C-x C-e.
>>> |
>>> | (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)
>>> |
>>> | Evaluate sexp before point; print value in the echo area.
>>> | Interactively, with prefix argument, print output into current buffer.
>>> |
>>> | Normally, this function truncates long output according to the value
>>> | of the variables ‘eval-expression-print-length’ and
>>> | ‘eval-expression-print-level’.  With a prefix argument of zero,
>>> | however, there is no such truncation.  Such a prefix argument
>>> | also causes integers to be printed in several additional formats
>>> | (octal, hexadecimal, and character).
>>> |
>>> | If ‘eval-expression-debug-on-error’ is non-nil, which is the default,
>>> | this command arranges for all errors to enter the debugger.
>>> |
>>> | [back]
>>> `
>>>
>>> So with point at the end of the preview buffer for myelsquare (which has
>>> one `let' expression it it) it has the same effect as running
>>> `eval-buffer'. viz, the elisp function `myelsquare' is created.
>>>
>>> If you have gotten this far, there is an lisp function called
>>> `myelsquare'
>>> and the `symbol-function' expression will return its value when properly
>>> `eval'ed. I misspoke before. I should have said
>>>
>>> M-: (symbol-function 'myelsquare) RET
>>>
>>> And that value is `(lambda (x) (* x x))'. Which simply shows you have
>>> defun'ed a function and what it is.
>>>
>>> Once you have an elisp function, the natural way to call it is
>>> src_emacs-lisp{(myelsquare 1.5)}.
>>>
>>> One thing you can do with LOB blocks is use them in header args of src
>>> blocks just as you would use calls to ordinary src blocks.
>>>
>>> HTH,
>>>
>>> Chuck
>>>
>>>
>>>
>>>
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>


[O] org-move-subtree-down whitespace dance

2018-04-11 Thread Marco Wahl
Hello everyone,

After having stumbled over


https://emacs.stackexchange.com/questions/32144/org-mode-org-move-subtree-down-function-strange-behavior

I also think the behavior of org-move-subtree-down is strange.

What about pulling out the dance with the whitespace from
org-move-subtree-down and just move the subtree as it is?


Best regards
Marco





[O] statistics with R, convert the result into an org table

2018-04-11 Thread Uwe Brauer
Hi

I use structure like this

Statistics with R

#+tblname: qual
| 8.3 | 1.4 |
| 7.3 | 5.6 |
|   2 | 1.3 |
| 5.7 | 9.3 |
| 5.3 | 5.9 |
|   4 | |
| 6.9 | |
#+begin_src R :results output :var qual=qual
summary(qual)
#+end_src

And obtain

#+RESULTS:
:V1  V2 
:  Min.   :2.000   Min.   :1.3  
:  1st Qu.:4.650   1st Qu.:1.4  
:  Median :5.700   Median :5.6  
:  Mean   :5.643   Mean   :4.7  
:  3rd Qu.:7.100   3rd Qu.:5.9  
:  Max.   :8.300   Max.   :9.3  
:  NA's   :2.0  

Is there a way to have the result already translated into an org table
resulting in

| V1  |   | |  V2 |   |
| Min.| 2.000 | Min.| 1.3 |   |
| 1st Qu. | 4.650 | 1st Qu. | 1.4 |   |
| Median  | 5.700 | Median  | 5.6 |   |
| Mean| 5.643 | Mean| 4.7 |   |
| 3rd Qu. | 7.100 | 3rd Qu. | 5.9 |   |
| Max.| 8.300 | Max.| 9.3 |   |


Uwe Brauer 





Re: [O] Bug: Editing cookie in table column breaks tabbing [9.1.9 (9.1.9-3-gb1a639-elpa @ /home/foo/.emacs.d/elpa/org-20180402/)]

2018-04-11 Thread Nicolas Goaziou
Hello,

"Sebastian P. Luque"  writes:

> When `org-startup-align-all-tables' is t, then editing the  cookie in
> a table causes subsequent tabbing inside the table to throw the
> following trace:
>
> Debugger entered--Lisp error: (args-out-of-range #("abcde" 0 1 (help-echo 
> "Clipped table field, use `\\[org-table-edit-field]' to edit.  Full value is:

Could you provide an ECM? I couldn't reproduce the issue.

Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] macro with inline source does not work in table cells

2018-04-11 Thread Nicolas Goaziou
kabr...@3imail.com writes:

> Hi,
>
> I have defined a macro that uses an emacs-lisp inline source code. It
> works fine in all the usual places, except table cells. A more standard
> macro (that does not use a source code block) works fine. I have tried
> looking through the source code in the exporter, but cannot quite figure
> out why this isn't working.
>
> Would anyone have an idea of how to get the expected behavior? Below is
> an example.

inline source code is not supported in tables. You are expected to use 
`org-sbe'.

Regards,

-- 
Nicolas Goaziou



[O] Bug? org agenda does not display clock entries after jumping with "j" to another day

2018-04-11 Thread Rainer Stengele

All,

I have a simple Org file with this content:

* TODO Test agenda clockings
  CLOCK: [2018-04-11 Mi 11:30]--[2018-04-11 Mi 11:45] =>  0:15
  CLOCK: [2018-04-10 Di 11:30]--[2018-04-10 Di 11:45] =>  0:15
  CLOCK: [2018-04-09 Mo 11:30]--[2018-04-09 Mo 11:45] =>  0:15
  CLOCK: [2018-04-08 So 11:30]--[2018-04-08 So 11:45] =>  0:15

Starting the agenda with "C-c a a" the clock entry from today is displayed 
correctly:


Day-agenda (W15):
Mittwoch   11 April 2018
9:00..
  test:11:30-11:45Clocked:   (0:15) TODOTest 
agenda clockings


Scrolling through the days with "b" and "f" displays the entries correctly for 
the 4 days.
Now jumping to April 10th with "j" and selecting one of the 4 days displays an 
empty agenda:


Day-agenda (W15):


Now also scrolling through days with "f" and "b" does no more display the clock 
entries.
The same is true for weeks view. After jumping with "j" the clocked entries 
disappear.

I believe this is a bug.

Thank you.
Regards, Rainer