Re: Bug: refiling gobbles a newline and absorbs the next heading [9.1.9 (release_9.1.9-65-g5e4542 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)]

2020-01-08 Thread Miguel Morin
Hello,

I put "refiling" in the title as that is the moment when things go awry, so I 
noticed it when I refiled items.

I updated Org to 9.3.1 and confirm that the bug is still present. Because I got 
some compatibility problems, I tested it with `emacs -q`, in which I didn't 
have email, and then drafted the email after reverting to the built-in 9.1.9.

Below is the relevant part to reproduce the bug. What do you mean by ECM? Error 
Correction Mode? Engineering Change Management?

Regards,

Miguel

Start a file at `~/test.org` with:

```
* heading 1

* heading 2
  
* heading 3
```

Set this capture template:

```
(setq org-capture-templates
  '(("t" "Todo" entry (file+headline "~/test.org" "heading 1")
 "* TODO %?\n")))
```

add a capture item, delete newlines from the end of the org-capture buffer, and 
refile to "heading 3". The heading next to the refiled item is gobbled and both 
the org-capture item and the gobbled "heading 2" move to "heading 3".

[![Empty lines method, step 1 - create an org-capture item][1]][1]

[![Empty lines method, step 2 - delete lines from end of org-capture 
buffer][2]][2]

[![Empty lines method, step 3 - refile][3]][3]

  [1]: https://i.stack.imgur.com/6cUlo.png
  [2]: https://i.stack.imgur.com/GPwg8.png
  [3]: https://i.stack.imgur.com/tzAJI.png


On Thu, 02 Jan 2020 at 22:46 WET, Nicolas Goaziou wrote:

> Hello,
>
> Miguel Morin  writes:
>
>> TL;DR: starting a capture item and deleting the new lines at the end
>> of the capture buffer gobbles the next heading, and refiling moves the
>> gobbled heading along with the new capture item.
>
> I'm confused. Your bug title is about refiling, yet, all your message is
> about setting up capture in various ways.
>
> Could you update Org (Org 9.3.1 has been released last week) and try
> again? Also, could you provide an ECM demonstrating how to reproduce the
> issue in a simple way, not necessarily how you tried to work around
> it ? :)
>
> Thank you.
>
> Regards,




How do I add #+name: to a structured template?

2020-01-08 Thread Vladimir Nikishkin
I have the following in the .emacs:
(add-to-list 'org-structure-template-alist
 '("SO" . "src scheme :exports both :results output\n?\n"))

A structured template block is automatically prepended with #+start_ ,
but I actually need it to insert
#+name: 
#+start_srt ... etc.

How can I do that with the new template expansion mechanism?

-- 
Yours sincerely, Vladimir Nikishkin



Re: Bug: org-babel-expand-noweb-references is very slow [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.3/lisp/org/)]

2020-01-08 Thread Vladimir Nikishkin
Ouch, that was unexpected.

The manual for my version only includes four mentions if the noweb-ref
header argument. Is it becoming deprecated?

What does "apparently don't need" actually mean? That is, when should I use
the name, and when the header argument? What can the header argument do
that the name cannot?


Nicolas Goaziou  於 2020年1月9日 週四 01:23 寫道:

