Re: [O] Bug: org-babel-tangle-file [9.2.4 (9.2.4-3-g7bc6f8-elpaplus @ /home/stettberger/.emacs.d/elpa/org-plus-contrib-20190701/)]

2019-08-22 Thread Nicolas Goaziou
Hello,

Christian Dietrich  writes:

> I think a found a bug in org-babel-tangle-file. It closes an user-opened
> buffer if called with a symlink that points to the same file. Please see
> the attached patch, which fixes the problem for me.

Applied. Thank you!

Regards,

-- 
Nicolas Goaziou



Re: [O] org-babel-insert-result doesn't comma escape properly

2019-08-22 Thread Nicolas Goaziou
Hello,

"Berry, Charles"  writes:

> Here is an ECM:
>
> #+begin_src emacs-lisp :wrap example
> "line 1
> ,* headline 2
> ,* headline 3
> ,* headline 4
> ,* headline 5
> "
> #+end_src
>
>
> With today's master, the last `headline' is not escaped in the example
> block this produces when executed.

Indeed. Fixed.

> It seems to me that dropping the let binding for `before-finish' and placing
>
> (unless no-escape
>   (org-escape-code-in-region
>beg end))
>
> before the insertions of 'start' and 'finish' should handle this
> properly. And trying that on the above ECM gives the right result.

But then, another regression tests fail.

> I do not see why it was needed.

I think it was to store the location of the inner part of the block.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Fixing org-store-link for eshell

2019-08-22 Thread Nicolas Goaziou
Hello,

Abhishek Chandratre  writes:

> I wanted to use org-store-link for eshell, but it failed.
> Looked like dired-directory was nil, I fixed it by calling (eshell/pwd) to
> get pwd.
> I tested with and without TRAMP, works like a charm.

Applied. I added a `declare-function' to silence compilation warning.

Thank you!

Regards,

-- 
Nicolas Goaziou



Re: [O] Insert subheading at top respect content

2019-08-22 Thread Nathan Neff
On Wed, Aug 21, 2019 at 12:28 AM Carsten Dominik  wrote:

> Hi Nate,
>
> What do you mean by passing "the right argument".  Which argument do you
> want to pass?
>

I mean the hard-coded 1 on org-next-visible-heading.


