accounting

2021-01-04 Thread Uwe Brauer


Hi 

https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html

Points out how to use ledger within org mode.

Is there any simpler solution?

Regards

Uwe Brauer 




Re: accounting

2021-01-04 Thread Eric S Fraga
On Monday,  4 Jan 2021 at 09:54, Uwe Brauer wrote:
> Points out how to use ledger within org mode.
> Is there any simpler solution?

How do you wish it to be simpler?  What is it you wish to do?
-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-166-g291993



Re: Org to ConTeXt exporter?

2021-01-04 Thread Ludovic Courtès
Hi,

Jonathan McHugh  skribis:

> I investigated further the Context engine for Skribilo:
> https://git.savannah.gnu.org/gitweb/?p=skribilo.git;a=tree;f=src/guile/skribilo/engine;h=9c6353eb7c6eae70de007c2f0a8f01092ae669a2;hb=HEAD
>
> While I cant comment on it's Context engine functionality or efficacy, it 
> clearly has a
> decent breakdown of usecases across its 1300 lines. It appears to have
> had low updates frequency, probably as a consequence of the stability of
> Context's syntax (rather than the momentum of the DSL). It may be useful
> as a checklist of key terms to tick off, if not a consideration for
> framing anything to serve Org-Moders.

FWIW, I’m not the original author of the Context engine in Skribilo (it
was inherited from Skribe).  I’m afraid it hasn’t been tested in a while
and could suffer from bitrot, but hopefully it can at least serve as
inspiration.

Thanks,
Ludo’.



Re: accounting

2021-01-04 Thread Dr. Arne Babenhauserheide

Uwe Brauer  writes:

> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html
>
> Points out how to use ledger within org mode.
>
> Is there any simpler solution?

Do you mean simpler accounting in org-mode, or do you mean simpler
ledger-integration?

You can always tangle your ledger-data and use a ledger commandline
client. Also Emacs has direct support for ledger. Here’s a setup via
use-package:

