Re: [O] Missing documentation for #+macro: xxx (eval ...)

2019-03-17 Thread Carlos Pita
> just what the subject says. It seems an important feature to me but
> I'm unable to find any reference to it in
> https://orgmode.org/manual/Macro-replacement.html.
>

Strangely I do find it here:

https://orgmode.org/manual/Macro-Replacement.html#Macro-Replacement

The only difference being that "replacement" is capitalized.

I had been having this feeling of accessing to different versions of the
documentation for some time now. Is there any double indexing of the docs?
I reached both pages from Google.

>


[O] #+RESULTS still upper case after executing babel block

2019-03-17 Thread Carlos Pita
Hi all,

despite the new lower case convention the #+results directive auto
generated after evaluation of babel blocks is still upper case.

Best regards
--
Carlos



Re: [O] [ANN] Changes to link syntax

2019-03-17 Thread stardiviner


Nicolas Goaziou  writes:

> Hello,
>
> stardiviner  writes:
>
>> Hi, @Nicolas, will you release a method to update all existing Org
>> file links?
>
> This is not limited to file links.
>
> There is no method that can, with certainty, convert old syntax into the
> new one. More accurately, it is possible to convert them with:
>
> (org-link-escape (org-link-decode URI))
>
> but in some cases, it may be difficult to tell when the URI should be
> decoded in the first place.
>
> I suggest to first try the linter on a document. Once we know it detects
> with a good ratio links to convert, we can write a wrapper to also
> convert them.

I agree, but I have so many Org files.

#+begin_src sh :async
find ~/Org/ -iname "*.org" -print | wc -l
#+end_src

#+RESULTS[<2019-03-16 16:34:21> d5afbee25c7529c23db70bb758b4bb1e7bdad9a3]:
: 9872

So I have to consider a safer and larger method to upgrade link. I can't
manually open every Org files and run linter on them. (Maybe linter can run on
Org files automatically in programtically way?) Seems I can wait for better
solution now.

>
>> I don't know which special escaped characters need to be converted.
>
> %20, %25, %5B and %5D.

This is helpful, I will try to use external command-line tools to search and
replace them. Like ripgrep.el wapper, etc. Then use wgrep mode to query-replace.
This might be more safely.

I'm wandering whether is it possible to extract my Org links out for testing
before I really apply upgrade solution on my mess Org files. Because once I
applied method, I will lose original data. Of course I can backup all files. I
did backup them regularly about 1 week repeatedly.

Also this upgrade experience can help Org Mode figure out a flow about how to do
backward compatibility broken steps. That will reduce other user's damage. :)

Seems this will keep me spin on before new link syntax commit for a while. I
always catch up the latest Org Mode code as I like it so much.

>
> Regards,

Thanks for your working :)

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

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



Re: [O] bug? 'org-ctrl-c-ctrl-c-final-hook not run

2019-03-17 Thread Thomas Plass
Marco,

thanks for clearing this up.

Marco Wahl wrote at 20:42 on March 17, 2019:
: 
: Possibly it's a good idea to realize the implementation of your idea
: independent of C-c C-c.  And postpone the binding with C-c C-c.

I've developed something that initially started off as a predicate to
be called and used by Lisp, but adding an interactive mode was easy
and turns the whole thing into an Org add-on.

There are no inherent dependencies.  Binding with C-c C-c would just
be a recommendation to users as a convenient and natural way to access
the functionality.

On this note: is this list the proper channel to publish initial
versions of add-ons and solicit feedback?

Regards

Thoams



Re: [O] bug? 'org-ctrl-c-ctrl-c-final-hook not run

2019-03-17 Thread Marco Wahl
thu...@arcor.de (Thomas Plass) writes:

> This is a question for Org API users regarding
> 'org-ctrl-c-ctrl-c-final-hook and how it is to be understood.
>
> As per the docstring
>
>This can be used to add additional functionality to the C-c C-c key
>which executes context-dependent commands.  This hook is run after
>any other test, ...
>
> should the 'message in the hook function below be executed?
>
> (add-hook 'org-ctrl-c-ctrl-c-final-hook
>   (function (lambda ()
>   (message "org-ctrl-c-ctrl-c-final-hook called from %s"
>(org-element-type (org-element-context)))
>   t)))
>
> In fact, the hook isn't run at all, although it makes no assumptions
> whatsoever about its context.  

Your hook runs if no other C-c C-c functionality jumped in.  You could
apply C-c C-c at several locations in an Org buffer to see your hook in
action.

> Is this the way things are intended or is this behaviour a bug?

I guess this is intended.  You can add functionality for C-c C-c for
locations which don't have C-c C-c functionality yet.

> What I'm trying to achieve is to post-process a standard Org element.
> However, my target element is already taken care of by one of the
> patterns in 'ctrl-c-ctrl-c, so the hook-caller is never reached.

Exactly.