>
> At first, I thought the direct way to fix your function would be
>
> (defun njn-subheading-respect-content ()
>   (interactive "")
>   (org-next-visible-heading 1)
>   (org-insert-heading nil)
>  )
>
> because in your original example, the heading did already have a child.
> However, that is not guaranteed, and in the above implementation, the
> new heading is created with the level of the next headline, and that
> next headline might be a sibling, a child or a parent.  So we need to
> explicitly set the level:
>
> (defun njn-subheading-respect-content ()
>   (interactive "")
>   (let ((level (car (org-heading-components
> (org-next-visible-heading 1)
> (org-insert-heading nil)
> (while (<= (car (org-heading-components)) level)
>   (org-demote
>
> I am using (possibly repeated) calls to `org-demote', because this will
> do everything correct, also with stuff like org-odd-levels only etc.
>
>
Cool!  I tried the above solution and made some modifications:

(defun njn-subheading-respect-content ()
  (interactive "")
  (org-show-children)
  (let
((level (car (org-heading-components)))
  )
(outline-next-heading)
(org-insert-heading)
(while (<= (car (org-heading-components)) level)
  (org-demote))
  ))


I added (org-show-children) to work when cursor is on a folded heading.

I removed the 1 argument to org-next-visible-heading

This appears to do what I want - thanks for the help!




> Hope this helps.
>
> - Carsten
>
>
>
>
>
> On Wed, Aug 21, 2019 at 12:43 AM Nathan Neff 
> wrote:
>
>>
>>
>> On Fri, Aug 16, 2019 at 4:03 AM Carsten Dominik  wrote:
>>
>>>
>>>
>>> On Fri, Aug 16, 2019 at 10:21 AM Nathan Neff 
>>> wrote:
>>>
 Hello all,

 Something that's eluded me all this time has been an
 "Insert subheading, after the content, but before other subheadings"

 For example:
 If my cursor is anywhere between lines 1 and 4, I would like the
 subheading
 to be inserted at line 5.

 1* Heading
 :PROPERTIES:...
 2 Some content
 3 More content
 4
 5** Subheading 1
 6** Subheading 2
 7
 I know there's org-insert-subheading and C-u which respects content, but
 respect-content will insert a subheading at line 7 in the example
 above.  I would
 like to have a new subheading at line 4.

>>>
>>> What about C-c C-n M-RET
>>>
>>
>> Thanks Carsten - I created a function:
>> (defun njn-subheading-respect-content ()
>>   (interactive "")
>>   (org-next-visible-heading 1)
>>   (org-insert-subheading 't)
>>  )
>>
>> But I'm trying to find out where to get the "correct" arg
>> to org-next-visible-heading - I have hard-coded a 1 in the
>> above example, but this produces the following subheading:
>>
>> * Heading <-exec when cursor on this heading
>> Some content about Heading
>> *** New heading is inserted here (and is the wrong level - should be 2
>> instead of 3)
>> ** Sub1
>> ** Sub2
>>
>> I will mess with this function a bit and post if I find a solution.
>>
>> Thanks,
>> --Nate
>>
>>>
>>> Carsten
>>>
>>>

 Thanks,
 --Nate

>>>


Re: [O] Insert subheading at top respect content

2019-08-22 Thread Carsten Dominik
You are welcome. Good to hear that you have a good solution now.

Carsten



On Thu, Aug 22, 2019 at 9:14 PM Nathan Neff  wrote:

>
>
> On Wed, Aug 21, 2019 at 12:28 AM Carsten Dominik  wrote:
>
>> Hi Nate,
>>
>> What do you mean by passing "the right argument".  Which argument do you
>> want to pass?
>>
>
> I mean the hard-coded 1 on org-next-visible-heading.
>
>
>>
>> At first, I thought the direct way to fix your function would be
>>
>> (defun njn-subheading-respect-content ()
>>   (interactive "")
>>   (org-next-visible-heading 1)
>>   (org-insert-heading nil)
>>  )
>>
>> because in your original example, the heading did already have a child.
>> However, that is not guaranteed, and in the above implementation, the
>> new heading is created with the level of the next headline, and that
>> next headline might be a sibling, a child or a parent.  So we need to
>> explicitly set the level:
>>
>> (defun njn-subheading-respect-content ()
>>   (interactive "")
>>   (let ((level (car (org-heading-components
>> (org-next-visible-heading 1)
>> (org-insert-heading nil)
>> (while (<= (car (org-heading-components)) level)
>>   (org-demote
>>
>> I am using (possibly repeated) calls to `org-demote', because this will
>> do everything correct, also with stuff like org-odd-levels only etc.
>>
>>
> Cool!  I tried the above solution and made some modifications:
>
> (defun njn-subheading-respect-content ()
>   (interactive "")
>   (org-show-children)
>   (let
> ((level (car (org-heading-components)))
>   )
> (outline-next-heading)
> (org-insert-heading)
> (while (<= (car (org-heading-components)) level)
>   (org-demote))
>   ))
>
>
> I added (org-show-children) to work when cursor is on a folded heading.
>
> I removed the 1 argument to org-next-visible-heading
>
> This appears to do what I want - thanks for the help!
>
>
>
>
>> Hope this helps.
>>
>> - Carsten
>>
>>
>>
>>
>>
>> On Wed, Aug 21, 2019 at 12:43 AM Nathan Neff 
>> wrote:
>>
>>>
>>>
>>> On Fri, Aug 16, 2019 at 4:03 AM Carsten Dominik  wrote:
>>>


 On Fri, Aug 16, 2019 at 10:21 AM Nathan Neff 
 wrote:

> Hello all,
>
> Something that's eluded me all this time has been an
> "Insert subheading, after the content, but before other subheadings"
>
> For example:
> If my cursor is anywhere between lines 1 and 4, I would like the
> subheading
> to be inserted at line 5.
>
> 1* Heading
> :PROPERTIES:...
> 2 Some content
> 3 More content
> 4
> 5** Subheading 1
> 6** Subheading 2
> 7
> I know there's org-insert-subheading and C-u which respects content,
> but
> respect-content will insert a subheading at line 7 in the example
> above.  I would
> like to have a new subheading at line 4.
>

 What about C-c C-n M-RET

>>>
>>> Thanks Carsten - I created a function:
>>> (defun njn-subheading-respect-content ()
>>>   (interactive "")
>>>   (org-next-visible-heading 1)
>>>   (org-insert-subheading 't)
>>>  )
>>>
>>> But I'm trying to find out where to get the "correct" arg
>>> to org-next-visible-heading - I have hard-coded a 1 in the
>>> above example, but this produces the following subheading:
>>>
>>> * Heading <-exec when cursor on this heading
>>> Some content about Heading
>>> *** New heading is inserted here (and is the wrong level - should be 2
>>> instead of 3)
>>> ** Sub1
>>> ** Sub2
>>>
>>> I will mess with this function a bit and post if I find a solution.
>>>
>>> Thanks,
>>> --Nate
>>>

 Carsten


>
> Thanks,
> --Nate
>



[O] Org mode pollutes the narrow-map

2019-08-22 Thread Omar Antolín Camarena
Hello everyone,

Does it seems a little rude that Org mode binds its own narrowing commands in 
the global narrow-map?

You can find this in org.el starting at line 19018:

#+begin_src emacs-lisp
   Narrow map
  (org-defkey narrow-map "s" #'org-narrow-to-subtree)
  (org-defkey narrow-map "b" #'org-narrow-to-block)
  (org-defkey narrow-map "e" #'org-narrow-to-element)
#+end_src

I don't need or really want those commands bound in non-org buffers. I think it 
would be better to bind them (to C-x n s, C-x n b and C-x n e) in org-mode-map. 
This is the approach taken by AUCTeX, for example. (To be clear, I mean AUCTeX 
has some narrowing commands and it binds them to C-x n e and C-x n g in its own 
keymaps.)

-- 
Omar Antolín Camarena



[O] Bug header argumednt :file does not produce a file or a link to the file

2019-08-22 Thread Charles Millar via Emacs-orgmode
Org mode version 9.2.5 (release_9.2.5-494-g4848b8 @ 
/usr/local/share/org-mode/lisp/)
GNU Emacs 27.0.50 (build 59, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) 
of 2019-08-22


ECM

#+begin_src sh :file test.rec
cat << EOF
# -*- mode: rec -*-

%rec: somerecord

Account: something
Amount: 0.00

 end of file
EOF

#+end_src

I expect that when I execute the above code block that

1. An external file test.rec is produced with contents

# -*- mode: rec -*-

%rec: somerecord

Account: something
Amount: 0.00

 end of file

 and

2. A link to that file is placed below the source code block

Instead all I get is a table and no external file is created

#+RESULTS:
| # |   -*- | mode: | rec | -*- |
| %rec: | somerecord | | | |
| Account: | sometyhing | | | |
| Amount: | 0.0 | | | |
|  | end | of | file | |

I reported this earlier but my subject line was not correct.

Charlie Millar



[O] [PATCH] Add org-agenda-show-indirect variable

2019-08-22 Thread tumashu



0001-Add-org-agenda-show-indirect-variable.patch
Description: Binary data