[SOLVED] Re: [Question] adding document global properties drawer

2020-02-22 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


This problem has gone, I don't know what config caused this problem. I recently
modify some config of Org Mode. Anyway, it's good news.

Nicolas Goaziou  writes:

> Hello,
>
> stardiviner  writes:
>
>> I found I can add property with name input name like "kk", "hello" etc, but
>> can't add property "CATEGORY". Is there some limitation on document level
>> property?
>
> I still cannot reproduce it.
>
> Regards,


- -- 
[ 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
  
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5SKkYUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPFXgf9EoRG/qXJBblOrNwRdv2dfzgA8rDd
HTGsxcPVbssguPXlL6uMoCkHsdveGnZN8VDR6GENtNUwm5aSmzMdNNnFV3xSIQ3M
glF+xAicdOKeWvJ+pkpvmUudqkq9+e+mj3Hz/8DNBox4qpUHUDkdjP0EewTLD6NN
3bPx426zy83bd26b2ebier8oo5RcU+ky1kfwTOCiXyiO5JBkOBOSJU8iFWG1fn4A
oqNjev0r7RUwOoxkC7e8/+kFH0MnhDWQe+SmN6+vUhcbosGjF6QFqTNwL4mBeHg5
WJSnA8QFoUh2+2e81JyAX15n05x7KLxCf3tLa8hLjPXmwBBKx6DwCKmLaA==
=yF9e
-END PGP SIGNATURE-



Re: How to display overlay or propertize text on file: link type about the file?

2020-02-22 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


John Kitchin  writes:

> I think you are looking for the :activate-func property of a link. What
> you want is somewhat tricky though, how would you edit the link?
>
> There is an example at
> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/#org069cbfa

Thanks for your tips. Helpful!!

>
> that might give you some ideas. You can use a 'display text property to
> change the appearance, but you need some way to remove this if you want
> to edit or see the original version.

I usually edit link with =[C-c C-l]= to edit link URL and description, not 
literally.

>
> stardiviner  writes:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA256
>>
>>
>> I have a requirement, I want to display file: link's file type info on the 
>> link.
>>
>> For example, an Org file: link
>>
>> #+begin_src org
>> [[file:~/Org/logo.png][logo]]
>> [[file:~/Org/document.pdf][document]]
>> [[file:~/Org/book.epub][book]]
>> #+end_src
>>
>> I want to display link as:
>>
>> #+begin_src org
>> logo (image: png)
>> document (document: pdf)
>> book (ebook: epub)
>> #+end_src
>>
>> I'm inspired by this code snippet:
>>
>> #+begin_src emacs-lisp
>> (org-link-set-parameters
>>  "file+sys"
>>  :complete 'org-file-complete-link
>>  :face (lambda (path) (if (file-exists-p path) 'org-link 'org-warning)))
>> #+end_src
>>
>> Is it possible to display those info between parentheses with an overlay or
>> propertied text?
>>
>> If someone have any idea or how to implement this, please help me. Thanks in 
>> advanced.
>>
>> - --
>> [ 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
>>
>> -BEGIN PGP SIGNATURE-
>>
>> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5OrLYUHG51bWJjaGls
>> ZEBnbWFpbC5jb20ACgkQG13xyVromsPElQf/W71U1JQ9ZeFjCWCxICs0q87016Iq
>> 8FQ5Fr3lSmRb6NRLqzqAAbY6b14roxtixxmllvArJgd7bz280xTZs3NGgYMm/HMf
>> sZ+vtkpiHgJk31KXxAk/LT1OcgzYOrSv7g6c8Y3Gg8G5eSDmKGu+tMwqFzYtVmk2
>> 6G0/wz9ezsdYAFLlNrX/FhcVaxCUSSdG08z0Ip/Op1I4iqh3Y86N7LalPVZWNa9H
>> eZSFsf3Z8NqfVnCmTvmyJon4x1SGvJ8Iaf4QUiE7huNeizJK2+CSIhjSu8yDBGr4
>> 2oMPrkAm1XkJDLMQh0FLjIrIJUoTLzLonEYtlmg3thvFEMqFuF8ziYaGdw==
>> =sZhk
>> -END PGP SIGNATURE-


- -- 
[ 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
  
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5SBYsUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOSOAgAmtN0JBgMB//D8EC7tQhrSwVX7spb
NLH2EQbdDmzOyf2y+gwrvzGBojQ7TBLmM/dzm+IfPNsbyY4IMlLBvyrJST7D0uDC
SXA8Ugi88qKkyS5H+Hw5jSNcOaPxwXLq5kxu3BXmtBpdNiIShL0qnTD4itNRHpG8
v0NWFQwTcMI15OcsTKoGSG9PNw7qeJEt5vpYLL/oljAxMW0VsCnS061XjWda8w5u
U2KWYLCeVAh3kXtas5pywar50F+ELAoutpr3USqJDtFPtRkyVYAmEKBHknFJ2R4u
8nTIchXoctS5JpINhwq4wfdmSRSjjcz1DYb9Y9LSMFjDbvzAKqcSk6eX4g==
=xhBz
-END PGP SIGNATURE-



Exploring properties

2020-02-22 Thread Vikas Rawal
I don't know if I have missed something obvious. But I am trying to read
all the properties data (key-value pairs) into an R source code block
(essentially to gather into a data.frame before further processing).

I thought properties would be a neat way to put together a small database,
and then process it in R.

Would appreciate a clue.

Warmly,

Vikas


Re: How to display overlay or propertize text on file: link type about the file?

2020-02-22 Thread John Kitchin
I think you are looking for the :activate-func property of a link. What
you want is somewhat tricky though, how would you edit the link?

There is an example at
https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/#org069cbfa

that might give you some ideas. You can use a 'display text property to
change the appearance, but you need some way to remove this if you want
to edit or see the original version.

stardiviner  writes:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
>
> I have a requirement, I want to display file: link's file type info on the 
> link.
>
> For example, an Org file: link
>
> #+begin_src org
> [[file:~/Org/logo.png][logo]]
> [[file:~/Org/document.pdf][document]]
> [[file:~/Org/book.epub][book]]
> #+end_src
>
> I want to display link as:
>
> #+begin_src org
> logo (image: png)
> document (document: pdf)
> book (ebook: epub)
> #+end_src
>
> I'm inspired by this code snippet:
>
> #+begin_src emacs-lisp
> (org-link-set-parameters
>  "file+sys"
>  :complete 'org-file-complete-link
>  :face (lambda (path) (if (file-exists-p path) 'org-link 'org-warning)))
> #+end_src
>
> Is it possible to display those info between parentheses with an overlay or
> propertied text?
>
> If someone have any idea or how to implement this, please help me. Thanks in 
> advanced.
>
> - --
> [ 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
>
> -BEGIN PGP SIGNATURE-
>
> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5OrLYUHG51bWJjaGls
> ZEBnbWFpbC5jb20ACgkQG13xyVromsPElQf/W71U1JQ9ZeFjCWCxICs0q87016Iq
> 8FQ5Fr3lSmRb6NRLqzqAAbY6b14roxtixxmllvArJgd7bz280xTZs3NGgYMm/HMf
> sZ+vtkpiHgJk31KXxAk/LT1OcgzYOrSv7g6c8Y3Gg8G5eSDmKGu+tMwqFzYtVmk2
> 6G0/wz9ezsdYAFLlNrX/FhcVaxCUSSdG08z0Ip/Op1I4iqh3Y86N7LalPVZWNa9H
> eZSFsf3Z8NqfVnCmTvmyJon4x1SGvJ8Iaf4QUiE7huNeizJK2+CSIhjSu8yDBGr4
> 2oMPrkAm1XkJDLMQh0FLjIrIJUoTLzLonEYtlmg3thvFEMqFuF8ziYaGdw==
> =sZhk
> -END PGP SIGNATURE-


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: Survey: changing a few default settings for Org 9.4

2020-02-22 Thread Archenoth
Oh yeah, I agree that it's redundant--and that's why I was more just
advocating for the functionality it provided rather than for the module
itself.

It's just a piece of functionality that a lot of people seem to use and
enjoy, and if there were a way to keep it without holding onto a second
templating system, I feel like there would be significantly less resistance
to disabling it.

The reasons for disabling tempo are good ones! But they also have the side
effect of effectively disabling something that a significant number of
people are already using and prefer. And unlike external modules, it
already has a pretty strong reputation for being in "vanilla" Org-mode. I
mean, I know I've already had to revise a number of Emacs Stack Exchange
answers with an explanation of why this no longer works.


On Sat, Feb 22, 2020, 5:45 AM Nicolas Goaziou 
wrote:

> Hello,
>
> Bastien  writes:
>
> > Archenoth  writes:
> >
> >> The tab key is extremely easy to hit, and having a fully formed block
> >> created by typing a short string of characters makes the
> >> tab-completion lizard-part of my brain happy in a way that key chord
> >> combos simply don't.
> >
> > You say it better than I did - I will see if I can add a completion
> > mechanism to `org-insert-structure-template' that is not to hackish.
>
> Note that the "the TAB is extremely easy to hit" is not really an
> argument here. It is no more true than "< s TAB" is faster than "C-c C-,
> s", i.e., it depends on users, as we already observed.
>
> More generally, this discussion is not about "Is Org Tempo useful?". The
> answer is simple: yes, it is for some users. No need to argue about
> that. But you can also find plenty of useful Org extensions in
> "contrib/", or any ELPA. This does not mean they should all ship with
> Org.
>
> Deciding if an extension should or should not go into Org proper is
> usually not an easy decision. In this case, a strong argument against it
> is: there is already a template mechanism available out of the box, why
> would we provide two of them? I think we should focus on this topic,
> rather than personal preferences.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: Make ob-python.el support ":results pp" pretty print result

2020-02-22 Thread Jack Kamm
Hi stardiviner,

stardiviner  writes:

> I found ob-python does not support ":results pp" pretty print result. And 
> Python
> has a module "pprint". What about add support this?

":results pp" works for me, here's an example:

> #+begin_src python :results pp
>   return globals()
> #+end_src
> 
> #+RESULTS:
> #+begin_example
> {'__annotations__': {},
>  '__builtins__': ,
>  '__cached__': None,
>  '__doc__': None,
>  '__file__': '',
>  '__loader__': ,
>  '__name__': '__main__',
>  '__package__': None,
>  '__spec__': None,
>  'main': ,
>  'pprint': }
> #+end_example

Here's how it looks by default (without "pp"):

> #+begin_src python
>   return globals()
> #+end_src
> 
> #+RESULTS:
> | __name__ | : | __main__ | __doc__ | : | hline | __package__ | : | hline | 
> __loader__ | : |  | __spec__ | 
> : | hline | __annotations__ | : | nil | __builtins__ | : |  | (built-in) | > | __file__ | : |  | __cached__ | : | hline | main | : 
> |  |

And here's how it looks when using ":results output":

> #+begin_src python :results output
>   print(globals())
> #+end_src
> 
> #+RESULTS:
> : {'__name__': '__main__', '__doc__': None, '__package__': None, 
> '__loader__': , '__spec__': None, 
> '__annotations__': {}, '__builtins__': , 
> '__file__': '', '__cached__': None}

I also tested this on ":session" blocks and the results were the same.



ob-prolog is sick. . .

2020-02-22 Thread Lawrence Bottorff
. . . can some nice doctor (with elisp skills beyond my laughable ones)
make a house call? The repo here  has an
outstanding *issue* you can read. Also, if you run the .org test file, it
hangs after a few of the simpler tests. I think they're related. The
original provider says he just doesn't have time.

Besides the bad karma of listing a Babel language that actually doesn't
work, I would like to have Prolog working in Babel because I get the sense
Prolog's stock will slowly rise, mainly due to it being the basis of
querying graph databases. Prolog and RDF, basically.

LB


Limiting properties and property values

2020-02-22 Thread Vikas Rawal
Dear all,

I have two queries regarding use of properties in org mode.

1. Is it possible to restrict the sub-tree of a headline to have only
properties specified in the column property of the parent? That is, no
additional property can be specified.

2. Is it possible to limit the allowed values of a property to say only
numeric values or to a specific range of numeric values?

Thanks in advance, and with best wishes to everyone.

Vikas


Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-22 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Bastien  writes:

> Hi all,
>
> in future releases of Org, we will move toward stricter rules on what
> to accept as ob-* libraries and what modes these libraries should rely
> upon.
>
> This was briefly mentioned in this email:
> https://lists.gnu.org/archive/html/emacs-orgmode/2020-02/msg00714.html
>
> For example, we can have a rule that we don't include ob-* libraries
> for languages that are not somehow known by Emacs.  It would mean that
> e.g. ob-clojure.el would have to live outside Org's core.

This is a bad news for me. I understand your considering. Well, I hope there is
a fine handling of this ob-* libraries which will be outside of Org Mode core.

Best Regards.

- -- 
[ 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
  
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5ROosUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPf4ggAqEfRGuZoVOw83G6KvVCVTCEFgZ7b
/mz+quLLYzvb43BU8jShIDC+vYYz1rYpyjg7sL0WJddFdko7MGD9NHd4/ZfmbYOg
s+jaIS2isrXtTMZSFRfKSZvqyNuTQQcQhLSQOGSYy3UePKcl1eABCJnS/eSrn+jp
adQP7ieJoboKrmORsAGIvRPBgPPpML3u0P9lAJbSxfMSCOaGM5/MNS0uRNrB2cjT
dk82ohLle2D0szGxMusBkpRsNu2HyRvmL2kVKyP99BzK949FGFldzO4HsW7Pb5lo
3lae5pcJLa+aYXtbFRMf8GXTKCmdGY5hf9hKaVj85Z4++9C5xpeZn4ca5Q==
=zVp9
-END PGP SIGNATURE-



Re: Bug or not a bug? dot expansion in ob-shell

2020-02-22 Thread Bastien
Hi Nick and Jack,

thanks for your thoughtful inputs.  I've now removed the option.

I agree we should have a discussion on whether :results value is a
good default.  But I think this needs previous work on documenting
what is the actual behavior of the main Babel libraries wrt "value"
vs "output".

I will start a file on worg with a table describing the current
behavior of various libraries.  E.g. ob-clojure.el the output by
default, not the "value".

Once we have a cleear picture on how various libraries distant
themselves from what could be expected by reading Org's manual,
then we have more background and could start the discussion on
changing the defaults - 9.5 would be a good time.

Thanks again,

-- 
 Bastien



Re: attachment: link type export to HTML invalid attach dir

2020-02-22 Thread Bastien
Hi,

Thanks for your answer.

Nicolas Goaziou  writes:

> I'd like to hear from Gustav, too, since this affects the changes he
> introduced. If you are in a hurry, we can also apply it. Up to you.

I just applied it - Gustav let us know if it fits your needs and if it
does not introduce regressions.

>> Do you want to do this for 9.4 or can it be done later on?
>
> This can be done later on. I don't have time to work on this. Of course,
> if someone wants to do it, that would be great, too.

Okay, thanks.  Noted for Org > 9.4.

Best,

-- 
 Bastien



Re: Survey: changing a few default settings for Org 9.4

2020-02-22 Thread Bastien
Hi,

Nicolas Goaziou  writes:

> In this case, a strong argument against it is: there is already a
> template mechanism available out of the box, why would we provide
> two of them?

I bet most users of the <* completion mechanism provided by org-tempo
don't even notice it is a "template" mechanism.

Org used to provide a *completion* mechanism for <* at the beginning
of the line, then this completion mechanism was moved in org-tempo,
which names does not really speaks about _completing_ <* strings.

Anyway, I think we settled the case:

1. let's not supercharge Org's core with two template mechanismes;

2. let's try to provide a completion mechanism on top of the current
   template expansion mechanism -- an intermediary step being having
   an expert dispatch mode for org-insert-structure-template.

I'll try to do that for 9.5.

Best,

-- 
 Bastien



Re: attachment: link type export to HTML invalid attach dir

2020-02-22 Thread Nicolas Goaziou
Hello,

Bastien  writes:

> Thanks a lot -- feel free to apply it when you think it's okay.

I'd like to hear from Gustav, too, since this affects the changes he
introduced. If you are in a hurry, we can also apply it. Up to you.

> Also, perhaps can you or Gustav suggest a way to test the new feature
> so that we can test this new code?

I don't use the feature. I just tried to avoid introducing regressions.

It is related to how attachments are opened, and exported. I guess
testing should focus on this, in particular export of attached images,
i.e., attachements with an image extension.

> Do you want to do this for 9.4 or can it be done later on?

This can be done later on. I don't have time to work on this. Of course,
if someone wants to do it, that would be great, too.

Regards,

-- 
Nicolas Goaziou



Re: Survey: changing a few default settings for Org 9.4

2020-02-22 Thread Nicolas Goaziou
Hello,

Bastien  writes:

> Archenoth  writes:
>
>> The tab key is extremely easy to hit, and having a fully formed block
>> created by typing a short string of characters makes the
>> tab-completion lizard-part of my brain happy in a way that key chord
>> combos simply don't.
>
> You say it better than I did - I will see if I can add a completion
> mechanism to `org-insert-structure-template' that is not to hackish.

Note that the "the TAB is extremely easy to hit" is not really an
argument here. It is no more true than "< s TAB" is faster than "C-c C-,
s", i.e., it depends on users, as we already observed.

More generally, this discussion is not about "Is Org Tempo useful?". The
answer is simple: yes, it is for some users. No need to argue about
that. But you can also find plenty of useful Org extensions in
"contrib/", or any ELPA. This does not mean they should all ship with
Org.

Deciding if an extension should or should not go into Org proper is
usually not an easy decision. In this case, a strong argument against it
is: there is already a template mechanism available out of the box, why
would we provide two of them? I think we should focus on this topic,
rather than personal preferences.

Regards,

-- 
Nicolas Goaziou



Re: Survey: changing a few default settings for Org 9.4

2020-02-22 Thread Bastien
Hi,

Archenoth  writes:

> The tab key is extremely easy to hit, and having a fully formed block
> created by typing a short string of characters makes the
> tab-completion lizard-part of my brain happy in a way that key chord
> combos simply don't.

You say it better than I did - I will see if I can add a completion
mechanism to `org-insert-structure-template' that is not to hackish.
This is for after Org 9.4 though, as we will enter a short period of
feature-freeze when 0001-Do-not-leak-attachment-links.patch is in.

Thanks,

-- 
 Bastien



Re: testing org-bbdb-anniversaries

2020-02-22 Thread Bastien
Hi Andrès,

andrés ramírez  writes:

> Perhaps something about it on the help?
>
> (defun org-bbdb-anniversaries ()
>   "Extract anniversaries from BBDB for display in the agenda
>   In case of calling programatically. Like most diary-related stuff, it 
> expects the
>   `date' variable to be globally bound."
>   (require 'bbdb)
>   .
>   )

I've slightly enhanced the docstring, thanks for the suggestion.

-- 
 Bastien