Re: [O] [PATCH] org-src-edit support open edit buffer bellow current window

2018-03-16 Thread stardiviner

Hi, @Nicolas is this patch still has any thing need to change?

Maybe this is missed, just popup to take a little of your time. Sorry 
for disturb.



On 03/13/2018 06:19 PM, stardiviner wrote:

I regenerated the patch file.

- mentioned `org-src-window-setup' in commit message
- added `TINYCHANGE` in commit message
- added change in `ORG-NEWS'





Re: [O] Link abbreviations: include abbreviation table and linkwords with spaces

2018-03-16 Thread ST
Hello,

to those engineers, who are responsible for adding new features: does this case
of enabling linkwords with spaces (see below) qualifies as a new feature
request? If yes - where should I file it?

Thank you!



> 
> > Why should this not be parse-able? Cut #+LINK: from the beginning, URL
> > (last token) from the end, and the rest will be "link word", even with
> > (several) spaces in between...
> 
> Can we be sure so-called URL part will never contain a space? You put
> a constraint either on the linkword or on the "URL" part.

1. If I were to choose on which part to put a constraint - I'll do so
with the "URL" part as it appears only once and in the best case as meta
data in comments, while "link word" can appear tens or hundreds of times
in the text itself, which needs to look nice.

2. Spaces in URLs a rare, while all docs that have more than one word in
their title look nicer with spaces. I found only 3 cases here:
https://orgmode.org/manual/External-links.html

3. Anyway the problem of spaces in the URLs is not a new one - you have
the same in bash. Solution - just put URL part in "URL", as you usually
do on command line. And as you already do defining
org-link-abbrev-alist:

("url-to-ja" . "http://translate.google.fr/translate?sl=en&tl=ja&u=%h";)

so for the cases where there must be spaces in the URL do:

#+LINK: My Book "path/to/My Book.org"

but by default in normal case just use:

#+LINK: My Book path/to/My_Book.org

What is your opinion? Can this qualify as feature request?

Thanks!





[O] R output with session polluted with ascii color codes

2018-03-16 Thread Tyler Smith
Hi,

The printed output of some R functions includes ascii color codes (i.e., 
). This causes problems with R code blocks evaluated with the :session 
option. I've pasted a file below that demonstrates the problem. (should I 
attach it as a file? not sure what's preferable).

