Re: issue tracker?

2020-06-06 Thread Bastien
Hi Mario,

Mario Frasca  writes:

> I sent the pdf for contributing, and I have a question on how to use
> this email-based issue tracker:

Beware that this is not meant to be an issue tracker.

> how do I get the list of open issues?  complete with the status
> accepted/wont-fix/whatever?

Please read these two announcements:

https://orgmode.org/list/87y2p64xo7@gnu.org/
https://orgmode.org/list/87ftbe2487@gnu.org/

Let me know if you have any question.

Best,

-- 
 Bastien



FWD: Org-Babel Support for Powershell

2020-06-06 Thread General discussions about Org-mode.
Hi,

I ask the maintainer of org-babel Bastien Guerry , if it is 
possible to include Powershell support for org-babel. Monsieur Guerry told me 
to ask you via email.

Powershell 5.1 is now an important tool for Infrastructure as Code in the 
Windows Server world. Windows administrator often encounter mixed IT Landscape 
with Windows and Linux servers. While it is possible to do network automation 
with Python with org-babel for the Linux server - you still cannot do Literate 
Programming in Powershell for Windows server.

I think Literate Programming is a very productive idea for system 
administration. It is very difficult to establish a Living Documentation policy 
with Powershell, because of the lack of Literate Programming tools with 
Powershell support. Currently available Powershell support for Powershell is 
limited to syntax highlighting and external execution of Powershell commands 
from code fences. The results of execution of Powershell code snippets is not 
shown within the Emacs buffer.

With Powershell 7 we got now a cross-platform scripting language for Windows 
and Linux OS. I think in the future Powershell administration will get more and 
more important - not only for deployment, but also for cyber security defense 
of Windows server.
 
Yours sincerely

Stanislaw Lem

-- 
 Securely sent with Tutanota. Get your own encrypted, ad-free mailbox: 
 https://tutanota.com


Date: Jun 5, 2020, 00:03
From: stanislaw_...@tutanota.com
To: b...@bzg.fr
Subject: Org-Babel Support for Powershell


> Bonjour Monsieur,
>
> Do you plan to include Powershell in org-babel ?
>
> Powershell is an important scripting languages for administration of Windows 
> servers. I like to write installation scripts with the literate programming 
> paradigm, but I cannot find a good tool - org-babel already supports Python, 
> which is very important for network automation. It will be a perfect match, 
> if it will be possible to write Python and Powershell in the same org-babel 
> file.
>
> Thanks for your time.
>
> Yours sincerely
>
> Stanislaw
>
>
> -- 
> Securely sent with Tutanota. Get your own encrypted, ad-free mailbox: 
> https://tutanota.com
>



org-babel-tangle not using relative links

2020-06-06 Thread Jeremias Gonzalez
I cannot seem to be able to make org-babel-tangle respect the setting of 
org-babel-tangle-use-relative-file-links to t. Here is my process after 
launching "emacs -Q" (the default for 
org-babel-tangle-use-relative-file-links appears to be true in this 
configuration):


1. Write example org file named test.org with the following basic 
contents, making sure that the top line is refreshed with C-c C-c:


#+PROPERTY: header-args :tangle test.py :comments link
* My top level
Here is my description
#+BEGIN_SRC python
print("This is my code")
#+END_SRC

2. Run M-x org-babel-tangle on the org file, which produces test.py with 
the following contents:


# [[file:d:/mytest/test.org::*My%20top%20level][My top level:1]]
print("This is my code")
# My top level:1 ends here

As can be seen in the first line, it uses an absolute file path 
containing my org file and py file, rather than the expected relative one.


I looked through the ob-tangle.el file to try and see why this is the 
case, and it looks like there's some negative boolean result in this if 
statement in the org-babel-tangle-single-block function which causes it 
to skip over the code that would make use of the relative path:


(if (and org-babel-tangle-use-relative-file-links
 (string-match org-link-types-re link)
 (string= (match-string 0 link) "file"))

(on the online copy of the code, this is the region under consideration:

https://code.orgmode.org/bzg/org-mode/src/master/lisp/ob-tangle.el#L475

I have not yet tried the most recent development copy because I do not 
see considerable difference in the relevant lines compared to the 
version of ob-tangle.el I have, but I can try the development copy as a 
next step)


Here is the additional bug reporter output, on my Windows 10 64 bit 
computer.


Emacs  : GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ c:/Useful 
Programs/emacs-26.3-x86_64/share/emacs/26.3/lisp/org/)




Re: New mailing list archive at https://orgmode/list/

2020-06-06 Thread Bastien
Hi Marco,

Marco Wahl  writes:

> E.g. I see the line
>
>   Archived-At: 
>
> Could this line be forged to point to the newly created location within
> https://orgmode.org/list?

Yes, this header needs to be fixed.  

Note that it is not set by mailman itself, so mailman admins cannot
fix it.  I'll discuss this with gmane.io maintainers.

-- 
 Bastien



Re: FWD: Org-Babel Support for Powershell

2020-06-06 Thread Russell Adams
On Fri, Jun 05, 2020 at 11:32:45PM +0200, stanislaw_lem--- via General 
discussions about Org-mode. wrote:
> With Powershell 7 we got now a cross-platform scripting language for Windows
> and Linux OS.

Can you provide an example script you would run, and the example output?
Basically a minimum working example, except the part where Babel would run it
for you?

What executable does it need to run?

Does Powershell have a REPL, or is it single commands?

These would help figure out if Babel could work with it. I have the impression
Babel wraps REPL languages quite easily. You'll have more luck trying to have
this feature added if you can help supply this kind of information.

I think Org-Babel working with many languages is a noble goal, but I expect
there would be difficulty getting Powershell support added to the core
distribution. It might be limited to a separate package as it is very specific
to a Windows only non-free language from a vendor with a long and sordid history
of anti-OSS practices.

My opinion is I would never consider using Powershell on Linux, despite your
positive impression.

--
Russell Adamsrlad...@adamsinfoserv.com

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

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



begin_quote

2020-06-06 Thread Tory S. Anderson
A couple questions here.

when I type =

Re: FWD: Org-Babel Support for Powershell

2020-06-06 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


stanislaw_lem--- via General discussions about Org-mode. 
 writes:

> Hi,
>
> I ask the maintainer of org-babel Bastien Guerry , if it is 
> possible to include Powershell support for org-babel. Monsieur Guerry told me 
> to ask you via email.
>
> Powershell 5.1 is now an important tool for Infrastructure as Code in the 
> Windows Server world. Windows administrator often encounter mixed IT 
> Landscape with Windows and Linux servers. While it is possible to do network 
> automation with Python with org-babel for the Linux server - you still cannot 
> do Literate Programming in Powershell for Windows server.
>
> I think Literate Programming is a very productive idea for system 
> administration. It is very difficult to establish a Living Documentation 
> policy with Powershell, because of the lack of Literate Programming tools 
> with Powershell support. Currently available Powershell support for 
> Powershell is limited to syntax highlighting and external execution of 
> Powershell commands from code fences. The results of execution of Powershell 
> code snippets is not shown within the Emacs buffer.
>
> With Powershell 7 we got now a cross-platform scripting language for Windows 
> and Linux OS. I think in the future Powershell administration will get more 
> and more important - not only for deployment, but also for cyber security 
> defense of Windows server.
>  
> Yours sincerely
>
> Stanislaw Lem

I remember already there are some ob-powershell relative projects. You might
want to work and improve features on those work. And integrate it into Org Mode.

- - https://gist.github.com/cbilson/ae0d90d163be4d769f8a15ddb58292bc
- - https://github.com/togakangaroo/ob-pwsh

- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7boZ4UHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPAmAgAsoj1vDfVKtMEM5HcUgA8I62qmNar
SaamgjPPmjlgtlpHZ1GspwGsm/ba9lgzG5iJKULHNgM/Kclf12crjakX+SsR0bVA
e6wtytimwPUw16h5t5vDByuHle8jmfpN9M9vfogc2F2eC5zbKU9uR4jw8FI8kPqp
KtKhX0EKqR1jLwNz4HxPYH7rQiCh/YNlandcVpZ5jRpG1BB+ivpQ5MHpnfImB7ub
xyNpyg5ICAVZuHTyoSrDIh/F5ojK6untfytt06xuTkV8GASt9iG40XxZmyeDznqA
zkgvQP8jPrfXkge7MPvrCq7zF2jLppqoMmqq3i5dJWL3uEkcNF2qAuIF0A==
=lofo
-END PGP SIGNATURE-



Re: Bug: ob-python mangles multiline :var values [9.3.6 (release_9.3.6-397-ga089600)]

2020-06-06 Thread Jack Kamm
Hi,

Here's my second attempt to fix the issue. I'll wait a few days for
comments before merging, to try and avoid causing a bug like last time.

It turns out the problem was deeper than just the :var argument,
multiline strings in the body were also getting mangled. For example,
this block had the same problem as the original report:

#+begin_src python
  text = """a
  b
  c
  """
  return text
#+end_src

#+RESULTS:
: a
:   b
:   c

My fix this time was to use functions from python.el to indent, and to
detect whether we are in a string and shouldn't be indented.

