Re: Libre vs Open Office [was: Export Org mode files to (gag, barf) MS Office?]

2021-06-27 Thread Marcin Borkowski


On 2021-06-26, at 22:12, to...@tuxteam.de wrote:

> On Sat, Jun 26, 2021 at 09:49:02PM +0200, Marcin Borkowski wrote:
>> 
>> On 2021-06-26, at 21:18, to...@tuxteam.de wrote:
>> 
>> > On Sat, Jun 26, 2021 at 04:27:19PM +, Brandon Taylor wrote:
>> >> I’ve seen that LibreOffice can read and write to those formats, whereas 
>> >> OpenOffice can only read them. Or has OpenOffice overcome that particular 
>> >> barrier?
>> >
>> > I think OpenOffice is practically dead. All interesting development
>> > happens in LibreOffice, at least for the last ten years. Heck, it
>> > was practically dead 2015.
>> >
>> > It is a long, sad story. Currently I wouldn't even bet on OpenOffice
>> > not having unpatched critical security bugs.
>> 
>> Out of curiosity: why sad? I've been using OpenOffice many years ago
>> (StarOffice earlier), now I'm using LibreOffice.  Wasn't that basically
>> a rename?
>
> The sad part, in a few words, is that OpenOffice still kept the "brand
> recognition", but is basically unmaintained at this point.
>
> Many users (especially in Windows land, the Linus ones seem to know) are
> still lured by the brand to download and use unmaintained software.
>
> It is as if Oracle, by donating OpenOffice to the Apache Software Foundation,
> wanted to sabotage free office software. But why?

Sad indeed.  Didn't know that.  I just noticed at some point that LO was
what I should use from now on to deal with those pesky (doc|xls)x? files
and that was it.  I also installed it on my daughter's Windoze laptop
etc.  I just thought there is no more OO...

Thanks,
mbork


>
> Cheers
>
> [1] https://pctechmag.com/2011/06/oracle-and-openoffice-the-final-insult/
>
>  - t


-- 
Marcin Borkowski
http://mbork.pl



Re: Export Org mode files to (gag, barf) MS Office?

2021-06-26 Thread Marcin Borkowski


On 2021-06-26, at 21:18, to...@tuxteam.de wrote:

> On Sat, Jun 26, 2021 at 04:27:19PM +, Brandon Taylor wrote:
>> I’ve seen that LibreOffice can read and write to those formats, whereas 
>> OpenOffice can only read them. Or has OpenOffice overcome that particular 
>> barrier?
>
> I think OpenOffice is practically dead. All interesting development
> happens in LibreOffice, at least for the last ten years. Heck, it
> was practically dead 2015.
>
> It is a long, sad story. Currently I wouldn't even bet on OpenOffice
> not having unpatched critical security bugs.

Out of curiosity: why sad? I've been using OpenOffice many years ago
(StarOffice earlier), now I'm using LibreOffice.  Wasn't that basically
a rename?

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: How to have a repeating item within some hours?

2021-05-10 Thread Marcin Borkowski


On 2021-04-03, at 12:50, Christian Moe  wrote:

> If it's on the same day, how about this?
>
> ** <2021-03-29 Mon 05:15-06:16 +7d> Time block

That's interesting, since it seems to work (kind of - it puts a space
after the dash for some reason, but I can liver with it).  Thanks!

Is it documented somewhere?  May I rely on this feature or is it there
by accident and might disappear in a future version?

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: Emacs Lisp book (was: Step by step tutorial on Worg on how to create a new export backend)

2021-05-01 Thread Marcin Borkowski


On 2021-05-01, at 10:37, Timothy  wrote:

> Marcin Borkowski  writes:
>
>> Surprise, surprise!
>>
>> The book is out!
>>
>> Before you get too excited - it's not complete yet.  I published a draft
>> on Leanpub, which is a platform for publishing (and selling) books in
>> progress.  I plan to finish it by September, but if you want to take
>> a peek, here is a coupon code for you to get it for free (the coupon is
>> valid for a week)!
>>
>> https://leanpub.com/hacking-your-way-emacs/c/f23s5unGtLf0
>>
>> Best,
>
> Interesting. I wanted to take a peek but I can't see how to view it for
> free ... I may be blind though.

Sorry, my email was meant as a private message to Jean-Christophe.
Sorry for the noise.

You can get a free sample on https://leanpub.com/hacking-your-way-emacs
- it's the introduction and the first chapter.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Emacs Lisp book (was: Step by step tutorial on Worg on how to create a new export backend)

2021-05-01 Thread Marcin Borkowski


On 2020-02-16, at 01:46, Jean-Christophe Helary 
 wrote:

> Aren't you supposed to write a book about Emacs already ? ;)

Surprise, surprise!

The book is out!

Before you get too excited - it's not complete yet.  I published a draft
on Leanpub, which is a platform for publishing (and selling) books in
progress.  I plan to finish it by September, but if you want to take
a peek, here is a coupon code for you to get it for free (the coupon is
valid for a week)!

https://leanpub.com/hacking-your-way-emacs/c/f23s5unGtLf0

Best,

--
Marcin Borkowski
http://mbork.pl



Re: Repository of Org files with important dates?

2021-04-17 Thread Marcin Borkowski


On 2021-04-18, at 01:42, David Masterson  wrote:

> Marcin Borkowski  writes:
>
>> On 2021-04-16, at 17:55, Eric S Fraga  wrote:
>>
>>> If you want solar based information (equinox, solstice, etc.), which is
>>> not quite what you mentioned, I used this script to generate org file
>>> headings:
>>
>> Can't Emacs itself generate those data?
>
> Hmm. I don't see a date function in Elisp...

Have you checked the files solar.el and lunar.el?

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: Repository of Org files with important dates?

2021-04-16 Thread Marcin Borkowski


On 2021-04-16, at 17:55, Eric S Fraga  wrote:

> If you want solar based information (equinox, solstice, etc.), which is
> not quite what you mentioned, I used this script to generate org file
> headings:

Can't Emacs itself generate those data?

-- 
Marcin Borkowski
http://mbork.pl



Re: How to have a repeating item within some hours?

2021-04-02 Thread Marcin Borkowski
Ping?

On 2021-03-28, at 11:52, Marcin Borkowski  wrote:

> Hi Orgers,
>
> I'd like to have a repeating time block on the agenda, say every Monday
> from 5:15 to 6:15.  I tried this:
>
> ** <2021-03-29 Mon 05:15 +7d>--<2021-03-29 Mon 06:15 +7d> Time block
>
> but it didn't show on the agenda, and this:
>
> ** Time block
> SCHEDULED: <2021-03-29 Mon 05:15 +7d>--<2021-03-29 Mon 06:15 +7d>
>
> but it didn't show the end time.
>
> Any hints?


-- 
Marcin Borkowski
http://mbork.pl



Re: Using backticks for the inline code delimeter?

2021-04-01 Thread Marcin Borkowski


On 2021-03-31, at 21:19, Timothy  wrote:

> autofrettage  writes:
>
>> Quick and Dirty: Bind key '`' to ~ in Emacs?

My first thought exactly.  And I'd definitely use it - I need to use
Markdown more often than I'd like to (chat, wikis, (cloud-based) task
management system...).

>> (I guess it is clear I haven't thought about the consequences.)
>
> You can add that just to the Org-mode map. That wouldn't be too bad,
> there's always C-q.

and you can also make it that pressing the backtick /twice/ yields
a normal backtick (and that can be actually coded in more than one
way).  Or, you can make /three/ backticks in a row enter a src block
(which would be even more Markdown-y).

Best,

-- 
Marcin Borkowski
http://mbork.pl



How to have a repeating item within some hours?

2021-03-28 Thread Marcin Borkowski
Hi Orgers,

I'd like to have a repeating time block on the agenda, say every Monday
from 5:15 to 6:15.  I tried this:

** <2021-03-29 Mon 05:15 +7d>--<2021-03-29 Mon 06:15 +7d> Time block

but it didn't show on the agenda, and this:

** Time block
SCHEDULED: <2021-03-29 Mon 05:15 +7d>--<2021-03-29 Mon 06:15 +7d>

but it didn't show the end time.

Any hints?

-- 
Marcin Borkowski
http://mbork.pl



Re: Where has the manual on one html page gone?

2021-02-16 Thread Marcin Borkowski


On 2021-02-15, at 23:45, Nick Dokos  wrote:

> Christine Köhn  writes:
>
>> Hi,
>>
>> I always used the manual online as one html page but it does not seem to
>> be available since (?) the website revamp. I prefer the manual as one
>> page for many reasons. Is it still available online?
>>
>
> I've always used the one-page per section version on the web (although
> I tend to use Info much more often), primarily because I thought that
> downloading the whole manual to just look at a section or two or five
> would be inefficient - in fact, I've wondered why the single-page
> versions of various manuals (particularly the larger ones: emacs and
> elisp) are made available. So it is idle curiosity on my part, but
> what are the the reasons for your preference?

Converting to an ebook format to read on an ebook reader is one possible
use-case.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: OT: M-S-$ Not Working

2021-02-05 Thread Marcin Borkowski
Hi Bo,