I can't find a way to disable this feature from R. However, I did find a way to 
filter out these codes from the babel side. The function of interest is 
~org-babel-R-evaluate-session` in ob-R.el. Adding a ~(replace-regexp-in-string 
ansi-color-control-seq-regexp "" ...)~ form around the output strips away the 
color codes so they don't mess up the output.  I've included that code in the 
example. If that makes sense I can put that together as a patch. If that 
doesn't make sense, please let me know how to fix this!

Best,

Tyler

* Reproducible Example

Start with ~emacs -Q~, then evaluate each of the following code blocks
in turn.

#+BEGIN_SRC elisp setup
(require 'package)
(setq package-load-list
  '((org-plus-contrib t)
(ess t)
(julia-mode t)))
(package-initialize)
(require 'org)
(require 'ess)

(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (R . t)
   (shell . t)))
#+END_SRC

#+RESULTS:

If you don't already have ~tidyr~ and ~dplyr~ installed, you need to
do that before running the following:

#+BEGIN_SRC R :results output
library(tidyr)
library(dplyr)
as_tibble(iris)
#+END_SRC

#+RESULTS:
#+begin_example
# A tibble: 150 x 5
   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
   
 1 5.103.50 1.40   0.200 setosa 
 2 4.903.00 1.40   0.200 setosa 
 3 4.703.20 1.30   0.200 setosa 
 4 4.603.10 1.50   0.200 setosa 
 5 5.003.60 1.40   0.200 setosa 
 6 5.403.90 1.70   0.400 setosa 
 7 4.603.40 1.40   0.300 setosa 
 8 5.003.40 1.50   0.200 setosa 
 9 4.402.90 1.40   0.200 setosa 
10 4.903.10 1.50   0.100 setosa 
# ... with 140 more rows
#+end_example

#+BEGIN_SRC R :results output :session RSESSION
library(tidyr)
library(dplyr)
as_tibble(iris)
#+END_SRC

#+RESULTS:
#+begin_example

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

filter, lag

The following objects are masked from ‘package:base’:

intersect, setdiff, setequal, union
# A tibble: 150 x 5
   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
     
    
  
 1 5.103.50 1.40   
0.200 setosa 
 2 4.903.00 1.40   
0.200 setosa 
 3 4.703.20 1.30   
0.200 setosa 
 4 4.603.10 1.50   
0.200 setosa 
 5 5.003.60 1.40   
0.200 setosa 
 6 5.403.90 1.70   
0.400 setosa 
 7 4.603.40 1.40   
0.300 setosa 
 8 5.003.40 1.50   
0.200 setosa 
 9 4.402.90 1.40   
0.200 setosa 
10 4.903.10 1.50   
0.100 setosa 
# ... with 140 more rows
#+end_example

* Proposed Fix

Evaluating the following replaces the built-in function with my fix:

#+BEGIN_SRC elisp fix
(defun org-babel-R-evaluate-session
(session body result-type result-params column-names-p row-names-p)
  "Evaluate BODY in SESSION.
If RESULT-TYPE equals `output' then return standard output as a
string.  If RESULT-TYPE equals `value' then return the value of the
last statement in BODY, as elisp."
  (cl-case result-type
(value
 (with-temp-buffer
   (insert (org-babel-chomp body))
   (let ((ess-local-process-name
  (process-name (get-buffer-process session)))
 (ess-eval-visibly-p nil))
 (ess-eval-buffer nil)))
 (let ((tmp-file (org-babel-temp-file "R-")))
   (org-babel-comint-eval-invisibly-and-wait-for-file
session tmp-file
(format org-babel-R-write-object-command
(if row-names-p "TRUE" "FALSE")
(if column-names-p
(if row-names-p "NA" "TRUE")
  "FALSE")
".Last.value" (org-babel-process-file-name tmp-file 'noquote)))
   (org-babel-R-process-value-result
(org-babel-result-cond result-params
  (with-temp-buffer
(insert-file-content

Re: [O] R output with session polluted with ascii color codes

2018-03-16 Thread William Denton

On 16 March 2018, Tyler Smith wrote:


# A tibble: 150 x 5
  Sepal.Length Sepal.Width Petal.Length Petal.Width Species
    
    
 1 5.103.50 1.40   
0.200 setosa
 2 4.903.00 1.40   
0.200 setosa


I tried the example in my configured setup and didn't get the ASCII codes.  I 
don't know why and didn't dig into it, but I could; for now I figured I'd just 
mention this.


Bill
--
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] R output with session polluted with ascii color codes

2018-03-16 Thread Tyler Smith
On Fri, Mar 16, 2018, at 11:25 AM, William Denton wrote:
> 
> I tried the example in my configured setup and didn't get the ASCII codes.  I 
> don't know why and didn't dig into it, but I could; for now I figured I'd 
> just 
> mention this.
> 

Thanks for checking. I should have mentioned that I'm running 27.0.50 with org 
9.1.7 and ess 17.11. I see this problem with emacs -Q and regular emacs. If 
you're using the same versions and don't see this, then there should be 
something I can do in my config to fix it.

Best,

Tyler



Re: [O] Export to LaTeX buffer

2018-03-16 Thread Hoffmann, Jobst
Am Mittwoch, den 14.03.2018, 14:57 +0100 schrieb Nicolas Goaziou:
> "Hoffmann, Jobst"  writes:
> 
> > make:  Org mode version 9.1.7 (release_9.1.7-516-gbc7b24.dirty =>
> 
>^
> > /usr/share/emacs/site-lisp/org)
> 
> Could your local changes interfere with the export process?

No, these local changes are done to see the call chain. It ended up at
line 6223, where post-process is called. This function is LaTeX-mode,
which is defined as an alias for latex-mode. latex-mode is defined in
tex-mode, but I don't have the sources. Anyway, this is the point where
the shit happens.

I got around by defining a small loaddef file, which provides the
missing function. This ends up with an error, but the buffer which I
need is generated and I can do my final steps on it.

If you find a better solution, please let me know.

> 
> > I'm quite desperated, do you have an idea?
> 
> Not really.
> 
> Regards,

Best regards
Jobst
-- 
Prof. Dr. Jobst HoffmannTel:   +49 (241) 6009-5 31 59
Fachhochschule Aachen Abt. Jülich   Fax:   +49 (241) 6009-5 31 89
Fachbereich 09  email: j.hoffm...@fh-aachen.de


Re: [O] R output with session polluted with ascii color codes

2018-03-16 Thread William Denton

On 16 March 2018, Tyler Smith wrote:

Thanks for checking. I should have mentioned that I'm running 27.0.50 with org 
9.1.7 and ess 17.11. I see this problem with emacs -Q and regular emacs. If 
you're using the same versions and don't see this, then there should be 
something I can do in my config to fix it.


I think we're the same---Org says it's 9.1.6, but I just compiled it fresh from 
source five minutes ago, so it should be up to date.  Not sure what's going on 
there.  I recompiled Emacs from fresh source, too, and updated the ESS package 
(17.11, ELPA 20180314.612).


Anyway, I tried again, and there was still no problem in Emacs.  That made me 
wonder if the difference was in R.  When I run "as_tibble(iris)" in the R 
console in a terminal I don't get the ASCII colour codes, so maybe that's where 
the difference lies?  I'm running R 3.4.2, compiled from source, on Ubuntu 
17.10.


Is there an R user on the list who sees the coloured text in the R console and 
can try the example in Org?


#+BEGIN_SRC R :results output :session RSESSION
library(tidyr)
library(dplyr)
as_tibble(iris)
#+END_SRC

Bill
--
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] R output with session polluted with ascii color codes

2018-03-16 Thread Tyler Smith
On Fri, Mar 16, 2018, at 2:55 PM, William Denton wrote:
> On 16 March 2018, Tyler Smith wrote:
> 
> Anyway, I tried again, and there was still no problem in Emacs.  That made me 
> wonder if the difference was in R.  When I run "as_tibble(iris)" in the R 
> console in a terminal I don't get the ASCII colour codes, so maybe that's 
> where 
> the difference lies?  I'm running R 3.4.2, compiled from source, on Ubuntu 
> 17.10.

I've tried this as well, outside of Emacs. For me, it depends on which terminal 
emulator I use. xterm displays the colours, while gnome terminal does not. 
Which is odd, because I use ansi colour codes for my prompt and ls output 
(etc), and those do display as expected in both xterm and gnome terminal.

Weird!

Thanks,

Tyler



Re: [O] [PATCH] org-src-edit support open edit buffer bellow current window

2018-03-16 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> Hi, @Nicolas is this patch still has any thing need to change?

It doesn't apply on master branch. Could you rebase it against HEAD and
send it again?

Thank you.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Link abbreviations: include abbreviation table and linkwords with spaces

2018-03-16 Thread Nicolas Goaziou
Hello,

ST  writes:

> to those engineers, who are responsible for adding new features: does this 
> case
> of enabling linkwords with spaces (see below) qualifies as a new feature
> request?

I have no objection, but it needs to be tested carefully.

> If yes - where should I file it?

It is already filed here, on the ML. However, I suggest to give it a go,
as it may be faster that waiting for someone to implement it.

Regards,

-- 
Nicolas Goaziou



Re: [O] Update org-agenda-ndays in org-mode documentation

2018-03-16 Thread Nicolas Goaziou
Hello,

Khalfani Wadlington  writes:

> The documentation for org-agenda-custom-commands
>  at
> https://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html uses
>
>
> org-agenda-ndays
>
> in the customization instead of
>
> org-agenda-span
>
> org-agenda-ndays  is deprecated in org-version 9.
>
>
> Can somebody update it because it took me an embarrassingly long time to
> figure out what was wrong with my customization.

Fixed. Thank you.

Note that Worg is community-driven. Feel free to ask for write access
and edit it to your heart's contents.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] ob-sql.el: Improve Oracle connection and usage for ob-sql.

2018-03-16 Thread Nicolas Goaziou
Hello,

pierre.techouey...@free.fr (Pierre Téchoueyres) writes:

> So I attached two patches:
> - the first (0001-ORG-NEWS-...) correct the example in order to match to the 
> code,
> - the second (0001-ob-sql.el...) correct the codein order to match to the 
> example.
>
> Personnaly I prefer the last as it match better with the habits of
> thoses who uses Oracle's products (We talk almost ever in term of
> database than in term of servers).
>
> But it's up to you.

I applied the second patch, with a slight refactoring.

Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] column view with display-line-numbers-mode

2018-03-16 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> The display-line-numbers-mode introduced in recent Emacs versions is
> very nice and works very well generally.  However, org is not aware of
> it and this causes a minor problem with the display of the header line
> in column view mode.
>
> The line numbers are displayed between the fringe and the actual
> contents of the lines and so the text starts some distance from the
> window border.  The header has no line numbers so starts immediately
> after the fringe.  See attached image.
>
>
>
> Not a major problem but I thought I would mention it.  Affects the
> æsthetic in me.  :-)

I don't use Emacs 26 yet, so I have no clue about how to fix it. Do you
have an idea about how it could be done? Another option is to ask Emacs
devel for advice.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Matching tags: results incomplete when mixing group tags and their ancestors [9.1.7 (9.1.7-12-g74f6ed-elpaplus @ /home/martin/.emacs.d/elpa/org-plus-contrib-20180305/)]

2018-03-16 Thread Nicolas Goaziou
Hello,

Martin Kampas  writes:

> This seems to fix the bug.

Thank you. Would you mind also providing a couple of tests for that?

Regards,

-- 
Nicolas Goaziou



Re: [O] column view with display-line-numbers-mode

2018-03-16 Thread Eric S Fraga
On Friday, 16 Mar 2018 at 23:04, Nicolas Goaziou wrote:

[...]

> I don't use Emacs 26 yet, so I have no clue about how to fix it. Do you
> have an idea about how it could be done? Another option is to ask Emacs
> devel for advice.

I have no idea.  I'll try asking on emacs dev group.  I'll see if I can
find a more generic example of where this fails.

thanks,
eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-303-g6cf5fc.dirty


signature.asc
Description: PGP signature


Re: [O] [PATCH] org-src-edit support open edit buffer bellow current window

2018-03-16 Thread stardiviner

regenerated patch against HEAD now. Check it out. Thanks for your review.


On 03/17/2018 05:47 AM, Nicolas Goaziou wrote:

Hello,

stardiviner  writes:


Hi, @Nicolas is this patch still has any thing need to change?

It doesn't apply on master branch. Could you rebase it against HEAD and
send it again?

Thank you.

Regards,



>From fc84014b600afb3eb23fc2e73c359aed5c0791af Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Tue, 13 Mar 2018 01:23:52 +0800
Subject: [PATCH] org-src.el: (org-src-window-setup) support open edit src
 window below.

TINYCHANGE
---
 etc/ORG-NEWS| 2 ++
 lisp/org-src.el | 6 ++
 2 files changed, 8 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 01a9361df..c14bbe1d4 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -113,6 +113,8 @@ now sort according to the locale’s collation rules instead of by
 code-point.
 
 ** New features
+*** Add support for open src block in below window
+Set option ~org-src-window-setup~ to ~'split-window-below~.
 *** Add support for links to LaTeX equations in HTML export
 Use MathJax links when enabled (by ~org-html-with-latex~), otherwise
 add a label to the rendered equation.
diff --git a/lisp/org-src.el b/lisp/org-src.el
index dfa2ae3de..5d3c2e538 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -155,6 +155,8 @@ Possible values for this option are:
 
 current-windowShow edit buffer in the current window, keeping all other
   windows.
+split-window-below Show edit buffer below the current window, keeping all
+   other windows.
 other-window  Use `switch-to-buffer-other-window' to display edit buffer.
 reorganize-frame  Show only two windows on the current frame, the current
   window and the edit buffer.  When exiting the edit buffer,
@@ -164,6 +166,7 @@ other-frame   Use `switch-to-buffer-other-frame' to display edit buffer.
   :group 'org-edit-structure
   :type '(choice
 	  (const current-window)
+	  (const split-window-below)
 	  (const other-frame)
 	  (const other-window)
 	  (const reorganize-frame)))
@@ -746,6 +749,9 @@ If BUFFER is non-nil, test it instead."
 (`current-window (pop-to-buffer-same-window buffer))
 (`other-window
  (switch-to-buffer-other-window buffer))
+(`split-window-below
+ (select-window (split-window-vertically))
+ (pop-to-buffer-same-window buffer))
 (`other-frame
  (pcase context
(`exit
-- 
2.16.2