(use-package ledger-mode :ensure t :defer 20
  :config
  (org-babel-do-load-languages
   'org-babel-load-languages
   '((ledger . t

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken


signature.asc
Description: PGP signature


Re: ob-haskell

2021-01-04 Thread Leo
Lawrence Bottorff  writes:

> Enclosing code in :{ ... :} is fairly good -- again you can type this in at
> the REPL prompt and see how it works -- however, there are gotchas.
>

I don't think I understand what the problem is with :{ ... :}. Doing
this manually has worked pretty well for me.

>
> What would be nice is if a C-c C-c inside a block could somehow act as
> though the ghci were being sent a regular  *.hs buffer in haskell-mode --
> and that, of course, cumulatively. C-' creates a decent haskell-mode
> environment, BTW, so some form of a babel block to haskell-mode connection
> does exist
>

This makes a lot of sense in many cases. One case that I think it might
be suboptimal in is when I have a heavy computation that generates
some data. Then I would want to try to do a bunch of things to that data
which means that reloading everything would be suboptimal.

I don't know how other babel plugins work, but the way I enjoy working
with ghci the most is to load in a file to ghci and then test a bunch of
expressions in the repl. Maybe ob-haskell could work like this as well,
with one type of block that loads the code as a file and another block
that just sends the code to the repl. There are some problems here that
needs to be sorted out though. For example should each block of the
former type be loaded in its own module or should all of the code blocks
be loaded in the same module? 


/A sporadic user of ob-haskell



Re: accounting

2021-01-04 Thread Daniele Nicolodi
On 04/01/2021 09:54, Uwe Brauer wrote:
> Hi 
> 
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html
> 
> Points out how to use ledger within org mode.
> 
> Is there any simpler solution?

As other pointed out, you are not describing what you want to
accomplish, thus is impossible to suggest anything concrete. However, I
would like to suggest to look at Beancount and beancount-mode as
alternatives to Ledger as plain text accounting tools.

Cheers,
Dan



Re: accounting

2021-01-04 Thread Uwe Brauer
>>> "AB" == Arne Babenhauserheide  writes:

   > Uwe Brauer  writes:

   >> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html
   >> 
   >> Points out how to use ledger within org mode.
   >> 
   >> Is there any simpler solution?

   > Do you mean simpler accounting in org-mode, 


This is what I meant. 

   > or do you mean simpler ledger-integration?

The example in this link is ok, also the output (the result of the
ledger operation) is not very nicely formatted.

   > You can always tangle your ledger-data and use a ledger commandline
   > client. Also Emacs has direct support for ledger. Here’s a setup via
   > use-package:

   > (use-package ledger-mode :ensure t :defer 20
   >   :config
   >   (org-babel-do-load-languages
   >'org-babel-load-languages
   >'((ledger . t

   > Best wishes,
   > Arne


smime.p7s
Description: S/MIME cryptographic signature


Re: accounting

2021-01-04 Thread Charles Millar

On 1/4/21 3:54 AM, Uwe Brauer wrote:


Hi

https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html

Points out how to use ledger within org mode.

Is there any simpler solution?

Regards

Uwe Brauer


If "simpler" means just making entries into your ledger.dat file using 
orgmode you may wish to refer to Sacha Chua's capture template for that 
very purpose. She posted it a few years ago.


https://sachachua.com/blog/2010/11/emacs-recording-ledger-entries-with-org-capture-templates/

Charlie Millar



Re: accounting

2021-01-04 Thread Eric S Fraga
On Monday,  4 Jan 2021 at 13:43, Uwe Brauer wrote:
> The example in this link is ok, also the output (the result of the
> ledger operation) is not very nicely formatted.

ledger does allow you to control, in detail, how the output should be
formatted.  The default output is suitable for a console display but you
can modify this through appropriate arguments to the ledger command line
via babel.  For instance, I have this line in my org file for generating
a balance of my assets:

,#+call: year2020[:cmdline -V --format "%-20A %14T\n" bal --flat assets ]()

where year2020 is a ledger src block which covers my 2020-21 tax year.

You will need to look at the ledger documentation, which is intensive,
for how to specify the format string.  Ledger does come with an Emacs
info file: (ledger3) Format Strings

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-166-g291993



Re: ist here a :post header arg for tangling?

2021-01-04 Thread Diego Zamboni
There's =org-babel-post-tangle-hook=, which AFAICT specifies hooks that
will be run with the tangled code in a temporary buffer. I couldn't find
much documentation nor examples, but it is mentioned at
https://orgmode.org/manual/Extracting-Source-Code.html#Hooks-3

--Diego





On Fri, Jan 1, 2021 at 1:31 PM Immanuel Litzroth <
immanuel.litzr...@gmail.com> wrote:

> I don't think there is an arg for that. I have written a tangler that
> reuses a lot
> of the org-babel machinery and has a more flexible mechanism to decide what
> to do with the tangled code -- I use it for example to not write a
> tangled file if it
> hasn't changed, meaning that it will not trigger recompile.
> The project is private now but if you're interested I can give you access
> to it.
> What exactly are you trying to do?
> Immanuel
>
> On Fri, Jan 1, 2021 at 2:09 AM George Mauer  wrote:
> >
> > I'd like to run some code to post-process files after they are tangled.
> Is there a header-arg for that?
>
>
>
> --
> -- Researching the dual problem of finding the function that has a
> given point as fixpoint.
>
>


Re: ist here a :post header arg for tangling?

2021-01-04 Thread Immanuel Litzroth
There's that, but you're not gonna do much with that since it is
global to emacs. If you're brimming
with vigour you might achieve what you want by rebinding that each
time you tangle to do the correct
thing. Not much information is available in that hook, you get dropped
into a temp buffer containing the
result of tangling.
Immanuel

On Mon, Jan 4, 2021 at 3:07 PM Diego Zamboni  wrote:
>
> There's =org-babel-post-tangle-hook=, which AFAICT specifies hooks that will 
> be run with the tangled code in a temporary buffer. I couldn't find much 
> documentation nor examples, but it is mentioned at 
> https://orgmode.org/manual/Extracting-Source-Code.html#Hooks-3
>
> --Diego
>
>
>
>
>
> On Fri, Jan 1, 2021 at 1:31 PM Immanuel Litzroth 
>  wrote:
>>
>> I don't think there is an arg for that. I have written a tangler that
>> reuses a lot
>> of the org-babel machinery and has a more flexible mechanism to decide what
>> to do with the tangled code -- I use it for example to not write a
>> tangled file if it
>> hasn't changed, meaning that it will not trigger recompile.
>> The project is private now but if you're interested I can give you access to 
>> it.
>> What exactly are you trying to do?
>> Immanuel
>>
>> On Fri, Jan 1, 2021 at 2:09 AM George Mauer  wrote:
>> >
>> > I'd like to run some code to post-process files after they are tangled. Is 
>> > there a header-arg for that?
>>
>>
>>
>> --
>> -- Researching the dual problem of finding the function that has a
>> given point as fixpoint.
>>


-- 
-- Researching the dual problem of finding the function that has a
given point as fixpoint.



Re: ist here a :post header arg for tangling?

2021-01-04 Thread Diego Zamboni
Agree. It should be possible to make the hook file-local, but still it's
not trivial to have good control over where and how the changes are made.

--Diego


On Mon, Jan 4, 2021 at 3:51 PM Immanuel Litzroth <
immanuel.litzr...@gmail.com> wrote:

> There's that, but you're not gonna do much with that since it is
> global to emacs. If you're brimming
> with vigour you might achieve what you want by rebinding that each
> time you tangle to do the correct
> thing. Not much information is available in that hook, you get dropped
> into a temp buffer containing the
> result of tangling.
> Immanuel
>
> On Mon, Jan 4, 2021 at 3:07 PM Diego Zamboni  wrote:
> >
> > There's =org-babel-post-tangle-hook=, which AFAICT specifies hooks that
> will be run with the tangled code in a temporary buffer. I couldn't find
> much documentation nor examples, but it is mentioned at
> https://orgmode.org/manual/Extracting-Source-Code.html#Hooks-3
> >
> > --Diego
> >
> >
> >
> >
> >
> > On Fri, Jan 1, 2021 at 1:31 PM Immanuel Litzroth <
> immanuel.litzr...@gmail.com> wrote:
> >>
> >> I don't think there is an arg for that. I have written a tangler that
> >> reuses a lot
> >> of the org-babel machinery and has a more flexible mechanism to decide
> what
> >> to do with the tangled code -- I use it for example to not write a
> >> tangled file if it
> >> hasn't changed, meaning that it will not trigger recompile.
> >> The project is private now but if you're interested I can give you
> access to it.
> >> What exactly are you trying to do?
> >> Immanuel
> >>
> >> On Fri, Jan 1, 2021 at 2:09 AM George Mauer  wrote:
> >> >
> >> > I'd like to run some code to post-process files after they are
> tangled. Is there a header-arg for that?
> >>
> >>
> >>
> >> --
> >> -- Researching the dual problem of finding the function that has a
> >> given point as fixpoint.
> >>
>
>
> --
> -- Researching the dual problem of finding the function that has a
> given point as fixpoint.
>


Re: ist here a :post header arg for tangling?

2021-01-04 Thread George Mauer
So like I said, I would like to run some code to post-process files.
Nothing super-concrete, but a bunch of small use cases I've run into such as

- Running tests on every tangle
- Executing a code block in the same document and running tests after all
tangles
- Running a code-formatter such as prettierjs (or the python one which name
escapes me - autopep?) and potentially de-tangling back

I realize some of these things I could do with a file watcher, but not
really the ones that require modifying the document again

On Fri, Jan 1, 2021 at 6:29 AM Immanuel Litzroth <
immanuel.litzr...@gmail.com> wrote:

> I don't think there is an arg for that. I have written a tangler that
> reuses a lot
> of the org-babel machinery and has a more flexible mechanism to decide what
> to do with the tangled code -- I use it for example to not write a
> tangled file if it
> hasn't changed, meaning that it will not trigger recompile.
> The project is private now but if you're interested I can give you access
> to it.
> What exactly are you trying to do?
> Immanuel
>
> On Fri, Jan 1, 2021 at 2:09 AM George Mauer  wrote:
> >
> > I'd like to run some code to post-process files after they are tangled.
> Is there a header-arg for that?
>
>
>
> --
> -- Researching the dual problem of finding the function that has a
> given point as fixpoint.
>


Re: ist here a :post header arg for tangling?

2021-01-04 Thread Immanuel Litzroth
Well I solved the problem by writing a tangler which can be configured
with tangle-config
you define a tangler by making a hash "language" -> tangle-hooks. The
tangle-hooks are
called at beginning of tangling, on each source block, on each
noweb-ref and at the end of
tangling. They receive the full source-block-info to do their work,
and in the case of noweb-references
they receive the full stack of sbi's that lead up to this noweb reference.
>>>
(tangled-buffer "Buffer that is being tangled")
 (name "Name of the code block")
 (tangle-file "Filename to tangle to")
 (properties "Properties of this block")
 (full-block "Text of the full block")
 (beg-block "Buffer pos of beginning of the block in the tangled buffer")
 (end-block "end of the block in the tangled buffer")
 (lang "language of the tangled buffer")
 (beg-lang "beginning of the language in the tangled buffer")
 (end-lang "end of the language in the tangled buffer")
 (switches "switches of this block")
 (beg-switches "begin of the switches in this block")
 (end-switches "end of the switches in this block")
 (header-args "header args of this block")
 (beg-header-args "buffer pos of header args beginning")
 (end-header-args "buffer pos of header args end")
 (body "body of the tangled block")
 (beg-body "buffer pos of the beginning of the body")
 (end-body "buffer pos of the end of the body"))
>>>
That way I can tangle a multi language org file and do the correct thing for
each of the language by defining functions of interest. It's quite
flexible, I'm
going to use it to do some aspect-oriented programming/tangling when I
find the time.
Immanuel

On Mon, Jan 4, 2021 at 4:11 PM Diego Zamboni  wrote:
>
> Agree. It should be possible to make the hook file-local, but still it's not 
> trivial to have good control over where and how the changes are made.
>
> --Diego
>
>
> On Mon, Jan 4, 2021 at 3:51 PM Immanuel Litzroth 
>  wrote:
>>
>> There's that, but you're not gonna do much with that since it is
>> global to emacs. If you're brimming
>> with vigour you might achieve what you want by rebinding that each
>> time you tangle to do the correct
>> thing. Not much information is available in that hook, you get dropped
>> into a temp buffer containing the
>> result of tangling.
>> Immanuel
>>
>> On Mon, Jan 4, 2021 at 3:07 PM Diego Zamboni  wrote:
>> >
>> > There's =org-babel-post-tangle-hook=, which AFAICT specifies hooks that 
>> > will be run with the tangled code in a temporary buffer. I couldn't find 
>> > much documentation nor examples, but it is mentioned at 
>> > https://orgmode.org/manual/Extracting-Source-Code.html#Hooks-3
>> >
>> > --Diego
>> >
>> >
>> >
>> >
>> >
>> > On Fri, Jan 1, 2021 at 1:31 PM Immanuel Litzroth 
>> >  wrote:
>> >>
>> >> I don't think there is an arg for that. I have written a tangler that
>> >> reuses a lot
>> >> of the org-babel machinery and has a more flexible mechanism to decide 
>> >> what
>> >> to do with the tangled code -- I use it for example to not write a
>> >> tangled file if it
>> >> hasn't changed, meaning that it will not trigger recompile.
>> >> The project is private now but if you're interested I can give you access 
>> >> to it.
>> >> What exactly are you trying to do?
>> >> Immanuel
>> >>
>> >> On Fri, Jan 1, 2021 at 2:09 AM George Mauer  wrote:
>> >> >
>> >> > I'd like to run some code to post-process files after they are tangled. 
>> >> > Is there a header-arg for that?
>> >>
>> >>
>> >>
>> >> --
>> >> -- Researching the dual problem of finding the function that has a
>> >> given point as fixpoint.
>> >>
>>
>>
>> --
>> -- Researching the dual problem of finding the function that has a
>> given point as fixpoint.



-- 
-- Researching the dual problem of finding the function that has a
given point as fixpoint.



Re: ist here a :post header arg for tangling?

2021-01-04 Thread Immanuel Litzroth
Oh and I also made the tangling itself more flexible in that you can now
also choose to only tangle stuff going to a certain file. This is mainly to be
able to define an interactive command that tangles/reloads everything going
to the file under point.
Immanuel

On Mon, Jan 4, 2021 at 4:31 PM Immanuel Litzroth
 wrote:
>
> Well I solved the problem by writing a tangler which can be configured
> with tangle-config
> you define a tangler by making a hash "language" -> tangle-hooks. The
> tangle-hooks are
> called at beginning of tangling, on each source block, on each
> noweb-ref and at the end of
> tangling. They receive the full source-block-info to do their work,
> and in the case of noweb-references
> they receive the full stack of sbi's that lead up to this noweb reference.
> >>>
> (tangled-buffer "Buffer that is being tangled")
>  (name "Name of the code block")
>  (tangle-file "Filename to tangle to")
>  (properties "Properties of this block")
>  (full-block "Text of the full block")
>  (beg-block "Buffer pos of beginning of the block in the tangled buffer")
>  (end-block "end of the block in the tangled buffer")
>  (lang "language of the tangled buffer")
>  (beg-lang "beginning of the language in the tangled buffer")
>  (end-lang "end of the language in the tangled buffer")
>  (switches "switches of this block")
>  (beg-switches "begin of the switches in this block")
>  (end-switches "end of the switches in this block")
>  (header-args "header args of this block")
>  (beg-header-args "buffer pos of header args beginning")
>  (end-header-args "buffer pos of header args end")
>  (body "body of the tangled block")
>  (beg-body "buffer pos of the beginning of the body")
>  (end-body "buffer pos of the end of the body"))
> >>>
> That way I can tangle a multi language org file and do the correct thing for
> each of the language by defining functions of interest. It's quite
> flexible, I'm
> going to use it to do some aspect-oriented programming/tangling when I
> find the time.
> Immanuel
>
> On Mon, Jan 4, 2021 at 4:11 PM Diego Zamboni  wrote:
> >
> > Agree. It should be possible to make the hook file-local, but still it's 
> > not trivial to have good control over where and how the changes are made.
> >
> > --Diego
> >
> >
> > On Mon, Jan 4, 2021 at 3:51 PM Immanuel Litzroth 
> >  wrote:
> >>
> >> There's that, but you're not gonna do much with that since it is
> >> global to emacs. If you're brimming
> >> with vigour you might achieve what you want by rebinding that each
> >> time you tangle to do the correct
> >> thing. Not much information is available in that hook, you get dropped
> >> into a temp buffer containing the
> >> result of tangling.
> >> Immanuel
> >>
> >> On Mon, Jan 4, 2021 at 3:07 PM Diego Zamboni  wrote:
> >> >
> >> > There's =org-babel-post-tangle-hook=, which AFAICT specifies hooks that 
> >> > will be run with the tangled code in a temporary buffer. I couldn't find 
> >> > much documentation nor examples, but it is mentioned at 
> >> > https://orgmode.org/manual/Extracting-Source-Code.html#Hooks-3
> >> >
> >> > --Diego
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > On Fri, Jan 1, 2021 at 1:31 PM Immanuel Litzroth 
> >> >  wrote:
> >> >>
> >> >> I don't think there is an arg for that. I have written a tangler that
> >> >> reuses a lot
> >> >> of the org-babel machinery and has a more flexible mechanism to decide 
> >> >> what
> >> >> to do with the tangled code -- I use it for example to not write a
> >> >> tangled file if it
> >> >> hasn't changed, meaning that it will not trigger recompile.
> >> >> The project is private now but if you're interested I can give you 
> >> >> access to it.
> >> >> What exactly are you trying to do?
> >> >> Immanuel
> >> >>
> >> >> On Fri, Jan 1, 2021 at 2:09 AM George Mauer  wrote:
> >> >> >
> >> >> > I'd like to run some code to post-process files after they are 
> >> >> > tangled. Is there a header-arg for that?
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> -- Researching the dual problem of finding the function that has a
> >> >> given point as fixpoint.
> >> >>
> >>
> >>
> >> --
> >> -- Researching the dual problem of finding the function that has a
> >> given point as fixpoint.
>
>
>
> --
> -- Researching the dual problem of finding the function that has a
> given point as fixpoint.



-- 
-- Researching the dual problem of finding the function that has a
given point as fixpoint.



Re: ist here a :post header arg for tangling?

2021-01-04 Thread Immanuel Litzroth
I also seem to remember that the buffer you are dropped into after tangling
doesn't even have the correct major mode set.
Immanuel

On Mon, Jan 4, 2021 at 4:11 PM Diego Zamboni  wrote:
>
> Agree. It should be possible to make the hook file-local, but still it's not 
> trivial to have good control over where and how the changes are made.
>
> --Diego
>
>
> On Mon, Jan 4, 2021 at 3:51 PM Immanuel Litzroth 
>  wrote:
>>
>> There's that, but you're not gonna do much with that since it is
>> global to emacs. If you're brimming
>> with vigour you might achieve what you want by rebinding that each
>> time you tangle to do the correct
>> thing. Not much information is available in that hook, you get dropped
>> into a temp buffer containing the
>> result of tangling.
>> Immanuel
>>
>> On Mon, Jan 4, 2021 at 3:07 PM Diego Zamboni  wrote:
>> >
>> > There's =org-babel-post-tangle-hook=, which AFAICT specifies hooks that 
>> > will be run with the tangled code in a temporary buffer. I couldn't find 
>> > much documentation nor examples, but it is mentioned at 
>> > https://orgmode.org/manual/Extracting-Source-Code.html#Hooks-3
>> >
>> > --Diego
>> >
>> >
>> >
>> >
>> >
>> > On Fri, Jan 1, 2021 at 1:31 PM Immanuel Litzroth 
>> >  wrote:
>> >>
>> >> I don't think there is an arg for that. I have written a tangler that
>> >> reuses a lot
>> >> of the org-babel machinery and has a more flexible mechanism to decide 
>> >> what
>> >> to do with the tangled code -- I use it for example to not write a
>> >> tangled file if it
>> >> hasn't changed, meaning that it will not trigger recompile.
>> >> The project is private now but if you're interested I can give you access 
>> >> to it.
>> >> What exactly are you trying to do?
>> >> Immanuel
>> >>
>> >> On Fri, Jan 1, 2021 at 2:09 AM George Mauer  wrote:
>> >> >
>> >> > I'd like to run some code to post-process files after they are tangled. 
>> >> > Is there a header-arg for that?
>> >>
>> >>
>> >>
>> >> --
>> >> -- Researching the dual problem of finding the function that has a
>> >> given point as fixpoint.
>> >>
>>
>>
>> --
>> -- Researching the dual problem of finding the function that has a
>> given point as fixpoint.



-- 
-- Researching the dual problem of finding the function that has a
given point as fixpoint.



Re: [PATCH] org-contacts.el: Only use org-id-store-link if org-id is loaded

2021-01-04 Thread miles christopher


I applied your patch, thanks. I don't want to use Gmail web UI or find out email
URL in mailing list archive. I'm using mu4e. Is there a convenient simple way
for mu4e user?

David Florness  writes:

> miles christopher  writes:
>
>> Thanks for your patch. :smile:
>>
>> Can you send patch file as attachment? I don't know how to apply patch in 
>> email body.
>
> Hi Miles,
>
> If you download the raw email message (which you should be able to do in
> the Gmail UI) you can apply the patch like so:
>
> git am < /path/to/download.eml
>
> Alternatively, you can download the email from the orgmode list archives
> and apply the patch using this one-line command:
>
> curl -s https://orgmode.org/list/874kjxpqht@florness.com/raw | git am
>
> Let me know if you run into any trouble.


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

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



Re: Accounting WAS Emacs-orgmode Digest, Vol 179, Issue 4

2021-01-04 Thread Daryl Manning
I do not use ledger within org-mode bit use a combo of libraries to make
ledger entries *look* and act like org-mode with folding. I find this work
(for me) much better than trying to mess with babel and having inline
ledger (basically, I treat my ledger file as a... ahem... ledger... I track
personal, budget, stock portfolio this way. It's very flexible and way way
better than using Quicken which does find with my Canuck accounts, but
cannot integrate my SG bank or stock broker.).

So I use `ledger-mode` directly configured like this in my init.el

```
;; == Ledger mode =
(use-package ledger-mode
  :ensure t
  :defer t
  :hook
  (ledger-mode . outline-minor-mode)
  :bind
  (:map ledger-mode-map
("TAB" . org-cycle))
  :config
  (font-lock-add-keywords 'ledger-mode outline-font-lock-keywords)
  :mode
  ("\\.ledger$" . ledger-mode)
  )

This also allows stars to deliineate hierarchy in the ledger and then fold
and unfold like an org doc. Super handy.

So, in one pane on my screen I have the ledger open (the tricky thing is
always setting up accounts and opening balances though there are some nice
tutorials for setting those up (if you have multiple currencies, *do* set
up accounts by currency early

eg.  Assets:CAD:Bank of Montreal
   Assets:SGD:OCBC
and for Liabilities like Credit Cards, lines of credit etc as well

The nice thing about this is you can have the ledger buffer open in one
panel and use C-{COR} for pulling up a balance report in the other pane
which automatically balances when you save the ledger file.

Also, in practical terms for day to day, rather than input things manually,
I highly recommend downloading csvs (or similar formats) from your bank and
using the ruby gem `reckon` which is a bayesian predictor that will learn
from your ledger on how to expense your bank account entries and then write
out the ledger file for you. Super handy.

Overly long blog post here:
https://daryl.wakatara.com/tracking-your-finances-with-reckon-and-ledger/
to get you goin if it's not just a formatting thing.

It also has some suggestions for category setups and the like.

Ledger is a bit steep to get started with but once you've got it setup it
does not require much time (especially with reckon) and is way more
flexible than something like Quicken if you have a complex financial life.

Anyhow, you do need to vinset a little time, but I have to admit I am
pretty impressed with it.

As someone else noted, you can also take a look at beancount, though I
personally still prefer the emacs integration available in ledger.

Hope this helped!

ciao !
Daryl.
PS> Even outside of emacs, I'd personally love to see people build some
more tools on top of the ledger format. I keep wanting to take a shot at
some portfolio tools, but never seem to be able to fit in the time.  =]


On Tue, Jan 5, 2021 at 1:01 AM  wrote:

>
>   19. accounting (Uwe Brauer)
>   20. Re: accounting (Eric S Fraga)
>   21. Re: Org to ConTeXt exporter? (Ludovic Courtès)
>   22. Re: accounting (Dr. Arne Babenhauserheide)
>   23. Re: ob-haskell (Leo)
>   24. Re: accounting (Daniele Nicolodi)
>   25. Re: accounting (Uwe Brauer)
>   26. Re: accounting (Charles Millar)
>   27. Re: accounting (Eric S Fraga)
>
>
>
> --
>
> Message: 19
> Date: Mon, 04 Jan 2021 09:54:00 +0100
> From: Uwe Brauer 
> To: emacs-orgmode@gnu.org
> Subject: accounting
> Message-ID: <87ble56q1j@mat.ucm.es>
> Content-Type: text/plain
>
>
> Hi
>
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html
>
> Points out how to use ledger within org mode.
>
> Is there any simpler solution?
>
> Regards
>
> Uwe Brauer
>
>
>
>
> --
>
> Message: 20
> Date: Mon, 04 Jan 2021 09:31:58 +
> From: Eric S Fraga 
> To: emacs-orgmode@gnu.org
> Subject: Re: accounting
> Message-ID: <871rf1m4j5@ucl.ac.uk>
> Content-Type: text/plain
>
> On Monday,  4 Jan 2021 at 09:54, Uwe Brauer wrote:
> > Points out how to use ledger within org mode.
> > Is there any simpler solution?
>
> How do you wish it to be simpler?  What is it you wish to do?
> --
> : Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-166-g291993
>
>
>
> --
>
> Message: 22
> Date: Mon, 04 Jan 2021 11:19:50 +0100
> From: "Dr. Arne Babenhauserheide" 
> To: Uwe Brauer 
> Cc: emacs-orgmode@gnu.org
> Subject: Re: accounting
> Message-ID: <87o8i5t35l@web.de>
> Content-Type: text/plain; charset="utf-8"
>
>
> Uwe Brauer  writes:
>
> > https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html
> >
> > Points out how to use ledger within org mode.
> >
> > Is there any simpler solution?
>
> Do you mean simpler accounting in org-mode, or do you mean simpler
> ledger-integration?
>
> You can always tangle your ledger-data and use a ledger commandline
> client. Also Emacs has direct support for ledger. Here’s a setup via
> use-package:
>
> (use-package ledger-mode :ensure t :defer 20
>   :config
>   (org-ba

Re: [PATCH] org-contacts.el: Only use org-id-store-link if org-id is loaded

2021-01-04 Thread David Florness
miles christopher  writes:

> I applied your patch, thanks. I don't want to use Gmail web UI or find
> out email URL in mailing list archive. I'm using mu4e. Is there a
> convenient simple way for mu4e user?

Oh cool, I use mu4e also :) I guessed you were using the Gmail UI since
you have a Gmail address.

Anyways, mu4e has an action function called
`mu4e-action-git-apply-patch' [0] for this.  If you setup this action with

(add-to-list 'mu4e-view-actions
 '("git am" . mu4e-action-git-apply-mbox))

and then type `a g` (`g` may be a different key that should display in
the message buffer) when viewing a PATCH email, Emacs should prompt you
for the repo's directory and the patch will be applied.

Hope this helps,

-- 
David

[0]: https://github.com/djcb/mu/blob/1.4.14/mu4e/mu4e-actions.el#L251


signature.asc
Description: PGP signature


Re: [QUESTION] Org "customid" and "coderef" links seems not fontified as other file: link

2021-01-04 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> Bump this thread, hi, Nicolas, any thoughts or update about this?
>
> stardiviner  writes:
>
>> I have following minimal testing code:
>>
>> #+begin_src emacs-lisp
>> (defun org-link-beautify (start end path bracketp)
>>   "Display icon for the Org link type."
>>   (message
>>(format "start: %s, end: %s, path: %s, bracketp: %s" start end path 
>> bracketp)))
>>
>> (dolist (link-type (mapcar 'car org-link-parameters))
>> (org-link-set-parameters link-type :activate-func #'org-link-beautify))
>> #+end_src
>>
>> The ~message~ does not print parameter values at all. I guess those 
>> "customid"
>> [[#Usage] and "coderef" (coderef) are different with "file:" etc links. Is 
>> this
>> true? 

That's correct. coderef, customid, and fuzzy links are internal links.
They are not really customizable. They are meant to behave the same in
all Org documents.

>> Here is my complete source code I want to try fontify customid and coderef
>> links.
>>
>> https://github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el#L67
>>
>> Is there any way to fix this problem?

Coderef and custom-id links are fontified, so you may still change their
appearance using font-lock configuration variables. Here be dragons.

Regards,
-- 
Nicolas Goaziou



Re: [PATCH] org-contacts.el: Only use org-id-store-link if org-id is loaded

2021-01-04 Thread David Florness
David Florness  writes:

> Anyways, mu4e has an action function called
> `mu4e-action-git-apply-patch' [0] for this.  If you setup this action with

I meant `mu4e-action-git-apply-mbox' here.

-- 
David


signature.asc
Description: PGP signature


Regression in table.el detection? [maint]

2021-01-04 Thread Kaushal Modi
Hello,

There has been a recent regression in table.el detection.

Earlier, this used to be detected as a table.el table, but now it's not
(entirely):


+--+--+--+
| Header 1 | Header 2 | Header 3 |
+--+--+--+
| a| b| c|
+--+--+--+
| d| e| f|
+--+--+--+


Before:


  

   Header 1 


   Header 2 


   Header 3 

  
  

   a


   b


   c

  
  

   d


   e


   f

  



After:


  

   Header 1 


   Header 2 


   Header 3 

  


I stumbled across this regression as I was looking into why my weekly cron
for ox-hugo tests failed:
https://travis-ci.org/github/kaushalmodi/ox-hugo/jobs/752831865


--
Kaushal Modi


Re: accounting

2021-01-04 Thread Uwe Brauer
>>> "ESF" == Eric S Fraga  writes:

   > On Monday,  4 Jan 2021 at 13:43, Uwe Brauer wrote:
   >> The example in this link is ok, also the output (the result of the
   >> ledger operation) is not very nicely formatted.

   > ledger does allow you to control, in detail, how the output should be
   > formatted.  The default output is suitable for a console display but you
   > can modify this through appropriate arguments to the ledger command line
   > via babel.  For instance, I have this line in my org file for generating
   > a balance of my assets:

   > ,#+call: year2020[:cmdline -V --format "%-20A %14T\n" bal --flat assets ]()


I am not sure I understand this (I admit I never used ledger, I used for
some time gnucash)

Do you mean this?

#+call: allinone[:cmdline -V --format "%-20A %14T\n" bal --flat assets ]()
#+name: allinone
#+begin_src ledger
2010/01/01 * Starting balance
  assets:bank:savings  1300.00
  income:starting balances
2010/07/22 * Got paid
  assets:bank:chequing  1000.00
  income:salary
2010/07/23 Rent
  expenses:rent  250.00
  assets:bank:chequing
2010/07/24 Food
  expenses:food  150.00
  assets:bank:chequing
2010/07/31 * Interest on bank savings
  assets:bank:savings  3.53
  income:interest
2010/07/31 * Transfer savings
  assets:bank:savings  250.00
  assets:bank:chequing
2010/08/01 got paid again
  assets:bank:chequing  1000.00
  income:salary
#+end_src




smime.p7s
Description: S/MIME cryptographic signature


Re: accounting

2021-01-04 Thread Uwe Brauer
>>> "DN" == Daniele Nicolodi  writes:

   > On 04/01/2021 09:54, Uwe Brauer wrote:
   >> Hi 
   >> 
   >> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html
   >> 
   >> Points out how to use ledger within org mode.
   >> 
   >> Is there any simpler solution?

   > As other pointed out, you are not describing what you want to
   > accomplish, thus is impossible to suggest anything concrete. However, I
   > would like to suggest to look at Beancount and beancount-mode as
   > alternatives to Ledger as plain text accounting tools.

Thanks, it seems that beancount is not in Ubuntu, and beancount-mode is
not available as a emacs package.

Do you have any pointers?

Thanks 


smime.p7s
Description: S/MIME cryptographic signature


Re: Accounting WAS Emacs-orgmode Digest, Vol 179, Issue 4

2021-01-04 Thread Uwe Brauer
> Also, in practical terms for day to day, rather than input things manually,
> I highly recommend downloading csvs (or similar formats) from your bank and
> using the ruby gem `reckon` which is a bayesian predictor that will learn
> from your ledger on how to expense your bank account entries and then write
> out the ledger file for you. Super handy.

> Overly long blog post here:
> https://daryl.wakatara.com/tracking-your-finances-with-reckon-and-ledger/
> to get you goin if it's not just a formatting thing.

Thanks I will have a look!!!


smime.p7s
Description: S/MIME cryptographic signature


Bug: inconsistent escaping of coderef regexp

2021-01-04 Thread Tom Gillespie
It is not possible to strip coderefs when tangling and also search for
those coderefs using org-link-search. This is because org-link-search
uses org-src-coderef-regexp which calls regexp-quote on the regexp
string while org-babel-tangle-single-block does not and uses the
regexp string directly without quoting it. I'm not sure about the best
way to fix this. It seems to me that the call to regexp-quote should
be removed but I'm not entirely sure of the consequences of doing
that. Thoughts? Best,
Tom

PS While on the topic of coderefs, let me drop a note that is a
preview of some of the issues I have encountered while working on a
full formal grammar for org. Having the -l switch control this is an
awful design that induces more complexity into the org-mode grammar
than nearly any other feature. Source block switches are completely
inconsistent with the rest of org and completely undiscoverable. I had
no idea they even existed until I was trying to figure out which
header argument could be used to set the coderef regexp. The -l option
and switches in general need to have their behavior implemented as
part of the standard header arguments like everything else so that
users can migrate away from switches with an eye toward removing them
entirely.



Re: accounting

2021-01-04 Thread Samuel Wales
i don't know if this is the best, but for some reason i had it so that
ledger goes into a block [used to be example or so, now is ledger],
and then post-process it with a shell source block.  perhaps this will
make more sense [in the distant past it made more sense to me].

when i process it, i call the source block, which means to run the
shell, which calls the ledger command on the data i keep in org.  for
some reason it outputs each line to the minibuffer, which is a bit
slow.  but it is not a big deal.  and i am not sure about searches.


On 1/4/21, Uwe Brauer  wrote:
 "DN" == Daniele Nicolodi  writes:
>
>> On 04/01/2021 09:54, Uwe Brauer wrote:
>>> Hi
>>>
>>>
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html
>>>
>>> Points out how to use ledger within org mode.
>>>
>>> Is there any simpler solution?
>
>> As other pointed out, you are not describing what you want to
>> accomplish, thus is impossible to suggest anything concrete. However,
> I
>> would like to suggest to look at Beancount and beancount-mode as
>> alternatives to Ledger as plain text accounting tools.
>
> Thanks, it seems that beancount is not in Ubuntu, and beancount-mode is
> not available as a emacs package.
>
> Do you have any pointers?
>
> Thanks
>


-- 
The Kafka Pandemic

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



Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]

2021-01-04 Thread Nick Dokos
Nicolas Goaziou  writes:

> Hello,
>
> Nick Dokos  writes:
>
> [...]
>
>> Evaluating `(org-element-at-point)' returns `(paragraph ...)' all along
>> the top line and `(table ( :type org ))' when the cursor is at
>> the beginning of the `a b c' line.
>
> Fixed. Thank you.
>

Thank you!

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




following links disables sparse tree highlighting

2021-01-04 Thread Samuel Wales
when i do org-sparse-tree regexp search, keywords are highlighted and
i can use next-error.  when i then click on a link with mouse, the
highlighting disappears.  i have set org-remove-highlights-with-change
to nil.  can i do anything to make the highlights stay?



advanced search for patterns

2021-01-04 Thread hj-orgmode-1
hello, I have been using orgmode for a while , and noticed that I can 
find headings based on tags, but I haven't figured out whether there is 
a way to say in emacs org-mode :


  find me all the (lowest-level) headings [ or heading-paths ] that 
contains text (whether formatted as source code blocks or whatever) that 
matches, say three, (regexp) patterns, e.g. :


   (M|m)artha
   ((buy|bought)[^\n]*milk(s?))
   (pay|paid|USD)

 How would one ask org-mode to find all such headings (in all opened 
org-mode buffers , preferably :) )


 I guess one could try to connect the three regexps with something like 
a negative-lookahead "does not contain '\n\*'" string, like


   (M|m)artha (:!\n\*){0}   ((buy|bought)[^\n]*milk(s?)) (:!\n\*){0}   
(pay|paid|USD)  |  \
   (pay|paid|USD)  (:!\n\*){0} (M|m)artha (:!\n\*){0} 
((buy|bought)[^\n]*milk(s?))    |  \
   ((buy|bought)[^\n]*milk(s?))  (:!\n\*){0}   (M|m)artha (:!\n\*){0}   
(pay|paid|USD)  |  \
   (pay|paid|USD)  (:!\n\*){0} (M|m)artha (:!\n\*){0} 
((buy|bought)[^\n]*milk(s?))    |  \

    ...

 but that's just ugly. And would it work at all? Would it not be so 
slow to make it impractical?


  Or is there a way to say "search all headings for pattern1" in all 
files, then filter the results by pattern2, then filter the results by 
pattern3 ?? How? Someone surely must have done this before ...



   thx!!

    HJ




Re: advanced search for patterns

2021-01-04 Thread Samuel Wales
with the correct variable settings, i think you can do

  {pat1} {pat2} {pat3} -{pat4}

you can check the manual for the search settings.


On 1/4/21, hj-orgmod...@hj.proberto.com  wrote:
> hello, I have been using orgmode for a while , and noticed that I can
> find headings based on tags, but I haven't figured out whether there is
> a way to say in emacs org-mode :
>
>    find me all the (lowest-level) headings [ or heading-paths ] that
> contains text (whether formatted as source code blocks or whatever) that
> matches, say three, (regexp) patterns, e.g. :
>
>     (M|m)artha
>     ((buy|bought)[^\n]*milk(s?))
>     (pay|paid|USD)
>
>   How would one ask org-mode to find all such headings (in all opened
> org-mode buffers , preferably :) )
>
>   I guess one could try to connect the three regexps with something like
> a negative-lookahead "does not contain '\n\*'" string, like
>
>     (M|m)artha (:!\n\*){0}   ((buy|bought)[^\n]*milk(s?)) (:!\n\*){0}
> (pay|paid|USD)  |  \
>     (pay|paid|USD)  (:!\n\*){0} (M|m)artha (:!\n\*){0}
> ((buy|bought)[^\n]*milk(s?))    |  \
>     ((buy|bought)[^\n]*milk(s?))  (:!\n\*){0}   (M|m)artha (:!\n\*){0}
> (pay|paid|USD)  |  \
>     (pay|paid|USD)  (:!\n\*){0} (M|m)artha (:!\n\*){0}
> ((buy|bought)[^\n]*milk(s?))    |  \
>      ...
>
>   but that's just ugly. And would it work at all? Would it not be so
> slow to make it impractical?
>
>    Or is there a way to say "search all headings for pattern1" in all
> files, then filter the results by pattern2, then filter the results by
> pattern3 ?? How? Someone surely must have done this before ...
>
>
>     thx!!
>
>      HJ
>
>
>


-- 
The Kafka Pandemic

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



Re: advanced search for patterns

2021-01-04 Thread Samuel Wales
correction:

  *{pat1} {pat2} {pat3} -{pat4}

should do the trick iiuc and if you have the varialbe setc.



Org-capture template no longer recognised...

2021-01-04 Thread Neil Shephard
Hi,

I am enjoying learning more and more about how functional and useful
org-mode is, truly amazing software.

One thing I've setup is a Babel document for logging exercise activities
and accompanying custom org-capture-templates for entering data.  These
worked great until recently but with no conscious change to my
org-capture-template they are now broken.

A simple example of the document is ~/org/training/training.org

* Running
** Log
#+NAME: running-log
#+CAPTION: Running Log
| Date | Route | Distance | Time |
Pace  | Notes   |
|--+---+--+--+---+-|
| <2021-01-03 Fri> | Shorter 12km run  | 12.25km  | 60min + 25s  | 4
min / km + 55.918367 s / km | Less icey!  |
| <2021-01-01 Fri> | Longer 16km run   | 16.22km  | 80min + 03s  | 4
min / km + 56.115906 s / km | Icey!   |

I then have a ~/org/computing.org for keeping notes of tasks to do, a
simple example is...

* Emacs
** TODO <2020-11-11 Wed> vterm only on non-work computers.

My org-capture-templates are...

(setq org-capture-templates
'(;; Computing
  ("c" "Computing")
  ("ce" "Emacs" entry (file+olp "~/org/computing.org" "Emacs")
   "* TODO %t %?\n" :prepend t)
  ;; Exercise
  ("e" "Exercise")
  ("er" "Logging a run" table-line (file+olp
"~/org/training/training.org" "Running" "Log")
   "| %t | %? | km | min + s | | |" :prepend t)
  ("ec" "Logging a cycle" table-line (file+olp
"~/org/training/training.org" "Cycling" "Log")
   "| %t | %? | km | min + s | | |" :prepend t)))


Until recently I could invoke org-capture, select e r and I'd be
prompted to enter data under Route...

| <2021-01-03 |  | km | min + s | | |


On saving this would populate the table and calculate the pace.  Now
though I'm informed...

Capture abort: Symbol's function definition is void: assert

Debugging shows...
Debugger entered--Lisp error: (error "Capture abort: Symbol’s function
definition is voi...")
 signal(error ("Capture abort: Symbol’s function definition is voi..."))
 error("Capture abort: %s" "Symbol’s function definition is void: assert")
 org-capture(nil) funcall-interactively(org-capture nil)
 call-interactively(org-capture nil nil)
 command-execute(org-capture)

I asked on Emacs Stackexchange

and it was suggested the error lay with cl.el as assert is a function
of this deprecated package.  The suggested additional of (require 'cl)
didn't improve things, just got a

different error message...

Debugger entered--Lisp error: (error "Capture abort: Invalid function: assert")
  signal(error ("Capture abort: Invalid function: assert"))
  error("Capture abort: %s" "Invalid function: assert")
  org-capture(nil)
  funcall-interactively(org-capture nil)
  call-interactively(org-capture nil nil)
  command-execute(org-capture)

As I say I'd not changed my configuration which is the org-mode
bundled with Emacs 27.1.  I do have

a few computers though and it was still working on a second system
until I update installed packages,

after which the original error messsage (Capture abort: Symbol's
function definition is void: assert)
occurred again.  The packages I updated seem unrelated (to my
untrained eye). They were...

company-20201214.1620
ein-20201217.1508
flycheck-20201214.2154
forge-20201212.905
magit-20201212.929
org-ref-20201126.1924
pass-20190830.2017
projectile-20201214.839
python-mode-20201218.751
pyvenv-20201210.1509
auctex-12.3.1
dash-20201215.59
dash-functional-20201215.40
ess-20201217.1440
git-commit-20201115.2313
helm-20201215.1623
helm-core-20201202.907
ivy-20201217.1559
key-chord-20160227.1238
markdown-mode-20201211.329
mpdel-20201026.1123
transient-20201205.1610

What is strange is that capturing to ~/org/computing.org still works fine.

If there is any more information I can provide to assist with working
out where this is occurring
please let me know.

Thanks and regards,

Neil

--
*Ignorance more frequently begets confidence than does knowledge* - Charles
Darwin

PGP Public : 0x700172212EF5818B


Re: accounting

2021-01-04 Thread Daniele Nicolodi
On 04/01/2021 21:04, Uwe Brauer wrote:
 "DN" == Daniele Nicolodi  writes:
> 
>> On 04/01/2021 09:54, Uwe Brauer wrote:
>>> Hi 
>>> 
>>> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html
>>> 
>>> Points out how to use ledger within org mode.
>>> 
>>> Is there any simpler solution?
> 
>> As other pointed out, you are not describing what you want to
>> accomplish, thus is impossible to suggest anything concrete. However, I
>> would like to suggest to look at Beancount and beancount-mode as
>> alternatives to Ledger as plain text accounting tools.
> 
> Thanks, it seems that beancount is not in Ubuntu, and beancount-mode is
> not available as a emacs package.
> 
> Do you have any pointers?

https://beancount.github.io/

is the project home page. You can find the documentation here:

https://beancount.github.io/docs/

I haven't submitted beancount-mode to any Emacs package repository yet,
there is still some work I would like to do before doing it. You can
find it here:

https://github.com/beancount/beancount-mode

with some minimal documentation.

Beancount is distributed as a Python package, thus it should be easily
installable on any system providing Python 3.6 or later.

Cheers,
Dan



[PATCH] org-macs: Allow specifying relative time in hours

2021-01-04 Thread Daniel Gröber
This adds support for date expressions such as +12h to
org-matcher-time. The regexp this function uses to parse such relative
expressions already includes the "h" character but doesn't actually
handle that case.

AFAICT org-mode commit ec921a2a68 ("Support hourly repeat cookies")
neglected to add support here.
---
 doc/org-manual.org | 14 --
 lisp/org-macs.el   |  5 +++--
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index b015b502c..740549cf5 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -6052,15 +6052,17 @@ various inputs are interpreted, the items filled in by 
Org mode are in
 | =2012-w04-5=   | \rArr{} Same as above   |
 
 Furthermore you can specify a relative date by giving, as the /first/
-thing in the input: a plus/minus sign, a number and a letter---=d=,
-=w=, =m= or =y=---to indicate change in days, weeks, months, or
-years.  With a single plus or minus, the date is always relative to
-today.  With a double plus or minus, it is relative to the default
-date.  If instead of a single letter, you use the abbreviation of day
-name, the date is the Nth such day, e.g.:
+thing in the input: a plus/minus sign, a number and a letter---=h=,
+=d=, =w=, =m= or =y=---to indicate a change in hours, days, weeks,
+months, or years.  With =h= the date is relative to the current time,
+with the other letters and a single plus or minus, the date is
+relative to today at 00:00.  With a double plus or minus, it is
+relative to the default date.  If instead of a single letter, you use
+the abbreviation of day name, the date is the Nth such day, e.g.:
 
 | =+0=| \rArr{} today   |
 | =.= | \rArr{} today   |
+| =+2h=   | \rArr{} two hours from now  |
 | =+4d=   | \rArr{} four days from today|
 | =+4=| \rArr{} same as +4d |
 | =+2w=   | \rArr{} two weeks from today|
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 56afdf6ef..d40ed1a04 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -1228,10 +1228,11 @@ Return 0. if S is not recognized as a valid value."
((string= s "") (+ 86400.0 today))
((string= s "") (- today 86400.0))
((string-match "\\`<\\([-+][0-9]+\\)\\([hdwmy]\\)>\\'" s)
-   (+ today
+   (+ (if (string= (match-string 2 s) "h") (float-time) today)
   (* (string-to-number (match-string 1 s))
  (cdr (assoc (match-string 2 s)
- '(("d" . 86400.0)   ("w" . 604800.0)
+ '(("h" . 3600.0)
+   ("d" . 86400.0)   ("w" . 604800.0)
("m" . 2678400.0) ("y" . 31557600.0)))
((string-match org-ts-regexp0 s) (org-2ft s))
(t 0.)
-- 
2.20.1




[PATCH v2] org-contacts.el: Only use org-id-store-link if org-id is loaded

2021-01-04 Thread David Florness
Fixes bug introduced in 6b83c6e4e that made org-contacts-anniversaries
error if org-id was not loaded.
---
v1 -> v2: Stefan Monnier made a good suggestion to use bound-and-true-p
instead here: https://lists.gnu.org/r/emacs-devel/2021-01/msg00257.html

Alternatively, we could autoload org-id-link-to-org-use-id.  If you all
would prefer this, let me know and I can send a v3 patch.

6b83c6e4e was found using git-blame.

 contrib/lisp/org-contacts.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 82881ecd0..3df1b52dd 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -1166,7 +1166,7 @@ are effectively trimmed).  If nil, all zero-length 
substrings are retained."
   "Store the contact in `org-contacts-files' with a link."
   (when (and (eq major-mode 'org-mode)
 (member (buffer-file-name) (mapcar 'expand-file-name 
org-contacts-files)))
-(if org-id-link-to-org-use-id
+(if (bound-and-true-p org-id-link-to-org-use-id)
(org-id-store-link)
   (let ((headline-str (substring-no-properties (org-get-heading t t t t
(org-store-link-props
-- 
2.30.0



signature.asc
Description: PGP signature


Re: [PATCH v2] org-contacts.el: Only use org-id-store-link if org-id is loaded

2021-01-04 Thread Kyle Meyer
David Florness writes:

> Fixes bug introduced in 6b83c6e4e that made org-contacts-anniversaries
> error if org-id was not loaded.
> ---
> v1 -> v2: Stefan Monnier made a good suggestion to use bound-and-true-p
> instead here: https://lists.gnu.org/r/emacs-devel/2021-01/msg00257.html

stardiviner already applied/pushed v1 to master, so please reposition
the patch on top of the previous commit (e6e1c0811).  Also, while we're
less strict about the commit message format for contrib/ files, it'd
still be good to follow the changelog entry convention.

Thanks.



[PATCH] org-contacts.el: Use `bound-and-true-p' to check (unbound) var

2021-01-04 Thread David Florness
* org-contacts.el (org-contacts-link-store): Use `bound-and-true-p' to
check the truthiness of org-id-link-to-org-use-id, which may or may
not be bound depending on whether org-id has been loaded.  This
simplifies the code.
---
Thank you, Kyle.  This patch should do the trick.  I'm always happy to
send another revision so feel free to nitpick.

 contrib/lisp/org-contacts.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 7ad425519..3df1b52dd 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -1166,7 +1166,7 @@ are effectively trimmed).  If nil, all zero-length 
substrings are retained."
   "Store the contact in `org-contacts-files' with a link."
   (when (and (eq major-mode 'org-mode)
 (member (buffer-file-name) (mapcar 'expand-file-name 
org-contacts-files)))
-(if (and (featurep 'org-id) org-id-link-to-org-use-id)
+(if (bound-and-true-p org-id-link-to-org-use-id)
(org-id-store-link)
   (let ((headline-str (substring-no-properties (org-get-heading t t t t
(org-store-link-props
-- 
2.30.0



signature.asc
Description: PGP signature


Re: [QUESTION] Org "customid" and "coderef" links seems not fontified as other file: link

2021-01-04 Thread miles christopher


Nicolas Goaziou  writes:

> Hello,
>
> stardiviner  writes:
>
>> Bump this thread, hi, Nicolas, any thoughts or update about this?
>>
>> stardiviner  writes:
>>
>>> I have following minimal testing code:
>>>
>>> #+begin_src emacs-lisp
>>> (defun org-link-beautify (start end path bracketp)
>>>   "Display icon for the Org link type."
>>>   (message
>>>(format "start: %s, end: %s, path: %s, bracketp: %s" start end path 
>>> bracketp)))
>>>
>>> (dolist (link-type (mapcar 'car org-link-parameters))
>>> (org-link-set-parameters link-type :activate-func #'org-link-beautify))
>>> #+end_src
>>>
>>> The ~message~ does not print parameter values at all. I guess those 
>>> "customid"
>>> [[#Usage] and "coderef" (coderef) are different with "file:" etc links. Is 
>>> this
>>> true? 
>
> That's correct. coderef, customid, and fuzzy links are internal links.
> They are not really customizable. They are meant to behave the same in
> all Org documents.
>
>>> Here is my complete source code I want to try fontify customid and coderef
>>> links.
>>>
>>> https://github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el#L67
>>>
>>> Is there any way to fix this problem?
>
> Coderef and custom-id links are fontified, so you may still change their
> appearance using font-lock configuration variables. Here be dragons.
>
> Regards,

I see, I searched some font-lock example code, but have not found any example
about font-lock + text-property. (Maybe my searching words is not good
enough...) How to write it? Do you got any hints? Thanks for your helping.

By the way I got an issue that org-link-beautify conflict with yasnippet[fn:1].
I know the key point is how Org Mode fontify the link. I tried to read code, but
have not found hint about how to disable fontify on link temporary. Can you give
some suggestion about this problem? Thanks too.

[fn:1] https://github.com/stardiviner/org-link-beautify/issues/5

Regards,

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

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





Re: [PATCH] org-contacts.el: Use `bound-and-true-p' to check (unbound) var

2021-01-04 Thread Kyle Meyer
David Florness writes:

> Thank you, Kyle.  This patch should do the trick.  I'm always happy to
> send another revision so feel free to nitpick.

Thank you.  Looks good to me, but I'll leave the final review/apply up
to stardiviner.



Re: [PATCH] ol: Avoid initial input when completing function for storing link

2021-01-04 Thread Kyle Meyer
Kyle Meyer writes:

> John Kitchin writes:
>
>> Is there an easy way to avoid this, or to modify the order of the functions
>> used? I want to see all the options for storing, or better, to just store
>> them all and let me choose later when I use org-insert-link.
>
> The "or better" sounds reasonable.  Perhaps someone will attempt that,
> but in the meantime I think just avoiding the discouraged/mostly
> deprecated INITIAL-INPUT argument would be a good improvement.
>
> -- >8 --
> Subject: [PATCH] ol: Avoid initial input when completing function for storing
>  link

Pushed (00b4de329).



Re: Regression in table.el detection? [maint]

2021-01-04 Thread Kyle Meyer
Kaushal Modi writes:

> Hello,
>
> There has been a recent regression in table.el detection.
>
> Earlier, this used to be detected as a table.el table, but now it's not
> (entirely):
>
>
> +--+--+--+
> | Header 1 | Header 2 | Header 3 |
> +--+--+--+
> | a| b| c|
> +--+--+--+
> | d| e| f|
> +--+--+--+

> Before:

Exporting that table to html, I see "Before" on release_9.4.4, maint
(273391c97), and master (00b4de329).

You're able to trigger the issue with a vanilla configuration on maint?



Re: Regression in table.el detection? [maint]

2021-01-04 Thread Kaushal Modi
On Tue, Jan 5, 2021 at 1:15 AM Kyle Meyer  wrote:

>
>
> Exporting that table to html, I see "Before" on release_9.4.4, maint
> (273391c97), and master (00b4de329).
>
> You're able to trigger the issue with a vanilla configuration on maint?
>

Hi Kyle,

Thanks for checking. Indeed ox-html export does not show that issue.

But the weekly cron (and even local) ox-hugo exports started showing this
issue after the update to table.el table detection change that happened a
few weeks ago.

I'll investigate why only ox-hugo is showing this issue.. I am simply
calling the table.el related function from ox-html:

=
(defun org-blackfriday-table (table contents info)
  "Transcode TABLE element into Blackfriday Markdown format.

CONTENTS is contents of the table.  INFO is a plist holding
contextual information."
  ;; (message "[ox-bf-table DBG] In contents: %s" contents)
  (if (eq (org-element-property :type table) 'table.el)
  ;; "table.el" table.  Convert it using appropriate tools.
  (let ((tbl (org-html-table--table.el-table table info)))
(message "%S" table) ; just added this for debug
(message "%S" tbl) ; just added this for debug
=

and I am getting only partial table in the "tbl" variable

=
(table (:begin 1860 :end 2062 :type table\.el :tblfm nil :contents-begin
nil :contents-end nil :value "+--+--+--+
| Header 1 | Header 2 | Header 3 |
+--+--+--+
| a | b | c |
+--+--+--+
| d | e | f |
+--+--+--+" :post-blank 1 :post-affiliated 1860
:parent (section (:begin 1703 :end 2062 :contents-begin 1703 :contents-end
2062 :post-blank 1 :post-affiliated 1703 :parent (org-data nil #2))
(special-block (:type "description" :begin 1703 :end 1783 :contents-begin
1723 :contents-end 1765 :post-blank 1 :post-affiliated 1703 :parent #2)
(paragraph (:begin 1723 :end 1765 :contents-begin 1723 :contents-end 1765
:post-blank 1 :post-affiliated 1723 :parent #3) #("Support tables written
in table.el format
" 0 42 (:parent #4 (paragraph (:begin 1783 :end 1860 :contents-begin
1783 :contents-end 1859 :post-blank 1 :post-affiliated 1783 :parent #2)
(verbatim (:value "ox-hugo" :begin 1783 :end 1793 :post-blank 1 :parent
#3)) #("Issue #" 0 7 (:parent #3)) (link (:type "https" :path "//
github.com/kaushalmodi/ox-hugo/issues/374" :format bracket :raw-link "
https://github.com/kaushalmodi/ox-hugo/issues/374"; :application nil
:search-option nil :begin 1800 :end 1858 :contents-begin 1853 :contents-end
1856 :post-blank 0 :parent #3) #("374" 0 3 (:parent #4))) #("
" 0 1 (:parent #3))) #0)))
"

  

   Header 1 


   Header 2 


   Header 3 

  
"
=

I'll keep looking..


Re: Regression in table.el detection? [maint]

2021-01-04 Thread Kaushal Modi
On Tue, Jan 5, 2021 at 1:36 AM Kaushal Modi  wrote:

>
> I'll keep looking..
>

OK, when I added the same debug messages to ox-html.el, I see:

=
(table (:begin 1860 :end 2104 :type table\.el :tblfm nil :contents-begin
nil :contents-end nil :value "+--+--+--+
| Header 1 | Header 2 | Header 3 |
+--+--+--+
| a| b| c|
+--+--+--+
| d| e| f|
+--+--+--+" :post-blank 1 :post-affiliated 1860
:parent (section (:begin 1703 :end 2104 :contents-begin 1703 :contents-end
2104 :post-blank 1 :post-affiliated 1703 :parent (org-data nil #2))
(special-block (:type "description" :begin 1703 :end 1783 :contents-begin
1723 :contents-end 1765 :post-blank 1 :post-affiliated 1703 :parent #2)
(paragraph (:begin 1723 :end 1765 :contents-begin 1723 :contents-end 1765
:post-blank 1 :post-affiliated 1723 :parent #3) #("Support tables written
in table.el format
" 0 42 (:parent #4 (paragraph (:begin 1783 :end 1860 :contents-begin
1783 :contents-end 1859 :post-blank 1 :post-affiliated 1783 :parent #2)
(verbatim (:value "ox-hugo" :begin 1783 :end 1793 :post-blank 1 :parent
#3)) #("Issue #" 0 7 (:parent #3)) (link (:type "https" :path "//
github.com/kaushalmodi/ox-hugo/issues/374" :format bracket :raw-link "
https://github.com/kaushalmodi/ox-hugo/issues/374"; :application nil
:search-option nil :begin 1800 :end 1858 :contents-begin 1853 :contents-end
1856 :post-blank 0 :parent #3) #("374" 0 3 (:parent #4))) #("
" 0 1 (:parent #3))) #0)))
"
=

ox-hugo is stripping the leading/trailing spaces from the table cells,
while ox-html is not. Somehow that doesn't play with the recent change to
table.el detection.

I'll try fixing that in ox-hugo.


Re: Regression in table.el detection? [maint]

2021-01-04 Thread Kaushal Modi
Hi Kyle,

I was able to reproduce with issue with ox-html as well.

Please copy paste this in a new temp.org file and run `C-c C-e h H':

* Subtree 1
+--+--+--+
| Header 1 | Header 2 | Header 3 |
+--+--+--+
| a| b| c|
+--+--+--+
| d| e| f|
+--+--+--+
* Subtree 2


The issue is when the "* Subtree 2" begins in the very next line after that
last line of table.el table ending in "--+".

When I export that, I see that ox-html fails to detect that table.el table
because I see this in the exported buffer:

=












Header 1
Header 2
Header 3




--


=

But if I introduce a newline before "* Subtree 2", the table.el table
detection works fine.



--
Kaushal Modi


Re: accounting

2021-01-04 Thread Uwe Brauer

> On 04/01/2021 21:04, Uwe Brauer wrote:

> https://beancount.github.io/

> is the project home page. You can find the documentation here:

> https://beancount.github.io/docs/

> I haven't submitted beancount-mode to any Emacs package repository yet,
> there is still some work I would like to do before doing it. You can
> find it here:

> https://github.com/beancount/beancount-mode

> with some minimal documentation.

> Beancount is distributed as a Python package, thus it should be easily
> installable on any system providing Python 3.6 or later.

Thanks, I am still on Ubuntu 16.04 running 3.5 and call install
beancount, I once tried upgrading python and it caused a lot of other
problems, most likely I have to upgrade Ubuntu, sigh


smime.p7s
Description: S/MIME cryptographic signature