> Hello,
>
> Vladimir Nikishkin  writes:
>
> > I am attaching the file in which tangling is still slow.
> >
> > The file is quite big, but that alone doesn't seem to be the reason
> > for slowliness (I tried adding 1M-long words in the random places of
> > the previous mwe).
> >
> > You can see the result by C-c C-v C-v'ing the code block at the
> > "Ramanujan numbers" heading.
> >
> > Below is the profiler report for C-c C-v C-v'ing.with the heaviest
> > blocks expanded:
>
> This is because you're using :noweb-ref, which _is_ slow, although you
> apparently don't need it in the document. Use name keyword instead,
> e.g.,
>
> #+name: primetest
> #+begin_src scheme :exports both :results output
>   (define (smallest-divisor n)
> (find-divisor n 2))
>   (define (find-divisor n test-divisor)
> (cond ((> (square test-divisor) n) n)
>   ((divides? test-divisor n) test-divisor)
>   (else (find-divisor n (+ test-divisor 1)
>   (define (divides? a b) (= (remainder b a) 0))
>
>   (define (prime? n)
> (= n (smallest-divisor n)))
> #+end_src
>
>
> Regards,
>
> --
> Nicolas Goaziou
>


[PATCH] org-manual: Use ol-man.el in "Adding Hyperlink Types"

2020-01-08 Thread Tom Gillespie
Hi,
This is a tiny change to the manual to account for the change from org
-> ol in the org-man example. There may be other references in the
manual that have similar issues but I did not check.
Tom
From b2b8088f958379552f5c9dc228dcda56b7e6f738 Mon Sep 17 00:00:00 2001
From: Tom Gillespie 
Date: Wed, 8 Jan 2020 16:13:49 -0800
Subject: org-manual: Use ol-man.el in "Adding Hyperlink Types"

doc/org-manual.org (Adding Hyperlink Types): Update the name of the
example file from org-man.el to ol-man.el to reflect the renaming of
files related to org links.

I found this thorougly confusing when trying to (require 'org-man)
since it was clearly referenced as being in contrib, hopefully this
change will prevent anyone else from encountering the same confusion.

TINYCHANGE
---
 doc/org-manual.org | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 22c2a9fb6..f9437976c 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -19695,10 +19695,11 @@ process of adding Org links to Unix man pages, which look like this
 : [[man:printf][The printf manual]]
 
 #+texinfo: @noindent
-The following =org-man.el= file implements it
+The following =ol-man.el= file implements it
 
 #+begin_src emacs-lisp
-;;; org-man.el - Support for links to man pages in Org mode
+;;; ol-man.el - Support for links to man pages in Org mode
+(require 'ol)
 (require 'org)
 
 (org-link-set-parameters "man"
@@ -19741,8 +19742,8 @@ The following =org-man.el= file implements it
   (`ascii (format "%s (%s)" desc path))
   (t path
 
-(provide 'org-man)
-;;; org-man.el ends here
+(provide ol-man)
+;;; ol-man.el ends here
 #+end_src
 
 #+texinfo: @noindent
@@ -19750,13 +19751,15 @@ To activate links to man pages in Org, enter this in the Emacs init
 file:
 
 #+begin_src emacs-lisp
-(require 'org-man)
+(require 'ol-man)
 #+end_src
 
 #+texinfo: @noindent
-A review of =org-man.el=:
+A review of =ol-man.el=:
+
+1. First, =(require 'ol)= ensures that =ol.el= is loaded and
+   =(require 'org)= ensures =org.el= is loaded.
 
-1. First, =(require 'org)= ensures =org.el= is loaded.
 
 2.
 
-- 
2.24.1



Re: Working out what face is used

2020-01-08 Thread Norman Walsh
Norman Walsh  writes:
> In this case, I can’t put the cursor on the text. I’ve made a quick
> skim of org-sticky-header.el and don’t see any obvious use of a
> specific face. So I’m a bit stumped.

FWIW, I made a rainbow out of the background colors and worked out
what face it was, but I am still curious if there was a more direct
approach.

Be seeing you,
  norm

-- 
Norman Walsh  | Four things come not back: the spoken
http://nwalsh.com/| word, the sped arrow, time past, the
  | neglected opportunity.--Omar Ibnal-Halif


signature.asc
Description: PGP signature


Re: Working out what face is used

2020-01-08 Thread Tim Cross


You could try M-x list-faces-display, which will list all the defined
faces with samples for each face. If your lucky, it will show the face
your seeing (and you can change it).


Norman Walsh  writes:

> Hello,
>
> This is a tangentially Org-related question. If I enable
> org-sticky-headers, it works just fine. I get, for example, at the top
> of the buffer:
>
>   ** Top level heading / Second level heading
>
> Which is correct. But “ / ” and the rest of the line after “Second
> level heading” are in some unknown face. It has an odd gray background
> and appears to be underlined in white.
>
> For ordinary text in a buffer, I can put my cursor on the text and use
> “C-u x =” to see what face is being used.
>
> In this case, I can’t put the cursor on the text. I’ve made a quick
> skim of org-sticky-header.el and don’t see any obvious use of a
> specific face. So I’m a bit stumped.
>
> Be seeing you,
>   norm


-- 
Tim Cross



Working out what face is used

2020-01-08 Thread Norman Walsh
Hello,

This is a tangentially Org-related question. If I enable
org-sticky-headers, it works just fine. I get, for example, at the top
of the buffer:

  ** Top level heading / Second level heading

Which is correct. But “ / ” and the rest of the line after “Second
level heading” are in some unknown face. It has an odd gray background
and appears to be underlined in white.

For ordinary text in a buffer, I can put my cursor on the text and use
“C-u x =” to see what face is being used.

In this case, I can’t put the cursor on the text. I’ve made a quick
skim of org-sticky-header.el and don’t see any obvious use of a
specific face. So I’m a bit stumped.

Be seeing you,
  norm

-- 
Norman Walsh  | The future belongs to those who believe
http://nwalsh.com/| in the beauty of their dreams.--Eleanor
  | Roosevelt


signature.asc
Description: PGP signature


Bug: Error with repeated tasks - wrong-type-argument: stringp nil [9.3.1 (9.3.1-elpa @ /home/leandron/.emacs.d/elpa/org-20191230/)]

2020-01-08 Thread Leandro Noferini
Ciao a tutti,

I have a problem with my org-mode: when I try to enter a repeated task I
get the error on the subject:

wrong type argument: stringp nil

This is the debug:


Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^/tmp_mnt/" nil)
  abbreviate-file-name(nil)
  org-id-add-location("db0381a4-b9b1-44a3-88ea-1e5f65d97189" nil)
  org-id-get(1 create)
  org-id-get-create(t)
  org-clone-subtree-with-time-shift(2)
  funcall-interactively(org-clone-subtree-with-time-shift 2)
  call-interactively(org-clone-subtree-with-time-shift nil nil)
  command-execute(org-clone-subtree-with-time-shift)




Emacs  : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10)
 of 2019-08-29
Package: Org mode version 9.3.1 (9.3.1-elpa @ 
/home/leandron/.emacs.d/elpa/org-20191230/)



Re: Bug: org-babel-expand-noweb-references is very slow [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.3/lisp/org/)]

2020-01-08 Thread Nicolas Goaziou
Hello,

Vladimir Nikishkin  writes:

> I am attaching the file in which tangling is still slow.
>
> The file is quite big, but that alone doesn't seem to be the reason
> for slowliness (I tried adding 1M-long words in the random places of
> the previous mwe).
>
> You can see the result by C-c C-v C-v'ing the code block at the
> "Ramanujan numbers" heading.
>
> Below is the profiler report for C-c C-v C-v'ing.with the heaviest
> blocks expanded:

This is because you're using :noweb-ref, which _is_ slow, although you
apparently don't need it in the document. Use name keyword instead,
e.g.,

#+name: primetest
#+begin_src scheme :exports both :results output
  (define (smallest-divisor n)
(find-divisor n 2))
  (define (find-divisor n test-divisor)
(cond ((> (square test-divisor) n) n)
  ((divides? test-divisor n) test-divisor)
  (else (find-divisor n (+ test-divisor 1)
  (define (divides? a b) (= (remainder b a) 0))

  (define (prime? n)
(= n (smallest-divisor n)))
#+end_src


Regards,

-- 
Nicolas Goaziou



orgmode and electric-quote-mode

2020-01-08 Thread Christoph Groth
Hello,

On Emacs 26, I like to enable electric-quote-mode.  That provides me
“proper quotes” when writing text.

Org files are mostly text, so it’s nice that electric-quote-mode is
active there as well.  However, there can be source code blocks where
I would like the “electric” functionality disabled (just like in
programming modes it is enabled only for the comments).

Has anyone found a solution to this problem already?

Thanks
Christoph