I know your problem is resolved now, but in case you don't know, check
also what `C-h c' does (and `C-h k' is also useful at times).  In
general, spending 20 minutes on looking through what `C-h C-h' says
might save you some trouble later;-).

Hth,
mb



On 2021-02-05, at 00:25, Bo Grimes  wrote:

> I beg your indulgence.  I am confident this isn't an Emacs problem, let
> alone an org problem, but my eyes hurt from searching for an answer,
> and this list, the only one I subscribe to, is populated with gurus.  I
> promise never to use it this way again.
>
> OS: PopOS 20.10, DE: GNOME 3.38.2 WM: Mutter 
> GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14)
>
> M-S-$ does not spellcheck word.  It will work from the menu bar, and it
> will work if I drop into a tty and run Emacs.  Emacs gives no
> response in the minibuffer in the GUI when I press M-S-$. M-x
> describe-key M-S-$ does nothing. C-h b C-s 'spell' reveals that indeed
> M-S-$ is bound to spellcheck word. And other M-S- keys work like M-S->
> just fine.
>
> There has to be some keybinding outside Emacs taking precedence. I have
> gone through dconf-editor until my eyes bleed. Done gsettings
> list-recursively  org.gnome.desktop.wm.keybindings | sort | more and
> gone line by line.  I have done dconf dump / > dconf.dump and read
> through them all, in addition to checking PopOS' keybindings in
> Settings. And trying a different keyboard.
>
> Nothing in Tweeks, dconf, or Settings uses M-S-$, but I disabled
> anything that uses Shift anyway (nothing uses $). No joy. I don't want
> to rebind it for this machine only, nor do I want to go through the
> hassle of installing a different DM/WM.
>
> StackExchange, et.al are full of problems with the the M key, but not
> one specific keychord only.
>
> Any ideas? I will accept rebukes.  I'm desperate.  TIA!
>
> Bo Grimes


-- 
Marcin Borkowski
http://mbork.pl



Re: Org to ConTeXt exporter?

2020-12-28 Thread Marcin Borkowski


On 2020-12-28, at 19:03, Juan Manuel Macías  wrote:

> Hello, Diego,
>
> Diego Zamboni  writes:
>
>> I have never used ConTeXt, but from what I've seen, despite its many
>> differences, a lot is still similar to TeX/LaTeX (e.g. math). Given
>> this, I think it might be easier to create a new derived exporter from
>> ox-latex, and override the parts that differ, instead of creating a
>> new one completely from scratch.
>
> You are right, maybe it is better to start with ox-latex, since LaTeX
> and ConTeXt are related.

I beg to differ.  The relation between LaTeX and ConTeXt is that they
both come from plain TeX, but both came a long way, and there are
significant differences between the two.  Personally, I'd rather start
that exporter from scratch.  I wrote my exporter a few years ago, it's
not that difficult.

Here's the thing.  Some time ago, I have dedicated about 20 minutes per
day (sometimes less, sometimes more, but the average over the past 6
years is about 17 minutes now) to what I call "creative writing" -
mainly the book I was working on for the past 5 years with two more
people (and that book is now complete) and my blog.  I will try to use
some of that time to start that tutorial, and maybe I will then publish
it on my blog or somewhere.  (I also want to get back to the book on
Elisp I started a long time ago, but that can wait a few more weeks.)

But here's the thing: I'll need help.  I know LaTeX very well - I've
been using plain TeX for about 25 years now and LaTeX for about 20
years, including writing quite a few packages and classes - but I don't
know ConTeXt that well.  (I did use it a bit, but not very extensively.)

Where could we start working on it?  I suppose GitHub/GitLab is out of
question, so?

Best,

--
Marcin Borkowski
http://mbork.pl



Re: Org to ConTeXt exporter?

2020-12-28 Thread Marcin Borkowski


On 2020-12-28, at 14:38, Juan Manuel Macías  wrote:

> Hi,
>
> Just out of curiosity, I am wondering if there are plans to create an
> Org to ConTeXt exporter in the future, or if there is already some work
> in progress on this front.
>
> I have to say that among TeX formats I tend to prefer LaTeX to ConTeXt;
> but ConTeXt has very interesting features (grid typesetting, for
> example) that LaTeX lacks (for now) and has a more monolithic structure,
> that is, it does not need to be extended through packages as in LaTeX.

Creating an exporter from scratch is probably easier than you think.
A few years ago I planned a tutorial about this, but another job
happened, then covid happened etc.  Now that I finished some big project
taking me a lot of time, I might be tempted to revisit that.  Would
there be demand for a DYI Org-exporter-from-scratch tutorial?

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: Clock tables and two ways to categorize tasks

2020-11-22 Thread Marcin Borkowski


On 2020-11-22, at 19:16, Jean Louis  wrote:

> * Kristian Grönberg  [2020-11-22 08:56]:
>>
>> > On 20 Nov 2020, at 10:23, Leo Okawa Ericson 
>> >  wrote:
>> >
>> > 
>> > Some time ago I hacked together a bunch of elisp to create a clock
>> > table
>
> I am sorry what is clock table?
>
> [snip]

Well, and how is all that helpful at all?

Of course, in an ideal world we'd be paid for the results, not for the
time.  But:

1. Welcome to the reality, this is not an ideal world.  I am being paid
for my time.  (And sometimes we really do not have a better option.  How
would you calculate a teacher's wage?)

2. Clocking in and out is the question of habit.  It does not really
take up a significant portion of my attention, especially with Ivy and
org-mru.  I've been doing it for years, and while I do sometimes forget
about it, an occasional error does not make the whole data useless.

3. Knowing where my time goes is the first step in optimizing it.

Best,

--
Marcin Borkowski
http://mbork.pl



Clock tables and two ways to categorize tasks

2020-11-19 Thread Marcin Borkowski
Hi all,

here's the problem I'd like to solve.  I clock various tasks, and then
generate a clock table.  So far, so good.  But now I'd like to know
better where my time goes.  Most tasks I do have a few similar
components: discussion/research, writing code, testing, etc.  I thought
that I could create subheadlines under each of the tasks and give them
tags like :discuss:, :code:, :test:, :debug: and so on.  (Not very
convenient, but doable, maybe with a bit of Elisp to automate the
process.)

Now, I'd like to prepare two clock tables: one where I see how much time
every task took, and one where I can see how much time I spent coding,
testing, debugging, emailing etc.  I can see in the docs that there is
the ~:match~ option, but if I understand it correctly, it can only
restrict the table to /one/ tag, so I'd need to have as many tables as
I have tags - not optimal.

Any ideas?  Should I use something else than tags for that?

TIA,

--
Marcin Borkowski
http://mbork.pl



Re: official orgmode parser

2020-09-16 Thread Marcin Borkowski


On 2020-09-15, at 11:17, Przemysław Kamiński  wrote:

> So, I keep clock times for work in org mode, this is very
> handy. However, my customers require that I use their service to
> provide the times. They do offer API. So basically I'm using elisp to
> parse org, make API calls, and at the same time generate CSV reports
> with a Python interop with org babel (because my elisp is just too bad
> to do that). If I had access to some org parser, I'd pick a language
> that would be more comfortable for me to get the job done. I guess it
> can all be done in elisp, however this is just a tool for me alone and
> I have limited time resources on hacking things for myself :)

I was in the exact same situation - I use Org-mode clocking, and we use
Toggl at our company, so I wrote a simple tool to fire API requests to
Toggl on clock start/cancel/end: https://github.com/mbork/org-toggl
It's a bit more than 200 lines of Elisp, so you might try to look into
it and adapt it to whatever tool your employer is using.

> Another one is generating total hours report for day/week/month to put
> into my awesomewm toolbar. I ended up using orgstat
> https://github.com/volhovM/orgstat
> however the author is creating his own DSL in YAML and I guess things
> were much better off if it all stayed in some Scheme :)

Wow, another awesomewm user here; could you share your code?

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: Mass conversion of items

2020-09-01 Thread Marcin Borkowski


On 2020-09-01, at 18:19, Eric S Fraga  wrote:

> On Tuesday,  1 Sep 2020 at 16:09, Sharon Kimble wrote:
>> I would like to change about 150+ 'foos' and possibly using
>> 'replace-string' to do it. Also, 'foo' is lots of different words which
>> includes spaces between some of them. So how can I do it please?
>
> You may wish to use replacement with regular expressions: Check info
> manual for emacs, (emacs) Regexp Replace

Maybe you could also use keyboard macros for that.

Hth,

-- 
Marcin Borkowski
http://mbork.pl



Re: time-warping - retroactively marking DONE?

2020-07-07 Thread Marcin Borkowski


On 2020-07-07, at 13:26, Adam Spiers  wrote:

> Hi all,
>
> I'm looking for a way to retroactively mark a task as having been done
> at a previous time/date.  I know that I can just change the keyword to

org-todo-yesterday?

Hth,

-- 
Marcin Borkowski
http://mbork.pl



Re: Splitting large org file into smaller ones

2020-05-30 Thread Marcin Borkowski


On 2020-05-30, at 11:51, Marvin M. Doyley  wrote:

> Hi there,
>
> Is there an efficient way to split a large org file into smaller ones?

I do not know about "efficient", but you might find my org-one-to-many
library useful: https://github.com/mbork/org-one-to-many
(Note that I don't wven know if it works with newer versions of Org; if
not, drop me a line, maybe I'll be able to fix it.)

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: How to properly set up reminders for paying cellphone fees in org?

2020-05-02 Thread Marcin Borkowski


On 2020-05-02, at 10:12, to...@tuxteam.de wrote:

> On Sat, May 02, 2020 at 09:37:40AM +0200, Marcin Borkowski wrote:
>>
>> On 2020-04-30, at 07:02, Kyle Meyer  wrote:
>>
>> > And note that a utility like datefudge or libfaketime is useful for
>> > testing these sorts of things out.  For example:
>> >
>> >   $ datefudge "2020-02-18" emacs [...]
>>
>> Shameless plug: I wrote about this use-case of datefudge sime time ago:
>> http://mbork.pl/2019-08-05_datefudge_and_agenda_testing
>>
>> (I don't know libfaketime).
>
> It just plays games with LD_PRELOAD to trick the application (which is
> supposed to use the usual libs when asking for time, but most do that).
>
> Infinitely more lightweight than a container or a VM. On Debian:
>
>   tomas@trotzki:~$ apt show libfaketime
>   Package: libfaketime
>   [...]
>   Download-Size: 31.2 kB
>   APT-Sources: http://ftp.de.debian.org/debian buster/main amd64 Packages
>   Description: Report faked system time to programs (preload library)
>The Fake Time Preload Library (FTPL, a.k.a. libfaketime) intercepts
>various system calls which programs use to retrieve the current date
>and time [...] FTPL allows you to specify both absolute dates (e.g.,
>2004-01-01) and relative dates (e.g., 10 days ago).
>
> You might need a VM for an app which bypasses the "usual libraries",
> but then, I don't know whether I would like to have such a thing on
> my box. Probably not without a good reason :-)

One use-case when this might be reasonable is an application which talks
to a database, when you have to convince both the application and the
database server that the time is different than in reality.

Best,

--
Marcin Borkowski
http://mbork.pl



Re: How to properly set up reminders for paying cellphone fees in org?

2020-05-02 Thread Marcin Borkowski


On 2020-04-30, at 07:02, Kyle Meyer  wrote:

> And note that a utility like datefudge or libfaketime is useful for
> testing these sorts of things out.  For example:
>
>   $ datefudge "2020-02-18" emacs [...]

Shameless plug: I wrote about this use-case of datefudge sime time ago:
http://mbork.pl/2019-08-05_datefudge_and_agenda_testing

(I don't know libfaketime).

Another way of testing that is using a VM or perhaps docker to run Emacs
in an environment where you set up the system clock to whatever you
want.

Best,

-- 
Marcin Borkowski
http://mbork.pl



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

2020-02-19 Thread Marcin Borkowski


On 2020-02-19, at 21:02, Samuel Wales  wrote:

> just an idea but changing the subscript and superscript export feature
> to ‘{}’ would reduce accidental invocation.  i have seen solecistic
> subscripts on websites created with org (probably by experts who
> babelize their .emacs!), and on this ml :).
>
> i have seen it used accidentally more than i have seen it used for its
> intended purpose.  {} seems more unambiguous.
>
> that would, of course, be an issue for those who already have a lot of
> the short form in their technical and scientific papers.
>
> so there would have to be a nice regexp fixer.  or a warning.

+1!!!

There is already an option for that (~org-use-sub-superscripts~).
Changing the default to `{} seems a great idea.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: Step by step tutorial on Worg on how to create a new export backend

2020-02-16 Thread Marcin Borkowski


On 2020-02-16, at 01:46, Jean-Christophe Helary 
 wrote:

>> On Feb 16, 2020, at 2:55, Marcin Borkowski  wrote:
>>
>>
>> On 2020-02-14, at 21:48, Bastien  wrote:
>>
>>> We have a good reference documentation for creating export backends:
>>> https://orgmode.org/worg/dev/org-export-reference.html
>>>
>>> But we *badly* need a step by step tutorial on Worg.
>>>
>>> Anyone would like to volunteer for writing such a tutorial?
>>
>> I might try to at least start it, though I'll need some time.  When is
>> that needed?  (I assume that the sooner, the better, so if there is
>> anyone who would beat me to it, go on.  I might do some proofreading
>> then.)
>
> Marcin,
>
> Aren't you supposed to write a book about Emacs already ? ;)

Yep, point taken.  But the tutorial is a much smaller thing, and
I already did a similar thing (the Emacs Conf 2015 talk on creating
derived exporters), so much of the work is already done.

Best,

--
Marcin Borkowski
http://mbork.pl



Re: Step by step tutorial on Worg on how to create a new export backend

2020-02-15 Thread Marcin Borkowski


On 2020-02-14, at 21:48, Bastien  wrote:

> We have a good reference documentation for creating export backends:
> https://orgmode.org/worg/dev/org-export-reference.html
>
> But we *badly* need a step by step tutorial on Worg.
>
> Anyone would like to volunteer for writing such a tutorial?

I might try to at least start it, though I'll need some time.  When is
that needed?  (I assume that the sooner, the better, so if there is
anyone who would beat me to it, go on.  I might do some proofreading
then.)

Best,

--
Marcin Borkowski
http://mbork.pl



Re: C-c C-c to close the buffer in *Org Src ...* buffers

2020-02-01 Thread Marcin Borkowski


On 2020-01-31, at 12:14, Fraga, Eric  wrote:

> On Friday, 31 Jan 2020 at 12:03, Bastien wrote:
>> Hi all,
>>
>> I'd like to make  an equivalent to  in Org Src buffers
>> so that hitting  will close the buffer, which seems natural.
>
> It does seem natural and generally support this idea.
>
> However, it could potentially cause me a minor annoyance: I often (in
> manuals and other forms of dissemination) use org src blocks (i.e. src
> blocks with org code) and I would expect C-c C-c to do whatever it would
> normally do in an org file (e.g. add tag) while editing that
> block.  Would the normal C-c C-c behaviour take precedence?
>
> If not, this is a very minor issue so I'm sure I would adjust!

A similar issue was the reason I stopped using C-c C-c to add tags in
favor of C-c C-q: I wanted to add tags while capturing notes.

What I'm saying is that maybe C-c C-c tries to be too clever, and it may
be better not to rely on it too much.

Just my 2 cents,

-- 
Marcin Borkowski
http://mbork.pl



Re: Org export to HTML with encrypted information ??

2019-11-29 Thread Marcin Borkowski


On 2019-11-29, at 08:24, David Masterson  wrote:

> My use-case is this:
>
> I'd like to use Org to write up *all* the information about my family
> life (so to speak) including medical histories of my family, issues with
> the house, bank accounts, financial information, etc., so that my family
> has all the information to refer to when necessary in a (hopefully)
> well-structured form.  Naturally, this is going to have a fair amount of
> really sensitive information.  By carefully outlining the information, I
> can structure the sensitive information to be in key parts of the
> documents that I can then encrypt using org-crypt.
>
> That part is straightforward.  The tricky part is that my family is not
> "Emacs literate" and, so, I'm thinking the best idea is to export the
> information from Org files to HTML files so that I can then present to
> them as a website.  They are used to browsing the web, so this should be
> more natural to them.  The problem that I'm looking for help with is how
> to deal with the encrypted information?  Any suggestions?

This is a very interesting and important question.  I don't have any
advice, but I would very much like to hear what others have to say.

While this does not answer your question (but is related): who is going
to have the password/passphrase?  Have you considered using a secret
sharing scheme?

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: Publish to PDF on Linux: An impossible task?

2019-11-10 Thread Marcin Borkowski


On 2019-11-11, at 01:25, John Hendy  wrote:

> On Sun, Nov 10, 2019 at 6:01 PM Nathan Neff  wrote:
>>
>> After using org-mode for 10 years, I run for the doorway when
>> I even think about trying to convert an org-mode file to PDF.
>>
>> *** I quiver when I see errors such as:
>>
>> warning: kpathsea: configuration file texmf.cnf not found in these 
>> directories: 
>> /usr/bin:/usr/bin/share/texmf-local/web2c:/usr/bin/share/texmf-dist/web2c:/usr/bin/share/texmf/web2c:/usr/bin/texmf-local/web2c:/usr/bin/texmf-dist/web2c:/usr/bin/texmf/web2c:/usr:/usr/share/texmf-local/web2c:/usr/share/texmf-dist/web2c:/usr/share/texmf/web2c:/usr/texmf-local/web2c:/usr/texmf-dist/web2c:/usr/texmf/web2c://texmf-local/web2c:/://share/texmf-local/web2c://share/texmf-dist/web2c://share/texmf/web2c://texmf-local/web2c://texmf-dist/web2c://texmf/web2c.
>> This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Arch Linux) 
>> (preloaded format=pdflatex)
>>
>> kpathsea: Running mktexfmt pdflatex.fmt
>> mktexfmt: No such file or directory
>> I can't find the format file `pdflatex.fmt'!
>
> These look like latex errors to me, nothing to do with Org. Guessing

These are not LaTeX errors, they are lower-level ones.

> you used the arch package? I'm on arch myself, but after getting
> bitten by package mismatches and things being hopelessly broken, I
> switched to just using texlive directly:
> - https://www.tug.org/texlive/
>
> It's not that bad. There's even a quick guide to walk you through the
> tl-install script. If you'd rather troubleshoot what you have going on
> now, here's some places to start:
> - you're missing files... figure out which package is supposed to
> provide them and install it

He misses LaTeX format file itself, and apparently mktexfmt (which
should create it) cannot be found.  This seems more serious than what
you write.

> - check your paths

Agreed, but this may be quite subtle...

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: Publish to PDF on Linux: An impossible task?

2019-11-10 Thread Marcin Borkowski


On 2019-11-11, at 01:00, Nathan Neff  wrote:

> After using org-mode for 10 years, I run for the doorway when
> I even think about trying to convert an org-mode file to PDF.
>
> *** I quiver when I see errors such as:
>
> warning: kpathsea: configuration file texmf.cnf not found in these
> directories:
> /usr/bin:/usr/bin/share/texmf-local/web2c:/usr/bin/share/texmf-dist/web2c:/usr/bin/share/texmf/web2c:/usr/bin/texmf-local/web2c:/usr/bin/texmf-dist/web2c:/usr/bin/texmf/web2c:/usr:/usr/share/texmf-local/web2c:/usr/share/texmf-dist/web2c:/usr/share/texmf/web2c:/usr/texmf-local/web2c:/usr/texmf-dist/web2c:/usr/texmf/web2c://texmf-local/web2c:/://share/texmf-local/web2c://share/texmf-dist/web2c://share/texmf/web2c://texmf-local/web2c://texmf-dist/web2c://texmf/web2c.
> This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Arch Linux)
> (preloaded format=pdflatex)
>
> kpathsea: Running mktexfmt pdflatex.fmt
> mktexfmt: No such file or directory
> I can't find the format file `pdflatex.fmt'!