> As a workaround, I take advantage of the rest of the above docstring
>
>... while ‘org-ctrl-c-ctrl-c-hook’ is run before the first test.
>
> and add to this hook a function that recursively calls
> 'org-ctrl-c-ctrl-c before it does its own work - which seems
> incredibly kludgy.

Possibly it's a good idea to realize the implementation of your idea
independent of C-c C-c.  And postpone the binding with C-c C-c.


HTH, ciao,
-- 
Marco




[O] bug? 'org-ctrl-c-ctrl-c-final-hook not run

2019-03-17 Thread Thomas Plass
This is a question for Org API users regarding
'org-ctrl-c-ctrl-c-final-hook and how it is to be understood.

As per the docstring

   This can be used to add additional functionality to the C-c C-c key
   which executes context-dependent commands.  This hook is run after
   any other test, ...

should the 'message in the hook function below be executed?

(add-hook 'org-ctrl-c-ctrl-c-final-hook
  (function (lambda ()
  (message "org-ctrl-c-ctrl-c-final-hook called from %s"
   (org-element-type (org-element-context)))
  t)))

In fact, the hook isn't run at all, although it makes no assumptions
whatsoever about its context.  

Is this the way things are intended or is this behaviour a bug?

What I'm trying to achieve is to post-process a standard Org element.
However, my target element is already taken care of by one of the
patterns in 'ctrl-c-ctrl-c, so the hook-caller is never reached.

As a workaround, I take advantage of the rest of the above docstring

   ... while ‘org-ctrl-c-ctrl-c-hook’ is run before the first test.

and add to this hook a function that recursively calls
'org-ctrl-c-ctrl-c before it does its own work - which seems
incredibly kludgy.

Thanks for any feedback.

Regards

Thomas






[O] Missing documentation for #+macro: xxx (eval ...)

2019-03-17 Thread Carlos Pita
Hi all,

just what the subject says. It seems an important feature to me but
I'm unable to find any reference to it in
https://orgmode.org/manual/Macro-replacement.html.

Best regards
--
Carlos



[O] Archiving to a subtree

2019-03-17 Thread Ken Mankoff
Hello list,

I used to archive items to a subtree (in an archive file) using some functions 
provided on this list back in 2014 [1]. I recently updated Org and this code 
stopped working because the 'org-extract-archive-file' function has been 
removed. This was commit 9d603b1854f658202024807c17ffc1fd47a3cd74

Does anyone have a replacement function that archives sub-items to sub-trees? 
I'm looking for behavior that will take **bar:

file.org:
* Foo
** Bar

And archive it to **bar under *foo like this:

archive/file.org_archive
* Foo
** Bar

I don't see any mention of this in the NEWS.org.

Thanks,

  -k.


[1] https://lists.gnu.org/archive/html/emacs-orgmode/2014-08/msg00109.html




[O] [PATCH] ob-core: Add edit-prep in org-babel-make-language-alias

2019-03-17 Thread Sebastian Miele
---
 lisp/ob-core.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index fbeb46bb0..8168328de 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -3135,7 +3135,8 @@ after the babel API for OLD-type source blocks is fully 
defined.
 Callers of this function will probably want to add an entry to
 `org-src-lang-modes' as well."
   (dolist (fn '("execute" "expand-body" "prep-session"
-   "variable-assignments" "load-session"))
+   "variable-assignments" "load-session"
+   "edit-prep"))
 (let ((sym (intern-soft (concat "org-babel-" fn ":" old
   (when (and sym (fboundp sym))
(defalias (intern (concat "org-babel-" fn ":" new)) sym
-- 
2.21.0




Re: [O] Bug: ? org-log-done-with-time set as a file local variable does not have the desired effect

2019-03-17 Thread Niall Dooley
On Sat, 16 Mar 2019 at 16:25, Niall Dooley  wrote:

> I've set org-log-done-with-time as a file local variable (in my habits.org) to
> nil. Oddly, the Local Variables section was initially visible at the end of
> this file but is no longer visible (when visiting this file in subsequent
> sessions) though the variable is still set to nil for buffers visiting this
> file.
>
> (1) Why do I no longer see this Local Variables section in this file?

I was incorrect with this statement and query. This is an org file with
subtrees and the Local Variables section is actually hidden under that the
last subtree. So please ignore this specific question. I would still like a
solution to my second query.

-- Niall



Re: [O] org-drill futures

2019-03-17 Thread stardiviner


Phillip Lord  writes:

> I've been using org-drill a lot recently. I've already added one feature
> that I consider vital for this kind of thing (answering by typing!) and
> would like to add another (some form of Leitner box learning).
>
> But, it seems sensible to fix the maintainership first. Are any of the
> forks out there active at the moment? If not, I'd be willing to take
> over the maintainership for a while. Is anyone else interested? Does
> anyone object?
>
> Phil

About the maintainship, I don't know. But I like your idea. Hope can get it. You
might want to ask org-drill author, I remember I used to send email to him. But
got respond late. And you can publish the PATCH here.

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

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