org-attach-git don't automatically commit changes

2021-01-29 Thread Juan Manuel Macías
Hi,

I don't know if this is a bug or if I am doing something wrong...

According to the manual:

#+begin_quote
If the directory attached to an outline node is a Git
repository, Org can be configured to automatically commit changes to
that repository when it sees them.

To make Org mode take care of versioning of attachments for you, add the
following to your Emacs config:

(require 'org-attach-git)
#+end_quote

I don't see that org-attach "automatically commit changes when it sees
them". Only when I run in the attached directory `M-:
(org-attach-git-commit) RET' it works fine.

`org-attach-after-change-hook' is set to `(org-attach-git-commit)'.

Regards,

Juan Manuel 




Re: Microsoft Excel getting features we have had for a long time in org :-)

2021-01-29 Thread gyro funch
On 1/28/2021 4:01 AM, Eric S Fraga wrote:
> Interesting:
> https://www.microsoft.com/en-us/research/blog/lambda-the-ultimatae-excel-worksheet-function/
> 
> (somebody doesn't know how to spell ultimate?)
> 
> I still would rather work with text than in a GUI and in Lisp than
> Excel's language (whatever that may actually be) but good to see.
> 

Oooh. That should make Excel spreadsheets even funner to audit.

-gyro




Refile Targets Custom Function Support

2021-01-29 Thread Kevin Foley
I'd like to use an `org-ql' query in order to get eligible targets when
calling `org-refile'.

It doesn't seem `org-refile-targets' supports something like passing a
function that returns the desired targets.  Is it possible through some
other means?

If not, would a patch to `org-refile-get-targets' controlled by a new
type in `org-refile-targets' be welcome?  

Thanks,
Kevin Foley




Re: Refile Targets Custom Function Support

2021-01-29 Thread Samuel Wales
alpha-org-refile-target-verify-function is all i know of.

On 1/29/21, Kevin Foley  wrote:
> I'd like to use an `org-ql' query in order to get eligible targets when
> calling `org-refile'.
>
> It doesn't seem `org-refile-targets' supports something like passing a
> function that returns the desired targets.  Is it possible through some
> other means?
>
> If not, would a patch to `org-refile-get-targets' controlled by a new
> type in `org-refile-targets' be welcome?
>
> Thanks,
> Kevin Foley
>
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



Re: Refile Targets Custom Function Support

2021-01-29 Thread Samuel Wales
oops, i meant org-refile-target-verify-function variable.

On 1/29/21, Samuel Wales  wrote:
> alpha-org-refile-target-verify-function is all i know of.
>
> On 1/29/21, Kevin Foley  wrote:
>> I'd like to use an `org-ql' query in order to get eligible targets when
>> calling `org-refile'.
>>
>> It doesn't seem `org-refile-targets' supports something like passing a
>> function that returns the desired targets.  Is it possible through some
>> other means?
>>
>> If not, would a patch to `org-refile-get-targets' controlled by a new
>> type in `org-refile-targets' be welcome?
>>
>> Thanks,
>> Kevin Foley
>>
>>
>>
>
>
> --
> The Kafka Pandemic
>
> Please learn what misopathy is.
> https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



Re: org-attach-git don't automatically commit changes

2021-01-29 Thread Ihor Radchenko
Juan Manuel Macías  writes:

> I don't see that org-attach "automatically commit changes when it sees
> them". Only when I run in the attached directory `M-:
> (org-attach-git-commit) RET' it works fine.

Note that org "sees" changes in the attachment dir only when you use
M-x org-attach command to manage the attachments. Directly changing the
attachment directory will not be noticed. You can force org-mode to
check for changes in attachment dir by running "C-c C-a z".

I guess using something like inotify might be a good new feature to
make org detect changes automatically.

Best,
Ihor




bug#44824: 27.1; Org export as pdf and open file does not open it

2021-01-29 Thread Lars Ingebrigtsen
Geraldo Biotti  writes:

> I get the same results reported in bug 25234. 'M-! xdg-open /tmp/test.pdf' 
> works
> fine. I apologise for my english but it's not my mother language.

So:

This works:
M-! xdg-open /tmp/test.pdf RET

This doesn't work:
M-& xdg-open /tmp/test.pdf RET

This doesn't work:
M-x shell RET xdg-open /tmp/test.pdf RET

?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Re: [PATCH] Org Agenda Support Argument Collection for Custom Bulk Functions (was: Custom Bulk Functions With Prompt)

2021-01-29 Thread Kyle Meyer
Kevin Foley writes:

> Kyle Meyer  writes:
[...]
>> In addition to the NEWS entry that Ihor mentioned, it looks like an
>> update to the manual is missing.
>
> NEWS entry added.  With regard to the manual, the custom bulk function
> option is only mentioned as a footnote.  I'm happy to add a more in
> depth explanation, however I'm not sure where it should go, any
> recommendations?

Ah, okay, thanks for taking a look.  I'm okay leaving the details about
this functionality to the defcustom then.

> Subject: [PATCH] org-agenda.el: Support argument collection for custom bulk
>  functions
[...]
> diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
> index 5e5f1954d..4958d2b2e 100644
> --- a/etc/ORG-NEWS
> +++ b/etc/ORG-NEWS
> @@ -81,8 +81,13 @@ block. ~org-babel-latex-preamble~, 
> ~org-babel-latex-begin-env~ and
>  the user to specify the preamble and code that preceedes and proceeds
>  the contents of the source block.
>  
> +*** Option ~org-agenda-bulk-custom-functions~ now supports collecting bulk 
> arguments
> +
> +When specifying a custom agenda bulk option, you can now also specify a 
> function which collects the arguments to be used with each call to the custom 
> function.

Please fill this line (fill-column in .dir-locals.el is set to 70)
and...

>  ** New features
> -*** =ob-python= improvements to =:return= header argument 
> +*** =ob-python= improvements to =:return= header argument

... drop this unrelated space change.

> @@ -2080,9 +2080,25 @@ (defcustom org-agenda-bulk-custom-functions nil
>  
[...]
> +
> +If the custom function accepts arguments which you'd like to
> +collect once from the user to be used for each call, you can pass
> +a list with the bulk function, and the function which collects
> +its arguments and returns them as a list.  For example:
> +
> +  \\='((?R (set-category get-category))
> +(?C bulk-cut))
> +

Reading this docstring in full, I felt it was a bit odd to repeat the
bulk-cut entry from the initial example again, as it stays the same and
isn't relevant.  So perhaps something like this would be clearer:

  ... and returns them as a list.  For example, the first
  entry in the above example could be extended as
  
(?R (set-category get-category))
  
  Now, `B R' will ...

Or perhaps not.  I'm okay with it either way and will leave that up to
you.

> +Now, `B R' will call the custom `get-category' which would prompt
> +the user once for a category.  That category is then passed as an
> +argument to `set-category' for each entry it's called against.
> +"

Please drop the new line before the closing quote.

> +  :type '(alist :key-type character
> +:value-type (list (function :tag "Bulk Custom Function")
> +  (choice (const :tag "No Bulk Custom 
> Argument Function" nil)
> +  (function :tag "Bulk Custom 
> Argument Function"
> +  :package-version '(Org . "9.5")
>:group 'org-agenda)

convention nit: It'd be good to reflow the type to not go beyond ~80
columns.

This type looks like it's specifying a format that isn't supported by
org-agenda-bulk-action:

  (x . (y z)) => (x y z)

This is discussed a bit in (info "(elisp)Composite Types") under the
alist entry.

To use a concrete example, I believe all of these entries should be
valid with this patch:

  (defun my/bulk-action (&rest args)
args)
  
  (defun my/args ()
(list 1 2 3))
  
  (setq org-agenda-bulk-custom-functions
'((?D my/bulk-action)
  (?E (my/bulk-action))
  (?F (my/bulk-action my/args

However, customize doesn't render the above value properly

(customize-option 'org-agenda-bulk-custom-functions)

So, you'll need to flesh out the type entry more so that all of the
valid cases are handled by the customize interface.  I think it'd
probably end up a bit cleaner if you go with (key fn [arg-fn]), which is
the structure Ihor originally thought you were using, rather than
(key (fn [arg-fn])) or (key fn).  But I'd say that's dealer's choice.



bug#44824: 27.1; Org export as pdf and open file does not open it

2021-01-29 Thread Geraldo Biotti
Il sab 30 gen 2021, 07:09 Lars Ingebrigtsen  ha scritto:

> Geraldo Biotti  writes:
>
> > I get the same results reported in bug 25234. 'M-! xdg-open
> /tmp/test.pdf' works
> > fine. I apologise for my english but it's not my mother language.
>
> So:
>
> This works:
> M-! xdg-open /tmp/test.pdf RET
>
> This doesn't work:
> M-& xdg-open /tmp/test.pdf RET
>
> This doesn't work:
> M-x shell RET xdg-open /tmp/test.pdf RET
>
> ?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>bloggy blog: http://lars.ingebrigtsen.no


Exactly. And it doesn't even "export as PDF and open file" in org-mode,
which I think is a related problem.