This looks like a broken installation of TeXlive to me, although I'm
definitely not an expert on kpathsea or mktexfmt.

Another conjecture is that Arch's TeXlive needs some environment
variable which is only set for interactive sessions.  (This would be
strange.)  This is a very long shot, but what would happen if you
compiled a short, hello-world-type LaTeX document in the console?  Would
Org-mode export work after this?

Also, what does this: ~set | grep ^TEX~ say in a console?  And in M-x
shell?

For my way, see below.

> *** I run for cover when I read documentation such as:
>
> https://orgmode.org/manual/LaTeX-Export.html#LaTeX-Export
>
> I think people who have been using LaTex and related tools for a long time
> have
> no issue with this (seemingly) insurmountable feat.  However, I am not
> familiar with
> such a myriad of tools and I'm simply looking for the "easiest" way to
> convert/export an org
> mode file to PDF on Linux.
>
> Can anyone point me to some tutorials?  I'm sorry if I miss something
> obvious.

I've been using pdf export many times without any problems.

My secret is using TeXlive from the TeXlive distribution, not from my
GNU/Linux distribution.  (Last time I checked, Ubuntu's TeXlive was
hopelessly out of date.  Even though I've been using Arch for a few
years now, I still install TeXlive from https://tug.org/texlive/ .  One
big advantage of that is that the installer lets me install only stuff
I need, and if I later decide that I need something more, I can install
even an individual class/package/font/whatever.  Another plus is that
I can easily install a few versions of TeXlive and e.g. develop my
classes with the latest one, but test them also on an older version.)

Also, the installer lets me put TeXlive in my home directory, so it can
be installed even without root privileges.

Hth,

--
Marcin Borkowski
http://mbork.pl



Re: [O] Creating a (RabbitMQ) diagram

2019-10-17 Thread Marcin Borkowski


On 2019-10-17, at 13:12, PICCA Frederic-Emmanuel 
 wrote:

> https://en.wikipedia.org/wiki/PGF/TikZ

+1

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] fill function: Put a newline at the end of each sentence in paragraph.

2019-10-01 Thread Marcin Borkowski


On 2019-10-01, at 08:34, Uwe Brauer  wrote:

> Hi 
>
> I am looking for a filling function, which puts a newline at the end of
> each sentence. I have one for LaTeX mode but it does not work in org
> mode.
>
> Anybody has a pointer?

How about these?

http://mbork.pl/2019-01-20_Filling_and_version_control and the two links there
https://emacs.stackexchange.com/questions/443/editing-files-with-one-sentence-per-line

Hth,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Best practice for providing an Org-based application?

2019-09-11 Thread Marcin Borkowski


On 2019-09-10, at 23:49, Neil Jerram  wrote:

> One might then think: why still be in Org mode?  As opposed to a
> traditional database.  [...]

Why not both?

Did anyone consider writing a foreign data wrapper (see
e.g. https://wiki.postgresql.org/wiki/Foreign_data_wrappers) so that
PostgreSQL could reference Org tables directly?

I'm not sure how /useful/ that would be, but we're here for cool, not
useful, no? ;-)

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Best practice for providing an Org-based application?

2019-09-11 Thread Marcin Borkowski


On 2019-09-11, at 01:11, John Kitchin  wrote:

> This sounds like an interesting application with a lot of complexities.
> It definitely blurs the lines between a database where you could run
> queries to find/update records, and a human readable, structured data
> file that also does this.

This reminds me of this:
https://www.joelonsoftware.com/2012/01/06/how-trello-is-different/

I just had a minor enlightenment why Org-mode is so successful (within
its niche, of course).  It implements a bunch of very general data
structures - a tree, a table, a dictionary - and a few slightly more
specific - a clock table, TODOs/tags, markup...

Best,

--
Marcin Borkowski
http://mbork.pl



Re: [O] Best practice for providing an Org-based application?

2019-09-08 Thread Marcin Borkowski


On 2019-09-08, at 19:37, Neil Jerram  wrote:

> Is there a best practice or recommended approach for preparing and
> providing an Org-based application so that others could make use of it?
>
> I've been using Org for a few years to keep track of the membership and
> 'fixing' for my choir - where 'fixing' means finding out and recording who
> can sing in each concert, who will be there for rehearsals, and so on.
> This involves a mix of data that is private to my choir, and workflows and
> code that are potentially generic.  I don't know how many people in the
> world are both choir organisers and Emacs users, but it seems to me that it
> could be useful to separate out and document the generic code and
> workflows, so that others could use that as well as me, and that it would
> also be an interesting technical challenge.
>
> Has anyone else done something like this?  I wonder if you have
> recommendations for how to document, structure and publish this kind of
> thing?

That looks pretty interesting, and I suspect that it could be useful not
only for choirs but for other teams as well.  I'd love to see this, even
though I'm probably not a potential user.

Best,

-- 
Marcin Borkowski
http://mbork.pl



[O] Can I get the results of shell code block when exit code is non-zero?

2019-08-29 Thread Marcin Borkowski
Hi all,

apparently when the exit code of the last command in a shell code block
is not zero, I do not get the results.  This doesn't seem to be
documented in the manual (though I might be missing something).  Check
this:

#+begin_src bash :results verbatim
  echo hello world
  exit 0
#+end_src

and this:

#+begin_src bash :results verbatim
  echo hello world
  exit 1
#+end_src

How can I tell Org to put the results in the file anyway?  My use case
is =diff=, which exists with status 1 if differences are found, and this
is a blog post, so I do not want to pollute the post with an =exit 0= at
the end of the code snippet.

TIA,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] from org to openoffice presentations (or make org looks like openoffice)

2019-07-24 Thread Marcin Borkowski


On 2019-07-24, at 09:13, Luca Ferrari  wrote:

> Hi,
> it seems I'm out of luck searching for a solution: I've got a library
> of org-mode files that I export with beamer. So far, so good.
> But know I'm forced by my management to apply an openoffice slide
> layout, so I was looking for a way to export from org to open office
> presentations (impress). It seems nothing so weird exists on earth.
> My second thought was to put the template as a background image on all
> my slides, but this is a little complicated considered my knowledge of
> LaTeX and beamer (and that's why I'm using org!).
> Assuming none of the above two can be answered, is there a path to get
> things done? Like converting from org to markdown and then to open
> office?
> Anyone has a suggestion or an hint?