I also added a couple more unit tests, one for multiline strings, and
one for the variable scope/assignment issue that Matt reported.

Cheers,
Jack

>From 179178d39f6216172e1a070f570cf941f99b1a89 Mon Sep 17 00:00:00 2001
From: Jack Kamm 
Date: Sat, 6 Jun 2020 10:59:23 -0700
Subject: [PATCH] ob-python.el: Fix multiline strings in non-session :results
 value

* lisp/ob-python.el (org-babel-python-evaluate-external-process): Use
functions from python.el to indent lines, avoiding multiline strings.
* testing/lisp/test-ob-python.el (test-ob-python/multiline-var): Set
test as expected to succeed.
(test-ob-python/multiline-str): Add test for multiline string in body.
(test-ob-python/header-var-assignment): Test that :var is in correct
scope and can be assigned to.

cf. https://orgmode.org/list/87tv009l9a@gmail.com/#t
---
 lisp/ob-python.el  | 14 +-
 testing/lisp/test-ob-python.el | 20 +++-
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index dbcfac08d..622f69ce3 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -296,11 +296,15 @@ (defun org-babel-python-evaluate-external-process
 			(if (member "pp" result-params)
 			org-babel-python-pp-wrapper-method
 			  org-babel-python-wrapper-method)
-			(mapconcat
-			 (lambda (line) (format "\t%s" line))
-			 (split-string (org-remove-indentation (org-trim body))
-   "[\r\n]")
-			 "\n")
+			(with-temp-buffer
+			 (insert body)
+			 (goto-char (point-min))
+			 (while (< (point) (point-max))
+			   (unless (python-syntax-context 'string)
+			 (python-indent-shift-right (line-beginning-position)
+			(line-end-position)))
+			   (forward-line 1))
+			 (buffer-string))
 			(org-babel-process-file-name tmp-file 'noquote
 		 (org-babel-eval-read-file tmp-file))
 (org-babel-result-cond result-params
diff --git a/testing/lisp/test-ob-python.el b/testing/lisp/test-ob-python.el
index 763942b16..e3f0571a1 100644
--- a/testing/lisp/test-ob-python.el
+++ b/testing/lisp/test-ob-python.el
@@ -174,7 +174,6 @@ (ert-deftest test-ob-python/assign-underscore ()
 	(org-babel-execute-src-block)
 
 (ert-deftest test-ob-python/multiline-var ()
-  :expected-result :failed
   (should
(equal "a\nb\nc"
 	  (org-test-with-temp-text "#+begin_src python :var text=\"a\\nb\\nc\"
@@ -182,6 +181,25 @@ (ert-deftest test-ob-python/multiline-var ()
 #+end_src"
 	(org-babel-execute-src-block)
 
+(ert-deftest test-ob-python/multiline-str ()
+  (should
+   (equal "a\nb\nc"
+	  (org-test-with-temp-text "#+begin_src python
+text=\"a\\nb\\nc\"
+return text
+#+end_src"
+	(org-babel-execute-src-block)
+
+(ert-deftest test-ob-python/header-var-assignment ()
+  (should
+   (equal "success"
+	  (org-test-with-temp-text "#+begin_src python :var text=\"failure\"
+text
+text=\"success\"
+return text
+#+end_src"
+	(org-babel-execute-src-block)
+
 (provide 'test-ob-python)
 
 ;;; test-ob-python.el ends here
-- 
2.27.0



Re: issue tracker?

2020-06-06 Thread Mario Frasca

Hi Bastien,


The tool is experimental: if it proves useful, let's try to keep it,
otherwise let's drop it: our main focus should be in recruiting new
developers to help with the codebase.


very interesting approach.

sounds like you don't want to manage the status changes a bit tighter.  
I know, I can check the code, but it's more practical if we mention it 
here explicitly.  anybody can send status change emails?  I mean, this 
is an open list, anybody who just knows how to put a header to an email 
can confirm a bug?  on the other hand, I never tried to add extra 
headers using thunderbird.


apart from the technical aspect, I would suggest: anybody can 'vote-for' 
a bug, and you keep a counter on voted-for.   but only a maintainer can 
'confirm' (that fixing that bug is desirable). then we new contributors 
can choose which confirmed bug is easy enough for us to make an 
attempt.  or which fits our interests and skills.  or which has 
accumulated most votes, hasn't been rejected, so we can remind the 
maintainer.


… if the "main focus" is recruiting, I would also suggest a category 
"good first issue".


On 06/06/2020 02:57, Bastien wrote:

Hi Mario,

Beware that this is not meant to be an issue tracker.


I understand, not a bug "tracking" tool, but it sounds like it's able to 
shed some light in the dark.


thank you and cheers,

Mario



Re: begin_quote

2020-06-06 Thread William Denton

On 6 June 2020, Tory S. Anderson wrote:

Secondly, spoiled by things like smartparens, I love selecting a blog and then 
surrounding it in quotes/brackets in one action. It would be wonderful if 
there were a way to do this for quote/export blocks. Is it already there, or 
is there a reason it's not?


C-c C-, will do that.  It'll pop up a buffer with all the options for what to do 
based on the next key.


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



join tables from different files

2020-06-06 Thread Uwe Brauer


Hi 

I know I can either user 
(org-insert-dblock:aggregate)
(org-insert-dblock:join)

To join or aggregate tables with in the same files. 

But can  I join tables from different files?

Thanks

Uwe Brauer 




RE: FWD: Org-Babel Support for Powershell

2020-06-06 Thread Gustav Wikström
Hi,

Org babel support for Powershell is a great idea!

Powershell is very ...*ahem*... powerful, and it would likely benefit many 
users if it was usable and executable from within Org mode!

> -Original Message-
> From: Emacs-orgmode  On Behalf
> Of Russell Adams
> Sent: den 6 juni 2020 12:43
> To: emacs-orgmode@gnu.org
> Subject: Re: FWD: Org-Babel Support for Powershell
> 
> On Fri, Jun 05, 2020 at 11:32:45PM +0200, stanislaw_lem--- via General
> discussions about Org-mode. wrote:
> > With Powershell 7 we got now a cross-platform scripting language for Windows
> > and Linux OS.
> 
> Can you provide an example script you would run, and the example output?
> Basically a minimum working example, except the part where Babel would run it
> for you?

I know the question wasn't for me. But since I'm answering to your mail I can 
just as well provide an example anyhow:

#+begin_src powershell
  2+2
#+end_src

#+RESULTS:
: 4

> I think Org-Babel working with many languages is a noble goal, but I expect
> there would be difficulty getting Powershell support added to the core
> distribution. It might be limited to a separate package as it is very specific
> to a Windows only non-free language from a vendor with a long and sordid
> history
> of anti-OSS practices.

There should be zero issues in including it into core. Powershell is 
MIT-licensed and works across all platforms.

> My opinion is I would never consider using Powershell on Linux, despite your
> positive impression.

And I say the opposite. I would certainly use it!

/of topic
It's safe to say the free software movement has gained a strong footing in the 
software world. If it's "enemies" from the past are starting to walk in the 
same direction it would serve the free software advocates well to embrace and 
further encourage those steps. It would in my opinion be signs of maturity and 
true, good intentions. Judge not from where one comes, but for where one is 
heading.

Kind regards
Gustav



Re: join tables from different files

2020-06-06 Thread tbanelwebmin
Yes you can.
Use an org-id

Suppose you have a table in file x.org, under some title:

- x.org --
* title

| a  |  b |
|+|
| aa |  5 |
| bb |  7 |
| aa | 11 |
--


Add an ID by calling: M-x org-id-get-create. You end up with:

- x.org --
* title
  :PROPERTIES:
  :ID:   c8b8bb22-e42e-426f-afb0-4cb19aed27ad
  :END:

| a  |  b |
|+|
| aa |  5 |
| bb |  7 |
| aa | 11 |
--

Globally save the new ID by calling M-: (org-id-locations-save). You will see 
c8b8bb22-e42e-426f-afb0-4cb19aed27ad in the ~/.emacs.d/.org-id-locations file.


In another file, say y.org, you may now reference this remote table with the ID 
in an aggregated, transposed, or joined block:

- y.org --
#+BEGIN: aggregate :table "c8b8bb22-e42e-426f-afb0-4cb19aed27ad" :cols "a 
vsum(b)"
| a  | vsum(b) |
|+-|
| aa |  16 |
| bb |   7 |
#+END:
--

The wizard for creating the aggregated (or joined, or transposed) block does 
not (yet) complete remote tables names, only buffer-local ones. The wizard may 
be called with C-c C-x x (or C-x C-x i on older versions of Org Mode).


Note that those global IDs are also used by the spreadsheet remote() function. 
Example:

- z.org --
|  b |
|  5 |
|  7 |
| 11 |
#+TBLFM: $1=remote(c8b8bb22-e42e-426f-afb0-4cb19aed27ad,@@#$2)
--


Have fun
Thierry

Le 06/06/2020 à 22:40, Uwe Brauer a écrit :

> Hi 
>
> I know I can either user 
> (org-insert-dblock:aggregate)
> (org-insert-dblock:join)
>
> To join or aggregate tables with in the same files. 
>
> But can  I join tables from different files?
>
> Thanks
>
> Uwe Brauer 
>
>
>