What I would do would be to create a bare-bones Beamer theme to mimick
what you need.  (Well, I've been a power user of (La)TeX for about 25
years, so I know it's perfectly doable even if tedious.)

And there are a few minimalistic Beamer themes; some of them might allow
for customization wrt a background image.

> (and no, I don't want to rewrite my slides in open office because they
> will become quickly unmantainable!).

+1!

Best,

--
Marcin Borkowski
http://mbork.pl



Re: [O] Bug: Docstrings of =org-agenda-todo-ignore-with-date= and =org-agenda-todo-ignore-timestamp= unclear [9.2 (release_9.2-215-g5b39d8 @ /home/mbork/others-works/emacs/org-mode/lisp/)]

2019-07-14 Thread Marcin Borkowski

On 2019-07-12, at 10:53, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> Thanks.  I meant that - according to the manual - `t' should be
>> synonymous with `near' and not `all'.  I can fix the commit message, but
>> could you confirm that I'm right first?
>
> AFAICT, your guess sounds right.

Thanks.  How about this?

Best,

-- 
Marcin Borkowski
http://mbork.pl
>From 669b4347f35dd87815e9f232ab72533d6514d7d1 Mon Sep 17 00:00:00 2001
From: Marcin Borkowski 
Date: Mon, 24 Jun 2019 21:05:56 +0200
Subject: [PATCH] Fix a bug when `org-agenda-todo-ignore-deadlines` is set to t

Make `t' synonymous with `near' instead of `all' (as is stated in the
docstring).
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index daf51601d..673c3c311 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5444,7 +5444,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
 	  (and org-agenda-todo-ignore-deadlines
 	   (re-search-forward org-deadline-time-regexp end t)
 	   (cond
-		((memq org-agenda-todo-ignore-deadlines '(t all)) t)
+		((eq org-agenda-todo-ignore-deadlines 'all) t)
 		((eq org-agenda-todo-ignore-deadlines 'far)
 		 (not (org-deadline-close-p (match-string 1
 		((eq org-agenda-todo-ignore-deadlines 'future)
-- 
2.22.0



Re: [O] Bug: Docstrings of =org-agenda-todo-ignore-with-date= and =org-agenda-todo-ignore-timestamp= unclear [9.2 (release_9.2-215-g5b39d8 @ /home/mbork/others-works/emacs/org-mode/lisp/)]

2019-07-11 Thread Marcin Borkowski


On 2019-07-09, at 12:22, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> Hello there,
>>
>> any comments?
>
> Thank you for the patches.
>
> I applied the first one. Could you expound the commit message in the
> second one: what bug is it?

Thanks.  I meant that - according to the manual - `t' should be
synonymous with `near' and not `all'.  I can fix the commit message, but
could you confirm that I'm right first?

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Bug: Docstrings of =org-agenda-todo-ignore-with-date= and =org-agenda-todo-ignore-timestamp= unclear [9.2 (release_9.2-215-g5b39d8 @ /home/mbork/others-works/emacs/org-mode/lisp/)]

2019-07-07 Thread Marcin Borkowski
Hello there,

any comments?

Best,
mb


On 2019-06-24, at 21:09, Marcin Borkowski  wrote:

> On 2019-06-23, at 13:23, Marcin Borkowski  wrote:
>
>> On 2019-06-19, at 21:19, Nicolas Goaziou  wrote:
>>
>>> Hello,
>>>
>>> Marcin Borkowski  writes:
>>>
>>>> The docstrings of =org-agenda-todo-ignore-with-date= and
>>>> =org-agenda-todo-ignore-timestamp= do not really tell what these
>>>> settings are doing.  They should (imho) emphasize that the former just
>>>> omits from the global todo list all entries with at least one active
>>>> timestamp (in the hedaline or the body), and the latter checks the first
>>>> active timestamp which is not SCHEDULED or DEADLINE and compares it to
>>>> today's date.
>>>>
>>>> It could also be mentioned in the manual.
>>>>
>>>> I have GNU papers for Emacs signed.  If this is enough, I'd be happy to
>>>> submit a patch.  If so, what would be better: to patch only the
>>>> docstrings or the docstrings and the manual.
>>>
>>> I would say the latter. Thank you.
>>
>> I only patched the doctsrings for now.  If this is fine, I'll do
>> a similar thing in the manual.
>
> I attach two more patches: one for the manual and one for the (apparent)
> bug in `org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item`.
>
> WDYT?
>
> -- 
> Marcin Borkowski
> http://mbork.pl
> From 89e1254d04802b13f4bd8c753287bce4eb1ae044 Mon Sep 17 00:00:00 2001
> From: Marcin Borkowski 
> Date: Mon, 24 Jun 2019 21:05:32 +0200
> Subject: [PATCH] Explain the `org-agenda-todo-ignore-...` variables in the
>  manual
>
> ---
>  doc/org-manual.org | 12 +++-
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/doc/org-manual.org b/doc/org-manual.org
> index 440888b4e..573c59b99 100644
> --- a/doc/org-manual.org
> +++ b/doc/org-manual.org
> @@ -8545,11 +8545,13 @@ it more compact:
>#+vindex: org-agenda-todo-ignore-with-date
>Some people view a TODO item that has been /scheduled/ for execution
>or have a /deadline/ (see [[*Timestamps]]) as no longer /open/.
> -  Configure the variables ~org-agenda-todo-ignore-scheduled~,
> -  ~org-agenda-todo-ignore-deadlines~,
> -  ~org-agenda-todo-ignore-timestamp~ and/or
> -  ~org-agenda-todo-ignore-with-date~ to exclude such items from the
> -  global TODO list.
> +  Configure the variables ~org-agenda-todo-ignore-scheduled~ to
> +  exclude some or all scheduled items from the global TODO list,
> +  ~org-agenda-todo-ignore-deadlines~ to exclude some or all items with
> +  a deadline set, ~org-agenda-todo-ignore-timestamp~ to exclude some
> +  or all items with an active timestamp other than a DEADLINE or
> +  a SCHEDULED timestamp and/or ~org-agenda-todo-ignore-with-date~ to
> +  exclude items with at least one active timestamp.
>  
>  -
>#+vindex: org-agenda-todo-list-sublevels
> -- 
> 2.22.0
>
> From 0bf1e6e6b25847ce4bee74487782b82c822138a3 Mon Sep 17 00:00:00 2001
> From: Marcin Borkowski 
> Date: Mon, 24 Jun 2019 21:05:56 +0200
> Subject: [PATCH] Fix a bug when `org-agenda-todo-ignore-deadlines` is set to t
>
> ---
>  lisp/org-agenda.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index daf51601d..673c3c311 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -5444,7 +5444,7 @@ This function is invoked if 
> `org-agenda-todo-ignore-deadlines',
> (and org-agenda-todo-ignore-deadlines
>  (re-search-forward org-deadline-time-regexp end t)
>  (cond
> - ((memq org-agenda-todo-ignore-deadlines '(t all)) t)
> + ((eq org-agenda-todo-ignore-deadlines 'all) t)
>   ((eq org-agenda-todo-ignore-deadlines 'far)
>(not (org-deadline-close-p (match-string 1
>   ((eq org-agenda-todo-ignore-deadlines 'future)


-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Insert time in Org-mode

2019-06-26 Thread Marcin Borkowski


On 2019-06-26, at 21:04, Russell Adams  wrote:

> On Tue, Jun 25, 2019 at 06:41:15PM +0200, gmx wrote:
>> Hello,
>>
>> How to insert the current time? I have a table in which I want to
>> indicate the beginning of an oral exam (firt column), the end (second
>> column), and (third column) make the difference between the two (I can
>> do that).
>
> I use this:
>
> ;; Insert immediate timestamp
> (bind-key ""
> '(lambda () (interactive)
>(when (eq major-mode 'org-mode)
>  (org-insert-time-stamp nil t t)
>  (insert "\n"
>
> I press f9 all the time while note taking to timestamp my activities.

That is a bit strange - my Emacs doesn't seem to have `bind-key'.

Also, I would just add f9 to `org-mode-map', e.g. using `define-key' -
there's no need then to check for `major-mode'.

Hth,

--
Marcin Borkowski
http://mbork.pl



Re: [O] Bug: Docstrings of =org-agenda-todo-ignore-with-date= and =org-agenda-todo-ignore-timestamp= unclear [9.2 (release_9.2-215-g5b39d8 @ /home/mbork/others-works/emacs/org-mode/lisp/)]

2019-06-24 Thread Marcin Borkowski


On 2019-06-23, at 21:29, Samuel Wales  wrote:

> this looks good, but i wonder if newcomers get confused about that todo thing.
>
> i am not proposing any solution, just brainstorming.
>
> the word todo is used in a few contexts in org:
>
>   - the todo keyword per se [TODO]
>   - todoish keywords as opposed to doneish keywords
>   - the global todo view as opposed to the general views that cover
> time [called daily/weekly], structured search [called tags], and
> free-form search [called search]
>
> newcomers might wonder if the global todo view does anything that the
> general views cannot do, otherwise why does it exist.
>
> some newcomers might even wonder if todo means keyword as opposed to blank.
>
> don't take this too seriously, but i wonder if that todo- confuses
> newcomers even though the docstring is now clear.

Good points, though (as you said) this is out of scope of my humble
patch:-).

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Bug: Docstrings of =org-agenda-todo-ignore-with-date= and =org-agenda-todo-ignore-timestamp= unclear [9.2 (release_9.2-215-g5b39d8 @ /home/mbork/others-works/emacs/org-mode/lisp/)]

2019-06-24 Thread Marcin Borkowski

On 2019-06-23, at 13:23, Marcin Borkowski  wrote:

> On 2019-06-19, at 21:19, Nicolas Goaziou  wrote:
>
>> Hello,
>>
>> Marcin Borkowski  writes:
>>
>>> The docstrings of =org-agenda-todo-ignore-with-date= and
>>> =org-agenda-todo-ignore-timestamp= do not really tell what these
>>> settings are doing.  They should (imho) emphasize that the former just
>>> omits from the global todo list all entries with at least one active
>>> timestamp (in the hedaline or the body), and the latter checks the first
>>> active timestamp which is not SCHEDULED or DEADLINE and compares it to
>>> today's date.
>>>
>>> It could also be mentioned in the manual.
>>>
>>> I have GNU papers for Emacs signed.  If this is enough, I'd be happy to
>>> submit a patch.  If so, what would be better: to patch only the
>>> docstrings or the docstrings and the manual.
>>
>> I would say the latter. Thank you.
>
> I only patched the doctsrings for now.  If this is fine, I'll do
> a similar thing in the manual.

I attach two more patches: one for the manual and one for the (apparent)
bug in `org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item`.

WDYT?

-- 
Marcin Borkowski
http://mbork.pl
>From 89e1254d04802b13f4bd8c753287bce4eb1ae044 Mon Sep 17 00:00:00 2001
From: Marcin Borkowski 
Date: Mon, 24 Jun 2019 21:05:32 +0200
Subject: [PATCH] Explain the `org-agenda-todo-ignore-...` variables in the
 manual

---
 doc/org-manual.org | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 440888b4e..573c59b99 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -8545,11 +8545,13 @@ it more compact:
   #+vindex: org-agenda-todo-ignore-with-date
   Some people view a TODO item that has been /scheduled/ for execution
   or have a /deadline/ (see [[*Timestamps]]) as no longer /open/.
-  Configure the variables ~org-agenda-todo-ignore-scheduled~,
-  ~org-agenda-todo-ignore-deadlines~,
-  ~org-agenda-todo-ignore-timestamp~ and/or
-  ~org-agenda-todo-ignore-with-date~ to exclude such items from the
-  global TODO list.
+  Configure the variables ~org-agenda-todo-ignore-scheduled~ to
+  exclude some or all scheduled items from the global TODO list,
+  ~org-agenda-todo-ignore-deadlines~ to exclude some or all items with
+  a deadline set, ~org-agenda-todo-ignore-timestamp~ to exclude some
+  or all items with an active timestamp other than a DEADLINE or
+  a SCHEDULED timestamp and/or ~org-agenda-todo-ignore-with-date~ to
+  exclude items with at least one active timestamp.
 
 -
   #+vindex: org-agenda-todo-list-sublevels
-- 
2.22.0

>From 0bf1e6e6b25847ce4bee74487782b82c822138a3 Mon Sep 17 00:00:00 2001
From: Marcin Borkowski 
Date: Mon, 24 Jun 2019 21:05:56 +0200
Subject: [PATCH] Fix a bug when `org-agenda-todo-ignore-deadlines` is set to t

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

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index daf51601d..673c3c311 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5444,7 +5444,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
 	  (and org-agenda-todo-ignore-deadlines
 	   (re-search-forward org-deadline-time-regexp end t)
 	   (cond
-		((memq org-agenda-todo-ignore-deadlines '(t all)) t)
+		((eq org-agenda-todo-ignore-deadlines 'all) t)
 		((eq org-agenda-todo-ignore-deadlines 'far)
 		 (not (org-deadline-close-p (match-string 1
 		((eq org-agenda-todo-ignore-deadlines 'future)
-- 
2.22.0



Re: [O] Bug: Docstrings of =org-agenda-todo-ignore-with-date= and =org-agenda-todo-ignore-timestamp= unclear [9.2 (release_9.2-215-g5b39d8 @ /home/mbork/others-works/emacs/org-mode/lisp/)]

2019-06-23 Thread Marcin Borkowski

On 2019-06-19, at 21:19, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> The docstrings of =org-agenda-todo-ignore-with-date= and
>> =org-agenda-todo-ignore-timestamp= do not really tell what these
>> settings are doing.  They should (imho) emphasize that the former just
>> omits from the global todo list all entries with at least one active
>> timestamp (in the hedaline or the body), and the latter checks the first
>> active timestamp which is not SCHEDULED or DEADLINE and compares it to
>> today's date.
>>
>> It could also be mentioned in the manual.
>>
>> I have GNU papers for Emacs signed.  If this is enough, I'd be happy to
>> submit a patch.  If so, what would be better: to patch only the
>> docstrings or the docstrings and the manual.
>
> I would say the latter. Thank you.

I only patched the doctsrings for now.  If this is fine, I'll do
a similar thing in the manual.

WDYT?

-- 
Marcin Borkowski
http://mbork.pl
>From d5a1c1ff3a9a7ccbf2765332971973b2c4233e16 Mon Sep 17 00:00:00 2001
From: Marcin Borkowski 
Date: Sun, 23 Jun 2019 13:22:04 +0200
Subject: [PATCH] Make two docstrings more clear

The docstrings of `org-agenda-todo-ignore-with-date` and
`org-agenda-todo-ignore-timestamp` were not very clear.  Now they are
better.
---
 lisp/org-agenda.el | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index fbf520c5e..daf51601d 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -690,9 +690,10 @@ potentially much shorter TODO lists."
   "Non-nil means don't show entries with a date in the global todo list.
 You can use this if you prefer to mark mere appointments with a TODO keyword,
 but don't want them to show up in the TODO list.
-When this is set, it also covers deadlines and scheduled items, the settings
-of `org-agenda-todo-ignore-scheduled' and `org-agenda-todo-ignore-deadlines'
-will be ignored.
+When this is set, it also covers deadlines and scheduled items
+(more precisely, every entry with at least one active timestamp will be ignored),
+the settings of `org-agenda-todo-ignore-scheduled'
+and `org-agenda-todo-ignore-deadlines' will be ignored.
 See also the variable `org-agenda-tags-todo-honor-ignore-options'."
   :group 'org-agenda-skip
   :group 'org-agenda-todo-list
@@ -700,6 +701,9 @@ See also the variable `org-agenda-tags-todo-honor-ignore-options'."
 
 (defcustom org-agenda-todo-ignore-timestamp nil
   "Non-nil means don't show entries with a timestamp.
+If this variable is non-nil, Org agenda looks at the first active
+timestamp in the entry which is neither a DEADLINE nor
+a SCHEDULED timestamp and compares it to \"today\".
 This applies when creating the global todo list.
 Valid values are:
 
-- 
2.22.0



[O] Bug: Docstrings of =org-agenda-todo-ignore-with-date= and =org-agenda-todo-ignore-timestamp= unclear [9.2 (release_9.2-215-g5b39d8 @ /home/mbork/others-works/emacs/org-mode/lisp/)]

2019-06-18 Thread Marcin Borkowski



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


The docstrings of =org-agenda-todo-ignore-with-date= and
=org-agenda-todo-ignore-timestamp= do not really tell what these
settings are doing.  They should (imho) emphasize that the former just
omits from the global todo list all entries with at least one active
timestamp (in the hedaline or the body), and the latter checks the first
active timestamp which is not SCHEDULED or DEADLINE and compares it to
today's date.

It could also be mentioned in the manual.

I have GNU papers for Emacs signed.  If this is enough, I'd be happy to
submit a patch.  If so, what would be better: to patch only the
docstrings or the docstrings and the manual.

Best,
mb


Emacs  : GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.8)
 of 2019-06-15
Package: Org mode version 9.2 (release_9.2-215-g5b39d8 @ 
/home/mbork/others-works/emacs/org-mode/lisp/)
-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Advance notice of birthdays in org-mode via org-contacts

2019-05-27 Thread Marcin Borkowski


On 2019-05-27, at 13:25, Neil Jerram  wrote:

> On Sun, 26 May 2019, 16:12 Daryl Manning,  wrote:
>
>> I'm trying to come up with a better way to give myself advanced notice on
>> some peoples' birthdays coming up.
>>
>> Right now, I use the following in a `cal.org` file to give me notice in
>> agenda that birthdays are coming up:
>>
>> ```
>> * BDays
>>   :bday:
>> %%(org-contacts-anniversaries "BIRTHDAY")
>> ```
>>
>> The generally feeds off a `contacts.org` entry of the nature:
>>
>> ```
>> *** John Wick
>> :PROPERTIES:
>> :EMAIL: therealj...@notthepuppy.com
>> :BIRTHDAY: 1975-06-06
>> :END:
>> ```
>>
>> What I'd like is to get, on virtually all birthdays , a week's notice
>> through due soon (which I'll sort out in org-super-agenda in the view).
>> Alternatively, is there a nicer way to tag or otherwise note some birthdays
>> in the `contacts.org` so that I could note special people (close friends,
>> family, etc) where I could set a specific advanced notice period so that I
>> have time to do something special for them etc?
>>
>> Would love to hear peoples' approaches to this. In general, if I'm not
>> looking out 2 weeks ahead (I spend most time in the day view), I can get
>> surprised.
>>
>> thanks!
>> Daryl.
>>
>
> Hi Daryl,
>
> I have a TODO item for each of my family's birthdays, with a deadline for
> the birthday day and a repeater of +1y. Then Org Agenda automatically gives
> me about two weeks' notice of that approaching.
>
> There's no integration here with another contacts system, but I find that
> this works well for me.

Almost same here, only that I don't mark those "TODO", but just make
a headline with an (active) timestamp.

Hth,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] best ways to generate simple diagrams?

2019-05-07 Thread Marcin Borkowski


On 2019-05-06, at 20:17, Matt Price  wrote:

> So, I'm finding more and more that I want to include simple diagrams in my
> course materials. At present I am generating them as svg's using Inkscape,
> but that feels really tiresome to me. I would much rather make them
> programmatically, preferably including the source code as an org-mode block.
>
> I thought ditaa would be the tool for this, but I cannot figure out how to
> do this work efficiently in ditaa.  So for instance, I have this simple svg
> file (attached). It consists of two text-containing  symmetrical rectangles
> separated by a bit of whitespace and connected by two curved arrows (one
> pointing from each of the rectangles to the other).
>
> Trying to replicate this in ditaa did not prove easy.  Editing feels
> extremely labourious.  Am I missing something?  Is there a really good
> tutorial somehwere that I'm just not finding? Or is there maybe another
> tool I should be using instead?

Eric beat me to mentioning TikZ, which I've been using to create all
sorts of drawings for the past ten years or so.

Another TeX-related tool is METAPOST.  TikZ is apparently inspired by it
a lot, and it has some very nice features (like solving systems of
linear equations given in a declarative style to get intersection points
of straight lines - very handy).  There is another macro system built on
top of it, called METAFUN (https://wiki.contextgarden.net/MetaFun).

Since you mentioned exporting to HTML, d3.js came to my mind
immediately.  I don't have a lot of experience with it, and its main aim
is something different, but it's definitely worth knowing about.

Last but not least, I guess writing directly in SVG format might or
might not be what you want.  (I remember ye olden days when they said
that XML was something to be written and read by humans...  And in some
cases this is in fact true!)

Hth,

--
Marcin Borkowski
http://mbork.pl



Re: [O] Tracking time from one state to another?

2019-04-18 Thread Marcin Borkowski


On 2019-04-18, at 17:34, Malcolm Matalka  wrote:

> Marcin Borkowski  writes:
>
>> On 2019-04-17, at 14:20, Malcolm Matalka  wrote:
>>
>>> Hello,
>>>
>>> Is it possible in org-mode to track, and report, the duration of certain
>>> state transitions in org-mode?  In particular, I'm interested in
>>> tracking how long it takes me to go from a state that means I'm actively
>>> working on an item to it being in a done state?
>>>
>>> In my case, an item might go from working, to waiting, to working, to
>>> done.  And in this case I'm only really interested in the last working
>>> to done time.
>>>
>>> For my case, I'm looking to do a weekly report on how long it takes me
>>> to complete tasks that I have said I will work on.
>>
>> Hi Malcolm,
>>
>> that sounds interesting.  Since you can turn on logging of state changes
>> (as you probably know), this is in principle possible, though I don't
>> think it is built in.
>>
>> I guess writing a bit of Elisp to accomplish this should not be very
>> difficult, though it seems that currently the problem is a bit
>> underspecified.  If you could elaborate, e.g., provide an example of
>> your state change log and describe the result you would like to get,
>> I could be tempted to coding this.
>>
>> Best,
>
> Sure!
>
> So for my use case, I'm mostly interested in the last transition to a
> finished state, but for simplicity I'll specify the two states I'm
> interested in:
>
> Given states NEXT and DONE, I want to know the time between going into
> NEXT and over to DONE.
>
> For example, given the following logbook:
>
>:LOGBOOK:
>- State "DONE"   from "NEXT"   [2019-04-01 Mon 11:07]
>- State "NEXT"   from "TODO"   [2019-04-01 Mon 10:35]
>- State "NEXT"   from "TODO"   [2018-07-02 Mon 11:03]
>:END:
>
>
> This item would be 32 minutes.
>
> This one:
>
>:LOGBOOK:
>- State "DONE"   from "NEXT"   [2019-04-10 Wed 09:56]
>- State "NEXT"   from "WAITING"[2019-04-10 Wed 09:40]
>- State "WAITING"from "NEXT"   [2019-04-09 Tue 10:44]
>- State "NEXT"   from "WAITING"[2019-04-09 Tue 10:10]
>- State "WAITING"from "NEXT"   [2019-04-08 Mon 16:39]
>- State "NEXT"   from "TODO"   [2019-04-08 Mon 11:14]
>:END:
>
>
> Would be 16 minutes.

Are those :LOGBOOK: drawers real?  They are not sorted chronologically,
as they probably should be (though I'm not sure, I don't se them much).

> I'd like to specify what time range to do this for, and be able to sort
> by duration.
>
> I think a dynamic block, like clocktable, would probably be a fine.
>
> Any idea what the level of work involved is to accomplish this?  I'm
> guessing a very hacky version might be to modify clock table and look at
> the logbook instead of clock and filter out all but the last transition?

I don't think that's the best way - Org-mode code is famously
complicated, it might be easier to do it from scratch (it'd be perhaps
less general then, though).

Anyway, it doesn't look like a lot of work - an hour or two for a rough
prototype might be enough.

> Also, this is just the usecase I'm interested in, so if you have
> thoughts on what a more general form would look like, that would be 
> interested.

No idea yet.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Tracking time from one state to another?

2019-04-18 Thread Marcin Borkowski


On 2019-04-17, at 14:20, Malcolm Matalka  wrote:

> Hello,
>
> Is it possible in org-mode to track, and report, the duration of certain
> state transitions in org-mode?  In particular, I'm interested in
> tracking how long it takes me to go from a state that means I'm actively
> working on an item to it being in a done state?
>
> In my case, an item might go from working, to waiting, to working, to
> done.  And in this case I'm only really interested in the last working
> to done time.
>
> For my case, I'm looking to do a weekly report on how long it takes me
> to complete tasks that I have said I will work on.

Hi Malcolm,

that sounds interesting.  Since you can turn on logging of state changes
(as you probably know), this is in principle possible, though I don't
think it is built in.

I guess writing a bit of Elisp to accomplish this should not be very
difficult, though it seems that currently the problem is a bit
underspecified.  If you could elaborate, e.g., provide an example of
your state change log and describe the result you would like to get,
I could be tempted to coding this.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Closing a task yesterday (or changing the day cutoff to 4am)

2019-02-01 Thread Marcin Borkowski


On 2019-02-02, at 01:29, Leo Gaspard  wrote:

> Hello!
>
> I have a few tasks marked as `:STYLE: habit`. And I relatively often
> finish one of those daily habits after midnight.
>
> Yet, I'd like to count it as having been finished the day before, so
> that day switch time happens while I sleep.
>
> I do understand that the best fix to this problem would be to fix my
> sleep schedule and to go to sleep before midnight, but, assuming I can't
> fix this up, do you know if there is a workaround to either:
>  * Make org-mode consider the day to switch at something like 4am
>  * Automatically close a task as though it was the day before, 23:59
>
> Currently my workaround is to close the task then manually fixup the
> `SCHEDULED`, `:LAST_REPEAT:` and `:LOGBOOK:` lines to set them to the
> day before, 23:59, but it's being… quite painful.

You do realize you are not the first one to have that problem, don't
you?  Have you seen `org-agenda-todo-yesterday'?

;-)

Notice, however, that IMHO this is only a dirty hack.  A real solution
to the same problem, as you have noticed, is something that
I implemented a few years ago, and that was a radical change of my
sleeping patterns.  Now I seldom go to bed after 22:30, and usually get
up before 5:30.  This has too many advantages to list them in a short
email. :-) (Of course, I am aware not everyone can pull this off, also
for objective reasons.  My sister is a nurse, for example.)

> Anyway, thank you for org-mode, that allows me to be mildly annoyed at
> things I wouldn't even have considered might become an issue someday
> with programs I used before!

Not sure whether this is a compliment, but I like it:-).

--
Marcin Borkowski
http://mbork.pl



Re: [O] org-today broken

2019-02-01 Thread Marcin Borkowski


On 2019-02-01, at 13:55, Marco Wahl  wrote:

> Kyle Meyer  writes:
>
>> Samuel Wales  writes:
>>
>>> recent versions of maint and probably master have nil instead of
>>> current time in org-today.
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>>>   time-subtract(nil (0 0 0))
>>>   org-today()
>>>   (message "org today is %s" (org-today))
>>
>> Thanks for the report.  I introduced this and a handful of other related
>> incompatibilities with my port of Emacs's c75f505de.  I've reverted the
>> problematic spots.
>
> Thanks for the revert!
>
> Occasionally I like to bend time to see what the agenda would look like
> if another day was current.  This can be achieved conveniently when
> solely function "current-time" is the source for the current time.
>
> So I'm all for using the explicit calls to current-time instead of using
> alternatve sources for the current time.

You are aware that datefudge exists, aren't you?

http://manpages.ubuntu.com/manpages/trusty/man1/datefudge.1.html

My 2 cents,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Task repeat every weekday?

2019-01-23 Thread Marcin Borkowski


On 2019-01-23, at 14:16, Stig Brautaset  wrote:

> Hi! I have some work tasks that I need to get into the habit of doing
> every day. (Reviewing PRs / Jira, ...)
>
> Currently I do this with a calendar-style repeater, like so:
>
> ,
> | * Recurring Tasks
> | ** Review PRs
> |:LOGBOOK:
> |:END:
> |<%%(sb/weekday-p date)>
> | 
> |- https://github.com/pulls
> `
>
> Where init.el contains:
>
> ,
> | (defun sb/weekday-p (date)
> |   "Is `date' a weekday?"
> |   (let ((dayname (calendar-day-of-week date)))
> | (memq dayname '(1 2 3 4 5
> `
>
> While this allows me to clock in, and add comments, it doesn't give me that 
> nice buzz from closing a task. And it doesn't get it out of my agenda once 
> I've completed it that day.
>
> Is there a way to make this into a repeating TODO that shows only on weekdays?

This thread:
http://lists.gnu.org/archive/html/emacs-orgmode/2019-01/msg2.html
might be of help.

Hth,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Org mode repeated dates to do spaced learning

2019-01-07 Thread Marcin Borkowski


On 2019-01-06, at 18:17, Andrea Giugliano  wrote:

> Hi there,
>
> That was a very helpful suggestion. At the bottom of the mail I attached

Glad to have helped!

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Org mode repeated dates to do spaced learning

2019-01-01 Thread Marcin Borkowski


On 2019-01-01, at 17:34, Andrea Giugliano  wrote:

> Hi,
>
> Thanks for your reply. You are right org-drill does spaced repetition. I
> just was unclear: I would like to see that in the agenda as a normal
> item (that gets space-repeated every time I mark it DONE though).
> I could not get from the docs if org-drill does that.

That is an interesting idea.  I am pretty sure you could make it happen
with `org-trigger-hook' or `org-after-todo-state-change-hook' (I am not
entirely sure why both exist, btw).

> Thanks,
>
> Andrea

Hth,

--
Marcin Borkowski
http://mbork.pl



Re: [O] CSV batch agenda

2018-12-12 Thread Marcin Borkowski


On 2018-12-12, at 15:23, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> I'm playing around with `org-batch-agenda-csv'.  My question is, what is
>> "String with extra planning info"?
>
> No idea.  The manual is pretty vague, indeed.

Well, maybe I'll try to edebug this one day, or just read the source...

>> Also, what is "numerical priority" and how is it computed?  I could find
>> any reference in the manual.  Again, a quick experiment suggests
>> a number between 1000 and 2000, converging to 2000 as the item gets more
>> and more overdue.  Do I guess it right?
>
> See `org-get-priority-function'.

Hm, it's nil in my Emacs...  But grepping the source revealed
`org-get-priority'.  I'll look into this, thanks!

Best,

-- 
Marcin Borkowski
http://mbork.pl



[O] CSV batch agenda

2018-12-09 Thread Marcin Borkowski
Hi all,

I'm playing around with `org-batch-agenda-csv'.  My question is, what is
"String with extra planning info"?  A quick experiment shows that it is
what is displayed in the "normal" agenda right after the category.

Also, what is "numerical priority" and how is it computed?  I could find
any reference in the manual.  Again, a quick experiment suggests
a number between 1000 and 2000, converging to 2000 as the item gets more
and more overdue.  Do I guess it right?

TIA,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] How to handle an inline multiline noweb reference

2018-11-30 Thread Marcin Borkowski


On 2018-11-28, at 03:08, Grant Rettke  wrote:

> On Tue, Nov 27, 2018 at 3:57 AM Marcin Borkowski  wrote:
>> but it's fairly complicated.  Any better ideas?
>
> What is the part that you think is too complicated?

I hoped that I could somehow skip the "manually replace newlines with
spaces" step.

Best,

--
Marcin Borkowski
http://mbork.pl



Re: [O] How to handle an inline multiline noweb reference

2018-11-30 Thread Marcin Borkowski


On 2018-11-28, at 08:08, Eric S Fraga  wrote:

> On Tuesday, 27 Nov 2018 at 19:33, Samuel Wales wrote:
>> this might be the most ridiculous idea you have ever heard, but does
>> babel have a concept similar to stdio pipes?  i've often wanted to
>> just pipe stuff.  dunno if this would help marcin.
>>
>> the only inter-block communication i am aware of are variables and
>> noweb inclusion.
>
> Check out the :post option for src blocks.  May be exactly what you
> want.

Thanks, this looks *very* promising!

Best,

-- 
Marcin Borkowski
http://mbork.pl



[O] How to handle an inline multiline noweb reference

2018-11-27 Thread Marcin Borkowski
Hi folks,

I have a multiline source block (a complex sql query).  I'd like it to
be inserted into another (shell) source block, so that I can run psql on
a remote server (via ssh) and execute this query (I cannot access the
database from my machine).

I came up with this:

--8<---cut here---start->8---
#+name: sql_join
#+begin_src sql
  SELECT ... -- complicated, multiline query;
#+end_src

#+name: sql_oneline
#+begin_src elisp :noweb yes
  (replace-regexp-in-string "\n" " " "
<>" t t)
#+end_src

#+begin_src sh :noweb yes :results output verbatim
ssh user@host "psql connector -c '<>'"
#+end_src
--8<---cut here---end--->8---

but it's fairly complicated.  Any better ideas?

TIA,

--
Marcin Borkowski
http://mbork.pl



Re: [O] Sum clocks into a custom property

2018-11-12 Thread Marcin Borkowski


On 2018-11-12, at 11:35, Leo Alekseyev  wrote:

> I am using org-invoice.el, which expects either CLOCKSUM or WORK properties
> to exist in an item; these properties contain some time duration record in
> HH:MM format.
>
> I can't figure out how to generate those properties from a series of clock
> entries with any built-in user-facing functions, so I want to do it
> programmatically -- I can get the sum of the clock entries
> via (org-clock-sum-current-item), but how do I convert them to HH:MM format
> and insert it as a property?

For converting to hh:mm format, see the `format-seconds' function (built
into Emacs).

Hth,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Tasks performed on a certain day

2018-11-07 Thread Marcin Borkowski


On 2018-11-07, at 12:33, Leo Gaspard  wrote:

> Ken Mankoff  writes:
>
>> What about passive date stamps?
>>
>> TODO Thing
>> 
>>
>> ?
>
> That's exactly what I was looking for! I hadn't seen an example with
> TODO coupled with <> dates, and didn't think it'd have a special
> behavior.
>
> Thank you and Marcin for this solution!

Glad to know that they work!

BTW, AFAIR they are called "plain" timestamps.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Tasks performed on a certain day

2018-11-07 Thread Marcin Borkowski


On 2018-11-06, at 14:59, Leo Gaspard  wrote:

> Hello world,
>
> I am trying to figure out a way to represent, in org-mode, tasks that
> should be performed exactly on one day of the week. For instance, taking
> out the garbage.
>
> It is a task, so I want to be able to mark it as done and not see it for
> the rest of the day. But at the same time I can't SCHEDULE <> it,
> because otherwise if I don't do it the right day then it still bothers
> me the day after, at which I can't do it any longer any way.
>
> Does anyone have a trick to handle this kind of “on-this-date task” with
> org-mode?

Why don't you just say this?

* TODO <2018-11-14 śro +1w> Take out the trash

Hth,

--
Marcin Borkowski
http://mbork.pl



Re: [O] An Org-based productivity tool

2018-10-29 Thread Marcin Borkowski


On 2018-10-29, at 13:31, Sacha Chua  wrote:

> On Mon, Oct 29, 2018, 05:19 Marcin Borkowski,  wrote:
>
>>
>> Well, I think I have something even better -
>> https://github.com/akirak/counsel-org-clock (I find Counsel/Ivy
>> interface much superior to the default refiling one).  I have my
>
> Oh, I should switch to that! Thanks for the recommendation.

You're welcome!

> Definitely!  As of now, the main use is to make sure I don't get
>> distracted too much at work so that I can actually make ends meet (I'm
>> paid by an hour), so this is a crucial part of my work infrastructure.
>> Also, this means it /must/ be a harsh taskmaster (at least for some
>> time).
>
> I remember liking the combination of org-capture (for ideas and tasks that
> might otherwise interrupt my flow), effort estimates, looking at the

I don't use effort estimates.  I'll try them one day.

> current clocked task in the modeline, and making myself take notes
> along

As for the clocked task in the modeline, I have a command to switch
between various settings - basically "all", "today" and "this clock".
Quite useful (from time to time).

> the way using org-babel. You probably already have a more sophisticated
> workflow, but in case any of those habits could use practising or tweaking,
> maybe that could help.

Thanks!

> I wonder if it makes sense to set up pomodoros, so you have the time
> structure to accommodate interruptions/distractions as well as a regular
> reminder to check if you're still on-task.

This is a very good idea.  I was thinking about it, but I have yet to
find a way to incorporate that into my workflow.

> I look forward to reading your usual awesome blog post about whatever
> workflow you figure out! :)

Thanks, now I feel quite obliged to describe it in detail! :-)

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] An Org-based productivity tool

2018-10-29 Thread Marcin Borkowski


On 2018-10-28, at 02:24, Samuel Wales  wrote:

> i am still confused why timers can't poll every few minutes and clock
> to the dominating task that has a clock drawer.

As I hinted in my previous message, this is easy to do and possible, but
/only/ under the assumption that you do the majority of your work in Org
files.  In my case, such a system is completely impossible.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] An Org-based productivity tool

2018-10-29 Thread Marcin Borkowski


On 2018-10-16, at 23:43, Sacha Chua  wrote:

> Thanks for bringing me into the conversation! :) I'm so far from that
> sort of thing right now. Rough activity tracking by buttons and voice
> shortcuts on my phone is all I can manage with a toddler around.

I can imagine, I have a 2-year-old son.  Working near to him is next to
impossible (though if my wife or his 8-year-old sister is around, it
might be accomplished).  This project is meant for when I'm at work,
I don't even try (nor want) to use it at home.

> Marcin, I wonder if you might like to adapt some code from
> sachachua.com/dotemacs for clocking into a task by taking advantage of the
> org refiling system, and the idea of setting up a hydra or other shortcuts
> for common tasks. The code might need to be updated, not sure. If you're

Well, I think I have something even better -
https://github.com/akirak/counsel-org-clock (I find Counsel/Ivy
interface much superior to the default refiling one).  I have my
org-clock-history-length set to 144, and I populate it on Emacs start
with org-mru-clock.  Also, I have a 10-head hydra for Org-related stuff
(8 heads are related to clocking).

> using Org and another time tracking system that might have better reports,
> you might like to set up something like what I have, where I can use a
> single key to clock into both Org and Quantified Awesome with a pre-defined
> or prompted category.

For the purposes of my work, I have written a simple Toggl integration.
I also think about writing some stuff to generate nice reports within
Emacs.

> I find time analysis useful for things like calibrating my estimates and
> expectations, learning about my revealed preferences and trends over time,
> and feeling more satisfied about my days/weeks/months. I liked using the
> data to build on my strengths and work around my limits instead of giving
> in to the temptation to use it as a harsh taskmaster. :) I wonder if
> something similar might be helpful for you.

Definitely!  As of now, the main use is to make sure I don't get
distracted too much at work so that I can actually make ends meet (I'm
paid by an hour), so this is a crucial part of my work infrastructure.
Also, this means it /must/ be a harsh taskmaster (at least for some
time).

Doing some QS-y stuff would be nice, but this is not the priority now.

> Have fun!

I do, thanks!

Best,

--
Marcin Borkowski
http://mbork.pl



Re: [O] An Org-based productivity tool

2018-10-29 Thread Marcin Borkowski


On 2018-10-25, at 11:45, Ihor Radchenko  wrote:

> FYI
>
> "Note taker and org-clock-in enforcer"
> https://github.com/roman/clocker.el

Thanks!

Interesting, solving a similar problem and /very/ specific (almost to
the point of "useless for anyone but the author", I guess).

I guess almost the same can be said about my project, too. ;-)

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] An Org-based productivity tool

2018-10-29 Thread Marcin Borkowski


On 2018-10-16, at 23:04, Samuel Wales  wrote:

> On 10/14/18, Marcin Borkowski  wrote:
>> But I decided it's not worth it.  Very complicated and unreliable (I
>> might have two or more clocking tasks related to the same file, for
>> example).
>
> hm, it doesn't seem so to me.  what do you mean by 2 or more related
> to the same file?  a file can have any number of clocking tasks, and
> you can manually clock any time you want which would suspend the
> automatic clocking until you clock out.  [just sets a variable.]
>
> i guess it's just a matter of taste.  i don't think i will do your
> level of clocking unless it is auytomatic.

As I said, it won't/can't work for me.

Assume I have a project with two tasks, A and B.  Assume that the
project consists of many files, among others: main.js, utils.js,
main.css.  Assume that task A involves editing files main.js and
main.css and task B - files main.js and utils.js.

Assuming I'm editing main.js, how can an automatic system (short of an
advanced AI) guess whether to clock A or B?

I found that it is way easier to train myself to clock in (it helps to
have a nice keybinding for that - F10 F10 for clocking in the last task,
F10 i for a classical clock history and F10 c for Counsel-based clock
history.

>> > (And I have this notification nagging me if I'm not clocking anything
>> for 2 minutes or more.)
>
> i'd get so distracted and thus annoyed by that notificaiton that it
> would be nuked into outer space.  :]

The same with me - that's precisely the point.  This nuke is called
`org-clock-in'. ;-)

Best,

--
Marcin Borkowski
http://mbork.pl



Re: [O] Why is ":CLOCK => hh:mm" allowed as a clock entry?

2018-10-21 Thread Marcin Borkowski


On 2018-10-20, at 10:26, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> I am studying the `org-clock-sum' function (I need to parse an Org file
>> and extract clocking data), and I noticed that ":CLOCK => hh:mm" is
>> allowed as a clock entry.  The Org syntax at
>> https://orgmode.org/worg/dev/org-syntax.html#Clock,_Diary_Sexp_and_Planning
>> confirms this.
>
>   CLOCK:
>
> and
>
>   CLOCK: => hh:mm
>
> are simply empty clocks.
>
>> What is the rationale behind this?
>
> Treating them as regular text would complicate parsing unnecessarily,
> e.g., to determine when to stop a paragraph. 

OK, I don't fully get it, but I believe you. :-)

> There are other cases that can lead to odd clocks:
>
>   CLOCK: INACTIVE-TIMESTAMP => HH:MM
>
> where INACTIVE-TIMESTAMP is not a timestamp range.
>
>> I want not only to sum the clocks (org-clock-sum does that, of
>> course), but I want more detailed information (like how many clocks
>> were that in the given period etc.). The format with only the duration
>> makes this troublesome, and I'd like to ignore such entries (I have
>> never seen them in my files, of course). I'm wondering what scenario
>> could lead to their existence?
>
> Hand-writing a clock information?
>
> In any case, you can simply ignore them whenever you find them – which
> shouldn't happen, right?

Yes, that's what I thought.

> We can also add a checker in Org Lint for those problematic cases.

Might be a good idea, though definitely very low priority.

>> BTW, the syntax draft says that there can be any TIMESTAMP object before
>> the DURATION, but `org-clock-sum' assumes that its timestamps are
>> inactive.  Isn't that a bug?
>
> This is an oversight. Clock timestamps must be inactive. I will fix it.

Thanks.

Best,

-- 
Marcin Borkowski
http://mbork.pl



[O] Why is ":CLOCK => hh:mm" allowed as a clock entry?

2018-10-18 Thread Marcin Borkowski
Hi all,

I am studying the `org-clock-sum' function (I need to parse an Org file
and extract clocking data), and I noticed that ":CLOCK => hh:mm" is
allowed as a clock entry.  The Org syntax at
https://orgmode.org/worg/dev/org-syntax.html#Clock,_Diary_Sexp_and_Planning
confirms this.

What is the rationale behind this?  I want not only to sum the clocks
(org-clock-sum does that, of course), but I want more detailed
information (like how many clocks were that in the given period etc.).
The format with only the duration makes this troublesome, and I'd like
to ignore such entries (I have never seen them in my files, of course).
I'm wondering what scenario could lead to their existence?

BTW, the syntax draft says that there can be any TIMESTAMP object before
the DURATION, but `org-clock-sum' assumes that its timestamps are
inactive.  Isn't that a bug?

TIA,

--
Marcin Borkowski
http://mbork.pl



Re: [O] Feature request for clocktable step

2018-10-14 Thread Marcin Borkowski


On 2018-10-13, at 16:26, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> the manual says that I can say ":step day" or ":step week" in my clock
>> reports.  Could I also be able to say ":step month" or ":step year"?
>
> Done in "next" branch. Thank you.
>
> Regards,

Thanks!

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] How to make agenda generation faster

2018-10-14 Thread Marcin Borkowski


On 2018-10-11, at 21:59, Samuel Wales  wrote:

> i too visit all files when emacs starts.
>
> are we saying that the speed depends on the number of headlines total
> or the number of headlines in a single file among the agenda files?

Probably the former...?

>
> On 10/11/18, Marcin Borkowski  wrote:
>>
>> On 2018-10-11, at 08:48, Michael Welle  wrote:
>>
>>> Hello,
>>>
>>> Marcin Borkowski  writes:
>>>
>>>> On 2018-10-08, at 09:20, Michael Welle  wrote:
>>> [...]
>>>>> Well, on my laptop the initial agenda run takes about 7s or so (150
>>>>> agenda files) using the current day/week agenda ("a"). All subsequent
>>>>> (after loading the files) agenda runs are fast (split second I would
>>>>> say). I had some performance issues in the past caused by SCM. Emacs
>>>>> tried to check if every file is checked out in the latest version. That
>>>>> slowed down the process a lot (starting 150 mercurial processes in
>>>>> sequential order, checking results, etc.). The initial run doesn't
>>>>> bother me much. I bound the initial agenda run to an idle timer at
>>>>> Emacs
>>>>> start.
>>>>
>>>> Interesting.  I did not notice such differences between the first and
>>>> subsequent runs.
>>> I thought that behaviour is natural, scanning dirs for files and opening
>>> them is a costly operation. But a week ago I changed from rotating rust
>>> to solid state disks and that behaviour did not change much. I expected
>>> a speed up, but mee.
>>
>> Ah, I have /visiting/ all my agenda files (but not generating the agenda
>> itself) in my init.el.
>>
>> That explains a lot.
>>
>> Best,
>>
>> --
>> Marcin Borkowski
>> http://mbork.pl
>>
>>


-- 
Marcin Borkowski
http://mbork.pl



Re: [O] An Org-based productivity tool

2018-10-14 Thread Marcin Borkowski


On 2018-10-11, at 10:58, Ihor Radchenko  wrote:

> Hi,
>
> One suggestion would be to distinguish between different types of work.
> For example, you may value more an important project you need to work
> on, but do not like, in comparison with another project you really like
> doing.
> This can be done, for example, by weighting the time spent on
> different tasks according to the task urgency/arbitrary multiplier.

I will think about it, thanks!

> A comment on the example output.
> Some people (like me) can spend too much time just staring at the kind
> of output you provided.
> I found it more efficient to have a single number/phrase indication if I
> need to work harder or not.
> The full output might still be shown to adjust the overall productivity,
> but, say, once per day/week.

Good point.  As I said, it is a prototype, and I admit that the output
sucks a lot.  OTOH, I'm somewhat of a gamer, and I like economic,
spreadsheet-y games, so this scratches that itch for me.

Best,

--
Marcin Borkowski
http://mbork.pl



Re: [O] An Org-based productivity tool

2018-10-14 Thread Marcin Borkowski


On 2018-10-11, at 17:08, Ihor Radchenko  wrote:

> Well, you could associate a reward to that kind of tasks.
> For example, you can allow yourself to work half a day.
>
> Alternatively, you can make a task you would like to do (say, watch a
> new movie) to be blocked until the unwanted task is done.

Makes me think of this idea:
http://forum.beeminder.com/t/temptation-bundling-for-inbox-beeminding/4331

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] An Org-based productivity tool

2018-10-14 Thread Marcin Borkowski


On 2018-10-11, at 16:57, Peter Neilson  wrote:

> On Thu, 11 Oct 2018 10:03:15 -0400, Bingo  wrote:
>
>> Le 10 octobre 2018 21:45:53 GMT+05:30, Marcin Borkowski
>>  a écrit :
>>
>>>
>>> - a warning when my efficiency is lower than a set value, and info
>>> about
>>>  how much work I need to do to bump it up to that value.
>>>
>>
>> Nice, but it has an anti-feature.  For procrastinators, warnings
>> frequently have negative effects. It can be understood in multiple
>> ways :
>>
>> 1. "What the hell" effect : As Dr Art Marckman tells in the book
>> "Smart Change" , there is a "what the hell" effect where the victim
>> goofs off even more to the extent of giving up a goal if he realizes
>> that he is falling behind schedule, or has goofed off more than was
>> advisable. The solution is to forgive oneself, and not beat oneself
>> up. This warning looks like beating oneself up.
>>
>> 2. Showing how much work needs to be done to catch up goes against
>> some self improvement philosophies. E.g. dividing work into subtasks
>> helps in not getting overwhelmed by the amount of work.  Or the
>> recommendation to plan breaks in addition to planning to slog,
>> otherwise the plan to slog becomes overwhelming and procrastinators
>> give up.
>>
>> Of course, if it works for you, go for it.
>
> Sabotage of the TODO list ...
>
> Managing the flow of my own work sometimes runs into unintended
> sabotage, perpetrated by others or by me. The offending tasks are
> often large, incapable of division, and not immediately crucial. For
> example, somewhere in the middle of my list of "Get it done some other
> time, but not now," tasks is this one: "Repair the International 454
> tractor."  It rests comfortably on that list unless I either (1) need
> to use that tractor, or (2) hear my wife telling me, "Why don't you
> ever get the 454 running? You never get anything done around here!
> I need to use its bucket, and the Mahindra doesn't have one." From
> that point onward, and my "TODO" thoughts about writing, about
> programming, or about training horses are derailed. In case (1) I need
> to figure out some other approach, like maybe using the Mahindra. In
> case (2) my wife is right--as always--and my tendency is to stop doing
> anything at all.
>
> My org mode TODO list is absolutely no help when I encounter one of
> these show-stoppers. If anything, the list is an additional albatross
> adding to my already encroaching depression.

Have you heard about Beeminder?  (Note: I'm a user, but I have no
financial interest in recommending them.  Also, I made an Emacs/Org-mode
client for their software.)

It is my primary way of staying on track with my TODOs.  This tool is
just a helper.

Best,

--
Marcin Borkowski
http://mbork.pl



Re: [O] An Org-based productivity tool

2018-10-14 Thread Marcin Borkowski


On 2018-10-11, at 16:03, Bingo  wrote:

> Le 10 octobre 2018 21:45:53 GMT+05:30, Marcin Borkowski  a 
> écrit :
>
>>
>>- a warning when my efficiency is lower than a set value, and info
>>about
>>  how much work I need to do to bump it up to that value.
>>
>
> Nice, but it has an anti-feature.  For procrastinators, warnings frequently 
> have negative effects. It can be understood in multiple ways :
>
> 1. "What the hell" effect : As Dr Art Marckman tells in the book "Smart 
> Change" , there is a "what the hell" effect where the victim goofs off even 
> more to the extent of giving up a goal if he realizes that he is falling 
> behind schedule, or has goofed off more than was advisable. The solution is 
> to forgive oneself, and not beat oneself up. This warning looks like beating 
> oneself up.
>
> 2. Showing how much work needs to be done to catch up goes against some self 
> improvement philosophies. E.g. dividing work into subtasks helps in not 
> getting overwhelmed by the amount of work.  Or the recommendation to plan 
> breaks in addition to planning to slog, otherwise the plan to slog becomes 
> overwhelming and procrastinators give up.
>
> Of course, if it works for you, go for it.

Fair enough.

It seems I was not clear enough.  The detailed report on my work on this
day is one thing I only trigger manually.  The notification about me not
clocking anything says just "You have had no active clock for %d
minutes!".

Also, I have other devices in place to keep me on track.  The thing is,
they are day-based, and I felt that I need a bit more granularity.

Also, I understand that forgiving instead of beating oneself off is
important, and I do it when needed.  (I can always reduce the "amount of
work to do" manually, though I don't yet have any good UI for that.)

So you're right, but I think I do take into consideration.

And remember that this is an early prototype, also in terms of whether
it works for me or not.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] An Org-based productivity tool

2018-10-14 Thread Marcin Borkowski


On 2018-10-10, at 22:45, Samuel Wales  wrote:

> auto-clocking might be interesting.
>
> there would be a concept of a dominating clocking entry similar to
> dominating file.  i.e. if where you are is not a clocking entry, go up
> until you find one that is.  if you find none at top level, you create
> a clock entry in the logbook there.
>
> if you switch buffers or move around, you clock out and in where you
> were and are.  every few minutes, you try to clock in where you are,
> or the dominating clocking entry.  this is done with timers.  idle
> time might go to a special clocking entry.
>
> or something like that.  the idea is that you don't have to remember
> to clock in and out.

That's an interesting idea I thought about some time ago.

But I decided it's not worth it.  Very complicated and unreliable (I
might have two or more clocking tasks related to the same file, for
example).

It's better to train oneself to remember about clocking, I guess.

(And I have this notification nagging me if I'm not clocking anything
for 2 minutes or more.)

Best,

--
Marcin Borkowski
http://mbork.pl



Re: [O] How to make agenda generation faster

2018-10-14 Thread Marcin Borkowski


On 2018-10-11, at 08:40, Michael Welle  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> On 2018-10-09, at 13:47, Julius Dittmar  wrote:
>>
>>> Hi Marcin,
>>>
>>> I can't advise as to profiling to find out what really bogs down agenda
>>> building.
>>>
>>> I found that log messages do bog it down.
>>>
>>> I have a lot of recurring tasks, which accumulate log entries for every
>>> closing (which in fact means rescheduling to the next day). Every two to
>>> three months I prune my org files of those log entries. This
>>> significantly speeds up agenda building.
>>
>> By experiments, I found that the main bottleneck was a file with lots (=
>> a few thousand) headlines.
> ah, interesting. My org files usually aren't that deeply structured, so
> I don't get hit by that. Hm, I guess regexps are used to find headlines?

Mine were very flat - I had *lots* of captured links to websites.

Best,

-- 
Marcin Borkowski
http://mbork.pl



[O] Feature request for clocktable step

2018-10-11 Thread Marcin Borkowski
Hi Org,

the manual says that I can say ":step day" or ":step week" in my clock
reports.  Could I also be able to say ":step month" or ":step year"?

TIA,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] How to make agenda generation faster

2018-10-11 Thread Marcin Borkowski


On 2018-10-11, at 08:48, Michael Welle  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> On 2018-10-08, at 09:20, Michael Welle  wrote:
> [...]
>>> Well, on my laptop the initial agenda run takes about 7s or so (150
>>> agenda files) using the current day/week agenda ("a"). All subsequent
>>> (after loading the files) agenda runs are fast (split second I would
>>> say). I had some performance issues in the past caused by SCM. Emacs
>>> tried to check if every file is checked out in the latest version. That
>>> slowed down the process a lot (starting 150 mercurial processes in
>>> sequential order, checking results, etc.). The initial run doesn't
>>> bother me much. I bound the initial agenda run to an idle timer at Emacs
>>> start.
>>
>> Interesting.  I did not notice such differences between the first and
>> subsequent runs.
> I thought that behaviour is natural, scanning dirs for files and opening
> them is a costly operation. But a week ago I changed from rotating rust
> to solid state disks and that behaviour did not change much. I expected
> a speed up, but mee.

Ah, I have /visiting/ all my agenda files (but not generating the agenda
itself) in my init.el.

That explains a lot.

Best,

--
Marcin Borkowski
http://mbork.pl



Re: [O] An Org-based productivity tool

2018-10-10 Thread Marcin Borkowski


On 2018-10-10, at 18:50, William Denton  wrote:

> On 10 October 2018, Marcin Borkowski wrote:
>
>> I am making an Org-mode-based tool to help boost my productivity.
>> ...
>> - is anyone interested in something like this?
>
> I am---I'd love to see what you come up with.  I'm doing something
> similar, but much less fancy, with clock tables and some R:
>
> https://www.miskatonic.org/2017/11/16/clocktableii/
>
> I need to do one more post about that to wrap it up.  It's working
> well for me, but warnings about not being clocked in to something, and
> better understanding of what I'm doing based on headings or tags,
> would be useful.

Thanks for your kind words!

It's not that fancy (yet?), but has one big advantage over clock tables:
it updates dynamically (using org-clock-out-hook), so it's fast.  Also,
as you could see, it does some simple calculations.

And for the record: it's based on properties, not tags - but that is
a minor issue.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] What is the difference between `org-narrow-to-subtree' and `org-narrow-to-element'?

2018-10-10 Thread Marcin Borkowski


On 2018-10-08, at 17:47, Marco Wahl  wrote:

> Hi!
>
>> I found these two commands.  They seem to do the same thing.  What is
>> the difference?
>
> This is an example illustrating the difference.
>
> - Have point on the *table* of the following subtree.
>
>
> --8<---cut here---start->8---
> * foo
>
> | foo | foo |
> | foo | foo |
>
> * bar
> --8<---cut here---end--->8---
>
>
> - Use command `org-narrow-to-subtree'.  See the effect.
> - Use command `widen' to get rid of the restriction.
> - Make sure to have point on the table of the subtree again.
> - Use command `org-narrow-to-element.  See the effect.
> - Compare!

Thanks, it did not occur to me that "element" may be something other
than a "subtree"!

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] What is the difference between `org-narrow-to-subtree' and `org-narrow-to-element'?

2018-10-10 Thread Marcin Borkowski


On 2018-10-08, at 17:58, Eric S Fraga  wrote:

> On Monday,  8 Oct 2018 at 17:26, Marcin Borkowski wrote:
>> Hi all,
>>
>> I found these two commands.  They seem to do the same thing.  What is
>> the difference?
>
> These will only do the same thing if your element (where point is) happens to 
> be the sub-tree and nothing else.  Try it within a list element in a sub-tree 
> and you should notice a difference in behaviour.

Thanks, I didn't think about this!

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] How to make agenda generation faster

2018-10-10 Thread Marcin Borkowski


On 2018-10-08, at 09:20, Michael Welle  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> Hi Orgers,
>>
>> my agenda takes almost 10 seconds to show up.  Are there any ideas for
>> profiling that?
>>
>> I suspect that archiving a lot of old entries I don't use anymore might
>> help, but is there any way to e.g. display some stats on which
>> file/headline took how much time?
> since no one answered yet, there are some similar threads. IIRC the way
> to go is to use elp for profiling.
>
> Well, on my laptop the initial agenda run takes about 7s or so (150
> agenda files) using the current day/week agenda ("a"). All subsequent
> (after loading the files) agenda runs are fast (split second I would
> say). I had some performance issues in the past caused by SCM. Emacs
> tried to check if every file is checked out in the latest version. That
> slowed down the process a lot (starting 150 mercurial processes in
> sequential order, checking results, etc.). The initial run doesn't
> bother me much. I bound the initial agenda run to an idle timer at Emacs
> start. 

Interesting.  I did not notice such differences between the first and
subsequent runs.

Anyway, thanks for your input (to all people who replied, actually).

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] How to make agenda generation faster

2018-10-10 Thread Marcin Borkowski


On 2018-10-09, at 13:47, Julius Dittmar  wrote:

> Hi Marcin,
>
> I can't advise as to profiling to find out what really bogs down agenda
> building.
>
> I found that log messages do bog it down.
>
> I have a lot of recurring tasks, which accumulate log entries for every
> closing (which in fact means rescheduling to the next day). Every two to
> three months I prune my org files of those log entries. This
> significantly speeds up agenda building.

By experiments, I found that the main bottleneck was a file with lots (=
a few thousand) headlines.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] How to make agenda generation faster

2018-10-10 Thread Marcin Borkowski


On 2018-10-09, at 18:11, Nicolas Goaziou  wrote:

> Hello,
>
> Adam Porter  writes:
>
>> My feedback is: there be dragons.  ;)  The Agenda code is very
>> complicated and hard to follow, and it's hard to optimize something that
>> is hard to understand.
>
> And hard to maintain. We should really do something about it.
>
>> In the long run, to get significant speed improvements, I think it may
>> be necessary to reimplement the Agenda.
>
> Agreed.

+1

> [...]
>
> I didn't look closely at org-ql, but I had the idea of splitting the
> Agenda in two distinct parts. One would be responsible for collecting,
> possibly asynchronously, and caching data from Org documents. The other
> one would provide a DSL to query and display the results extracted from
> the output of the first part. The second part could even be made generic
> enough to be extracted from Org and become some part of Emacs.
> Displaying filtered data, maybe in a timeline, could be useful for other
> packages. Unfortunately, I don't have time to work on this. Ah well.
>
> So again, wouldn't it be nice to think about Org Agenda-ng?

That is a great idea!  In general, I find Org-mode to be lacking APIs.
I'dlove to build some applications on top of it, but getting some
information is very difficult.  (For instance, I'd like to get info
about clocks for all headlines in the agenda.  It seems I have to
implement parsing clocks myself, at least partially.)

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] How to make agenda generation faster

2018-10-10 Thread Marcin Borkowski


On 2018-10-09, at 08:37, Adam Porter  wrote:

> Hi Marcin,
>
> [...]
>
> If you haven't seen them already, you may find my org-ql and
> org-ql-agenda code useful.  org-ql-agenda presents an Agenda-like
> buffer.  N.B. It does *not* implement most of the Agenda features, but
> it does emulate an Org Agenda buffer by setting the appropriate text
> properties on entries and formatting them in a similar way.
>
> It's built on org-ql, which provides per-buffer query caching, which
> means that generating an org-ql-agenda view for Org buffers that haven't
> changed since the last view was generated is very fast.  It's also
> written in a more functional way, which I think is easier to follow and
> modify.  Performance of uncached queries/buffers depends on the
> query--some are relatively fast, while others are slower than the "real"
> Org Agenda.  I think there is significant potential for optimizations,
> and I'm hoping to implement some in the future.  Your feedback would be
> appreciated!
>
> https://github.com/alphapapa/org-ql

Thanks, I'll check those out!

Best,

-- 
Marcin Borkowski
http://mbork.pl



[O] An Org-based productivity tool

2018-10-10 Thread Marcin Borkowski
Hi Orgers,

I am making an Org-mode-based tool to help boost my productivity.

I am constantly fighting a losing battle with distractions.  I figured
out that showing me how much time I spent goofing around would help me
stay on track (being a math geek and a gamer, my "let's break my
yesterday's score" and similar instincts kick in immediately, too).  So
far, I have these in my prototype:

- a notification (recurring every n seconds) that I'm not clocking
  anything,

- some stats about what I spent my time on and what my efficiency (i.e.,
  percentage of time I spent working from the point when I started
  counting to now) is,

- info about how much work I need to do in order to meet my set goal,
  and how much will it take if my efficiency remains constant,

- a warning when my efficiency is lower than a set value, and info about
  how much work I need to do to bump it up to that value.

Here's an example output (with some partially faked data):

--8<---cut here---start->8---
39min of your workday (10%) has passed, and you have 5h 31min left.

work - 30min spent (12% of your goal of 4h and 75% of your workday so far)
   3h 30min remaining (4h 39min with your current efficiency of 75%).
   You need 9min of uninterrupted work to get back to 80% efficiency.

eating - 4min spent (10% of your workday so far)

bathroom - 2min spent (5% of your workday so far)

unclassified - 0min spent (0% of your workday so far)

Unclocked time so far: 3min.
--8<---cut here---end--->8---

My questions are:

- is anyone interested in something like this?

- are there any features you would like to have?  (I have some ideas,
  too.)

- does anyone have an idea of how to /name/ this project?

TIA,

--
Marcin Borkowski
http://mbork.pl



Re: [O] org-clock-in-last bug report

2018-10-09 Thread Marcin Borkowski


On 2018-10-09, at 18:28, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> org-clock-in-last used to do nothing when already clocking.  Now it
>> clocks out and immediately in in the same task.  It does that even in
>> emacs -Q.
>>
>> Org mode version 9.1.14 (release_9.1.14-968-gfdb36d)
>>
>> I'd try to debug it myself, but I'm rather in a hurry now, sorry.
>> I looked into git log and I suspect commit a2636b528, which seems to
>> change something in that department.
>
> You're right. *blushes* ;)
>
> Fixed.
>
> Thank you.

It's me who should thank!  You're very fast.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] org-clock-in-last bug report

2018-10-09 Thread Marcin Borkowski


On 2018-10-09, at 16:25, Marcin Borkowski  wrote:

> Hi all,
>
> org-clock-in-last used to do nothing when already clocking.  Now it
> clocks out and immediately in in the same task.  It does that even in
> emacs -Q.
>
> Org mode version 9.1.14 (release_9.1.14-968-gfdb36d)
>
> I'd try to debug it myself, but I'm rather in a hurry now, sorry.
> I looked into git log and I suspect commit a2636b528, which seems to
> change something in that department.

I had a few spare minutes to check it, and I can confirm that a2636b528
is the culprit.

Best,

-- 
Marcin Borkowski
http://mbork.pl



[O] org-clock-in-last bug report

2018-10-09 Thread Marcin Borkowski
Hi all,

org-clock-in-last used to do nothing when already clocking.  Now it
clocks out and immediately in in the same task.  It does that even in
emacs -Q.

Org mode version 9.1.14 (release_9.1.14-968-gfdb36d)

I'd try to debug it myself, but I'm rather in a hurry now, sorry.
I looked into git log and I suspect commit a2636b528, which seems to
change something in that department.

Best,

-- 
Marcin Borkowski
http://mbork.pl



[O] What is the difference between `org-narrow-to-subtree' and `org-narrow-to-element'?

2018-10-08 Thread Marcin Borkowski
Hi all,

I found these two commands.  They seem to do the same thing.  What is
the difference?

TIA,

-- 
Marcin Borkowski
http://mbork.pl



[O] How to make agenda generation faster

2018-10-06 Thread Marcin Borkowski
Hi Orgers,

my agenda takes almost 10 seconds to show up.  Are there any ideas for
profiling that?

I suspect that archiving a lot of old entries I don't use anymore might
help, but is there any way to e.g. display some stats on which
file/headline took how much time?

TIA,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] How about lifting the limit of 35 tasks in org-clock-history?

2018-10-03 Thread Marcin Borkowski


On 2018-10-03, at 12:51, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> I attach a patch with a more verbose docstring.
>>
>> It is perhaps still not ideal - in particular, the warning is not
>> visible in the Customize interface - but I do not think this is a big
>> deal.  My line of thinking is that:
>>
>> - if a user wants to change this setting, they will either look up the
>>   docstring and understand the limitation (btw, even the built-in way
>>   works for org-clock-history-length as high as 76 or so, provided you
>>   have a really high frame), or
>>
>> - use Customize, which is potentially a trouble - but in that case,
>>   I would assume that the user fiddles with org-clock-history-length
>>   because they clock in many tasks, and then they will see that the list
>>   in the *Clock Task Select* buffer is too long anyway, and dial the
>>   setting down.
>
> It sounds good. I applied your patch. Thank you.

Thanks, too!  (Also for your extremely fast reply, comparing to my
one;-).)

Best,

--
Marcin Borkowski
http://mbork.pl



Re: [O] How about lifting the limit of 35 tasks in org-clock-history?

2018-10-02 Thread Marcin Borkowski

On 2018-09-06, at 16:18, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> I decided to put a warning about this in the docstring in my patch.  My
>> assumption was that this is enough.  If a user wants to change the
>> default, he will most probably see the docstring and will have to
>> actively ignore the warning.
>
> I don't think this is enough. As you put it, it instills doubt without
> explaining anything. Why 35? Why "may not work"? What "may not work"?

Agreed.  I attach a patch with a more verbose docstring.

It is perhaps still not ideal - in particular, the warning is not
visible in the Customize interface - but I do not think this is a big
deal.  My line of thinking is that:

- if a user wants to change this setting, they will either look up the
  docstring and understand the limitation (btw, even the built-in way
  works for org-clock-history-length as high as 76 or so, provided you
  have a really high frame), or

- use Customize, which is potentially a trouble - but in that case,
  I would assume that the user fiddles with org-clock-history-length
  because they clock in many tasks, and then they will see that the list
  in the *Clock Task Select* buffer is too long anyway, and dial the
  setting down.

An alternative could be to change the hard-coded 35 in the code into yet
another variable, say, org-clock-history-max-length, and set it to 35.
Still, if a user wants to increase org-clock-history-length beyond 35
(or whatever this could be changed to), it is IMHO the /current/
behavior which is really confusing, and introducing a cap on the cap
would only make things worse.

WDYT?

--
Marcin Borkowski
http://mbork.pl
>From bd5c4b7f3afe6a906b91e7f0bd33e2842fcf8656 Mon Sep 17 00:00:00 2001
From: Marcin Borkowski 
Date: Fri, 31 Aug 2018 07:53:42 +0200
Subject: [PATCH] Lift the artificial limit on the clock history length.

The default limit of 35 was hard-coded, and was especially annoying
when using an alternative way of selecting from history,
e.g. https://github.com/unhammer/org-mru-clock.
---
 lisp/org-clock.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 9819fcff2..71ed99f69 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -156,7 +156,10 @@ state to switch it to."
 	  (symbol :tag "Function")))
 
 (defcustom org-clock-history-length 5
-  "Number of clock tasks to remember in history."
+  "Number of clock tasks to remember in history.
+Clocking in using history works best if this is at most 35, in
+which case all digits and capital letters are used up by the
+*Clock Task Select* buffer."
   :group 'org-clock
   :type 'integer)
 
@@ -534,7 +537,7 @@ cannot be translated."
 
 (defun org-clock-history-push ( pos buffer)
   "Push a marker to the clock history."
-  (setq org-clock-history-length (max 1 (min 35 org-clock-history-length)))
+  (setq org-clock-history-length (max 1 org-clock-history-length))
   (let ((m (move-marker (make-marker)
 			(or pos (point)) (org-base-buffer
 	  (or buffer (current-buffer)
-- 
2.19.0



Re: [O] Emacs mobile org

2018-09-12 Thread Marcin Borkowski


On 2018-09-10, at 14:47, Greg Troxel  wrote:

> Marcin Borkowski  writes:
>
>> On 2018-09-10, at 09:46, Alan Schmitt  wrote:
>>
>>> I use orgzly, and it works great with syncthing https://syncthing.net/
>>
>> BTW, in my experience syncthing seems quite flaky.  I turn it on on both
>> the coputer and my phone, but I'm not sure what to do to start syncing.
>> Sometimes it just works, sometimes it doesn't (or takes a lot of time,
>> I'm not sure).  Any hints?  Is it possible to make the phone start
>> syncing manually?  (I'm almost sure that my problems stem from my
>> incompetence, hence the question.)
>
> There are actually some issues in android syncthing tracker about this.
>
> my experience:
>
> syncthing the protocol and the desktop versions works very solidly
>
> the android version used to have an issue with timestamps, since on
> android you can't (couldn't) (as a non-root user) set mod times.  I
> think, but I'm not 100% sure, that there's now a sidecar cache so that
> syncthing can store the mod times and have a virtual view where they are
> as they should be, vs. having them at time of sync.  This has been a
> non-issue for me for a long time now, but including it for completeness.
>
> The big problem is the dreaded "run conditions".  Syncthing uses both
> cpu and data, both of which are a problem on a phone.  There are
> multiple modes; one is to sync only when opening the app.  The other is
> to sync always, and then "sync only when charging" (means power applied
> really) and "sync only on wifi".   So you can uncheck those to force it
> to run, and maybe restart syncthing.   It tends to be a bit android
> rom-specific how well it works.
>
> So my advice is to go into syncthing on the phone, and if it tells you
> "syncthing is configured not run, [exit] or [change settings], that's a
> clue.  If not, you can look at the devices tab and see if it's
> connected.  Also look at the dashboard on your desktop client.
>
> https://github.com/syncthing/syncthing-android/issues/1193

Thanks a lot, I'll check it out!

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Emacs mobile org

2018-09-12 Thread Marcin Borkowski


On 2018-09-10, at 15:05, Alan Schmitt  wrote:

> On 2018-09-10 11:41, Marcin Borkowski  writes:
>
>> On 2018-09-10, at 09:46, Alan Schmitt  wrote:
>>
>>> I use orgzly, and it works great with syncthing https://syncthing.net/
>>
>> BTW, in my experience syncthing seems quite flaky.  I turn it on on both
>> the coputer and my phone, but I'm not sure what to do to start syncing.
>> Sometimes it just works, sometimes it doesn't (or takes a lot of time,
>> I'm not sure).  Any hints?  Is it possible to make the phone start
>> syncing manually?  (I'm almost sure that my problems stem from my
>> incompetence, hence the question.)
>
> One thing to make sure is that they run on the same network. But besides
> this I have not much advice to give, as it just works here.

Thanks, I'll be looking into this.

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Emacs mobile org

2018-09-10 Thread Marcin Borkowski


On 2018-09-10, at 09:46, Alan Schmitt  wrote:

> I use orgzly, and it works great with syncthing https://syncthing.net/

BTW, in my experience syncthing seems quite flaky.  I turn it on on both
the coputer and my phone, but I'm not sure what to do to start syncing.
Sometimes it just works, sometimes it doesn't (or takes a lot of time,
I'm not sure).  Any hints?  Is it possible to make the phone start
syncing manually?  (I'm almost sure that my problems stem from my
incompetence, hence the question.)

TIA,

--
Marcin Borkowski
http://mbork.pl



Re: [O] How about lifting the limit of 35 tasks in org-clock-history?

2018-09-08 Thread Marcin Borkowski


On 2018-09-06, at 16:18, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> I decided to put a warning about this in the docstring in my patch.  My
>> assumption was that this is enough.  If a user wants to change the
>> default, he will most probably see the docstring and will have to
>> actively ignore the warning.
>
> I don't think this is enough. As you put it, it instills doubt without
> explaining anything. Why 35? Why "may not work"? What "may not work"?

OK.  How about

1. making the docstring more precise

2. leaving the limit, but instead of hard-coded 35 make it configurable
using a variable?

>> I do not use the vanilla Org way of selecting tasks to clock from
>> history - I use org-mru-clock, for which the restriction doesn't make
>> sense.  So we have something else to use,
>
> I meant "have something else to use out of the box". I.e., not with an
> external library.

I see.

Frankly, I think the out-of-the-box way of selecting tasks from history
is not very good.  For starters, it won't work with completion (like
org-mru-clock does).  Also, I think the window with the list in not
scrollable.

> I agree with the idea of removing this limitation, but I'm not convinced
> your patch is ideal yet.

Thanks.  I'll submit a better one soon.

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] How about lifting the limit of 35 tasks in org-clock-history?

2018-09-06 Thread Marcin Borkowski


On 2018-09-02, at 16:50, Marcin Borkowski  wrote:

> On 2018-09-02, at 14:45, Nicolas Goaziou  wrote:
>
>> Hello,
>>
>> Marcin Borkowski  writes:
>>
>>> I attach a trivial patch fixing a very annoying cap on
>>> org-clock-history.  (I want to set org-clock-history to 120.)
>>
>> According to 7972356d092736af06282a09f008c2b5f938134d and
>> 77f1f31c99f521751dc0b57f9923773e97644bb5, this limits selection to
>> standard selection keys. 
>>
>> If we want to allow more clock history, we need to remove the selection
>> keys, and be sure we have something else to use.
>
> I decided to put a warning about this in the docstring in my patch.  My
> assumption was that this is enough.  If a user wants to change the
> default, he will most probably see the docstring and will have to
> actively ignore the warning.
>
> I do not use the vanilla Org way of selecting tasks to clock from
> history - I use org-mru-clock, for which the restriction doesn't make
> sense.  So we have something else to use, and it doesn't bother me that
> I can't select older tasks with the original Org method.

Hi Nicolas and others,

any comments on this patch?

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] How about lifting the limit of 35 tasks in org-clock-history?

2018-09-02 Thread Marcin Borkowski


On 2018-09-02, at 14:45, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> I attach a trivial patch fixing a very annoying cap on
>> org-clock-history.  (I want to set org-clock-history to 120.)
>
> According to 7972356d092736af06282a09f008c2b5f938134d and
> 77f1f31c99f521751dc0b57f9923773e97644bb5, this limits selection to
> standard selection keys. 
>
> If we want to allow more clock history, we need to remove the selection
> keys, and be sure we have something else to use.

I decided to put a warning about this in the docstring in my patch.  My
assumption was that this is enough.  If a user wants to change the
default, he will most probably see the docstring and will have to
actively ignore the warning.

I do not use the vanilla Org way of selecting tasks to clock from
history - I use org-mru-clock, for which the restriction doesn't make
sense.  So we have something else to use, and it doesn't bother me that
I can't select older tasks with the original Org method.

Best,

-- 
Marcin Borkowski
http://mbork.pl



[O] How about lifting the limit of 35 tasks in org-clock-history?

2018-08-30 Thread Marcin Borkowski
Hi all,

I attach a trivial patch fixing a very annoying cap on
org-clock-history.  (I want to set org-clock-history to 120.)

Best,

--
Marcin Borkowski
http://mbork.pl
>From 10de3a12ebbad820fb86dc6924f17d701d4f9620 Mon Sep 17 00:00:00 2001
From: Marcin Borkowski 
Date: Fri, 31 Aug 2018 07:53:42 +0200
Subject: [PATCH] Lift the artificial limit on the clock history length.

The default limit of 35 was hard-coded, and was especially annoying
when using an alternative way of selecting from history,
e.g. https://github.com/unhammer/org-mru-clock.
---
 lisp/org-clock.el | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 9819fcff2..370392947 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -156,7 +156,9 @@ state to switch it to."
 	  (symbol :tag "Function")))
 
 (defcustom org-clock-history-length 5
-  "Number of clock tasks to remember in history."
+  "Number of clock tasks to remember in history.
+Clocking in using history may not work if this number is higher
+than 35."
   :group 'org-clock
   :type 'integer)
 
@@ -534,7 +536,7 @@ cannot be translated."
 
 (defun org-clock-history-push ( pos buffer)
   "Push a marker to the clock history."
-  (setq org-clock-history-length (max 1 (min 35 org-clock-history-length)))
+  (setq org-clock-history-length (max 1 org-clock-history-length))
   (let ((m (move-marker (make-marker)
 			(or pos (point)) (org-base-buffer
 	  (or buffer (current-buffer)
-- 
2.18.0



  1   2   3   4   5   6   7   8   >