Re: Org and Multimedia..?

2022-11-30 Thread Marcin Borkowski


On 2022-11-30, at 20:35, David Masterson  wrote:

> Is it possible to attach (say) an image to a task?
>
> I'd like to use images to help explain tasks better (or just remind me
> what my intention was).  I imagine you could do something with file
> links, but is there a defined method?  Issues:
>
> 1. Directory structure containing Org / Media files
> 2. Syncing images with Org files to other systems
> 3. In particular, syncing to smart phones (BeOrg, Orgzly, ...) 
> 4. Any add-on packages that would help

More like a PoC and/or potential source of inspiration than something
genuinely useful, but let me plug this:
https://mbork.pl/2018-08-18_Embedding_files_in_Org-mode_revisited

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [OT] org and diff

2022-11-13 Thread Marcin Borkowski


On 2022-11-13, at 06:15, Samuel Wales  wrote:

> But something drives me crazy.  Probably not too Org-related, but it
> might be.  I just want to know why, is all.
> [...] diff goes insane.

I think this is a known problem with diff, which is inherently
line-based and knows nothing about actual syntax of the underlying
language.

FWIW, if things like this happen to me (and they do happen a lot,
especially when I'm doing code review), I abandon diff and use
difftastic (https://difftastic.wilfred.me.uk/) instead.

Surprisingly, difftastic seems not to support Org syntax.

One question I'd ask is: how important a legible diff is to you?  I keep
my Org files in Git, too, but if /I/ know what was changed, I just don't
care about diff going nuts and I treat it as (more or less) Git's
internal implementation detail.

Just my 2cents (not too helpful, I'm afraid...)

-- 
Marcin Borkowski
http://mbork.pl



Re: Docstrings and literate programming (good practices?)

2022-11-04 Thread Marcin Borkowski


On 2022-11-04, at 06:45, to...@tuxteam.de wrote:

> On Thu, Nov 03, 2022 at 08:03:05PM -0700, Samuel Wales wrote:
>> i wonder if emacs or org has what you might call semi-literate or
>> etaretil docstring functions?
>> 
>> for example, you have a body of non-literate elisp code, and you have
>> a manual.  it could be redundant to describe commands and what they do
>> and their options, if the docstrings are good.
>> 
>> why not include the docstrings of all commands in some nice format in
>> the .org manual via some mechanism?
>
> Ah. Javadoc and their descendants. I tend to call that "illiterate
> programming"...

I spat my tea. :-)  Thanks, that's a nice one!

Though this _may_ work in some cases.  For example, imagine you divide
your package into two files – one with user-facing commands and another
one with internal functions.  If you order the former one carefully, the
"extract docstrings" might actually work as a documentation.

Still, a "normal" documentation seems a better (even if more
time-consuming) options.

Also, such docstring-based documentation is still better than none.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: Org mode, Org Mode, Org-mode or Org-Mode?

2022-10-29 Thread Marcin Borkowski


On 2022-10-28, at 23:50, Ihor Radchenko  wrote:

> Marcin Borkowski  writes:
>
>> What is the "official" version?  I found at least two spelling on
>> orgmode.org...
>
> If we look into doc/Documentation_Standards.org:
>
> - Prefer "Org mode" to "Org-mode" or "org-mode".  This is simply
>   because it reflects an existing convention in [[info:emacs:Top][The 
> Emacs Manual]] which
>   consistently documents mode names in this form - "Text mode",
>   "Outline mode", "Mail mode", etc.
>
> It is _the_ convention.

Thanks!

> Another question is whether we actually follow it everywhere...

Yep...

-- 
Marcin Borkowski
http://mbork.pl



Org mode, Org Mode, Org-mode or Org-Mode?

2022-10-28 Thread Marcin Borkowski
What is the "official" version?  I found at least two spelling on
orgmode.org...

TIA,

-- 
Marcin Borkowski
http://mbork.pl



Re: Interest in an Org video meetup?

2022-10-06 Thread Marcin Borkowski


On 2022-10-06, at 19:24, Russell Adams  wrote:

> On Thu, Oct 06, 2022 at 05:28:12PM +0200, Marcin Borkowski wrote:
>> Me too, though it depends on the schedule.  What time of day do you plan
>> for that?
>
> From my original post:
>
>>> I'm offering to schedule and moderate the first few events. I'd
>>> propose a Saturday meeting in the afternoon European time to cover EU
>>> and NA.

Thanks.  Stupid me.

-- 
Marcin Borkowski
http://mbork.pl



Re: Interest in an Org video meetup?

2022-10-06 Thread Marcin Borkowski


On 2022-10-06, at 16:40, Leslie Watter  wrote:

> Would be great to see what others are doing in their workflows using org ;-)
>
> I'd like to join to!

Great idea!

Me too, though it depends on the schedule.  What time of day do you plan
for that?

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: Suggested Syntax for cancelled checkboxes: [-] as non-blocking dependency

2022-09-13 Thread Marcin Borkowski


On 2022-09-13, at 10:07, Karl Voit  wrote:

> Is it only me who is thinking that a non-blocking cancelled checkbox
> state would be a good idea?

No.

-- 
Marcin Borkowski
http://mbork.pl



Re: [tip/offtopic] A function to describe the characters of a word at point

2022-07-14 Thread Marcin Borkowski


On 2022-07-13, at 12:49, Juan Manuel Macías  wrote:

> Sorry for the slight offtopic.

Not off-topic at all, as far as I'm concerned!  (Though sending this to
help-gnu-emacs might be an even better idea.)  I use `C-u C-x =' pretty
often, so I fully understand why someone might want to code something
like this.  Very nice, thanks for sharing!

You might want to extend it and create a minor mode which would display
data about the current character in the echo area, Eldoc-style, or in
a tooltip when you hover the mouse pointer over a character.  Depending
on what exactly you need, these ideas might be more or less useful, of
course.

Also, since the answer to quite a few org-related issues seems to be
"just insert a zero-width space", making those stand out (like
non-breaking spaces already are) could also be useful.  FWIW, I have
this function in my init.el:

(defun insert-zero-width-space ()
  "Insert Unicode character \"zero-width space\"."
  (interactive)
  (insert "​"))

(of course, the 0-width space is invisible between the quotes).

Best,
mbork



> Since Unicode and character issues come up here from time to time, I'm
> sharing this 'homemade' function that I wrote a long time ago for my
> work, in case someone finds it useful. It Shows a brief descriptive list
> of all characters in a word at point. Each character includes the
> Unicode name, code, and canonical decomposition. Example:
>
> ἄρχοντα >>
>
> ἄ (#1f04) ... GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA ... descomp: #1f00 
> #301
> ρ (#3c1) ... GREEK SMALL LETTER RHO ... descomp: #3c1
> χ (#3c7) ... GREEK SMALL LETTER CHI ... descomp: #3c7
> ο (#3bf) ... GREEK SMALL LETTER OMICRON ... descomp: #3bf
> ν (#3bd) ... GREEK SMALL LETTER NU ... descomp: #3bd
> τ (#3c4) ... GREEK SMALL LETTER TAU ... descomp: #3c4
> α (#3b1) ... GREEK SMALL LETTER ALPHA ... descomp: #3b1
>
>
> #+begin_src emacs-lisp
>   (defun describe-chars-word-at-point ()
> (interactive)
> (setq chars-in-word nil)
> (if
> (not (current-word t t))
> (error "Not in a word at point...")
>   (let
>   ((word (current-word t t)))
> (save-excursion
>   (with-temp-buffer
> (insert word)
> (goto-char (point-min))
> (while (re-search-forward "\\(.\\)" nil t)
>   (let* ((char-name (save-excursion
>   (backward-char)
>   (get-char-code-property (char-after 
> (point)) 'name)))
>  (char-desc (save-excursion
>   (backward-char)
>   (get-char-code-property (char-after 
> (point)) 'decomposition)))
>  (char-format (concat (match-string 1) "\s" "("
>   (format "#%x" (string-to-char 
> (match-string 1)))
>   ")\s...\s" char-name 
> "\s...\sdecomp:\s"
>   (mapconcat (lambda (cod)
>(format "#%x" cod))
>  char-desc " "
> (push char-format chars-in-word)))
> (when (get-buffer "*chars in word*")
>   (kill-buffer "*chars in word*"))
> (get-buffer-create "*chars in word*")
> (set-buffer "*chars in word*")
> (insert (mapconcat 'identity
>(reverse chars-in-word) "\n"))
> (view-mode)
> (temp-buffer-window-show "*chars in word*"
>  '((display-buffer-below-selected 
> display-buffer-at-bottom)
>(inhibit-same-window . t)
>(window-height . 
> fit-window-to-buffer
>   (pop-to-buffer "*chars in word*")
> #+end_src


-- 
Marcin Borkowski
http://mbork.pl



Re: how to convert a non-org list to org headings

2022-07-06 Thread Marcin Borkowski


On 2022-07-06, at 17:31, Kaushal Modi  wrote:

> On Wed, Jul 6, 2022 at 11:17 AM Uwe Brauer  wrote:
>
>> Hi
>>
>> I have a file that contains a list as:
>>
>>
>> 1.1 Funciones de una variable

No period after "1.1" above - makes things slightly more difficult.

> The method that I show below is quick but not robust. You'll need to review
> all the replacements.
>
> - Do query-replace-regexp [default binding: C-M-%]
> - Search for [0-9]+\.
> - Replace with *

This might be a bit overzealous if there are more numbers with a period
after them.  Another way would be to add ^\(\**\) at the beginning of
the regex (and a \1 in the replacement) and go through the file as many
times as there are nesting levels.

You could also try Elisp as the replacement - see
https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html,
https://www.masteringemacs.org/article/evaluating-lisp-forms-regular-expressions
and
http://mbork.pl/2013-09-18_Selective_replacement_in_LaTeX_documents_(en) .

You could probably use keyboard macros, too - see e.g.
http://mbork.pl/2021-02-20_Using_keyboard_macros_to_emulate_query_replace .

Hth,

-- 
Marcin Borkowski
http://mbork.pl



[BUG] Error when editing properties in column view [9.5.3 (release_9.5.3-452-g407104 @ /home/mbork/others-works/emacs/org-mode/lisp/)]

2022-05-09 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.


When I try to edit a property in column view, I get the following error message:

Invalid column specification format: nil

This only seems to happen if the point is not too close to the left
margin.  I did a bit of digging and found out that the culprit is most
probably the `org-columns-update' function, which contains this:

(let* ((spec (nth (current-column) org-columns-current-fmt-compiled))
...) ...)

Since `org-columns-current-fmt-compiled' seems to contain one entry per
_table_ column and `current-column' returns the "horizontal position of
point" (i.e., the index of the _character_ column the point is in),
`spec' gets assigned nil unless the point happens to be no more
characters from the left margin than there are columns in the column
view, and even then it gets assigned the wrong thing.

I might be mistaken, though - I only skimmed through this code.

Here is an example file where this happens:

--8<---cut here---start->8---

* Test
** Entry A
:PROPERTIES:
:a:1
:b:2
:END:
** Entry B
:PROPERTIES:
:a:3
:b:4
:END:
* Config
#+COLUMNS: %4a %4b
--8<---cut here---end--->8---

Go to `* Test', press `C-c C-x C-c', then go to `2' and press `e 2 '.

I also saw this on emacs -Q, with the built-in Org-mode:
Org mode version 9.5.2 (release_9.5.2-22-g33543d @ 
/usr/local/share/emacs/29.0.50/lisp/org/)



Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.31, 
cairo version 1.17.4)
 of 2022-03-06
Package: Org mode version 9.5.3 (release_9.5.3-452-g407104 @ 
/home/mbork/others-works/emacs/org-mode/lisp/)

-- 
Marcin Borkowski
http://mbork.pl



Re: How to export to markdown programmatically without the table of contents?

2022-05-08 Thread Marcin Borkowski


On 2022-05-07, at 10:16, Max Nikulin  wrote:

> On 02/05/2022 23:52, Marcin Borkowski wrote:
>> On 2022-05-01, at 22:01, Berry, Charles wrote:
>>>> On May 1, 2022, at 2:20 AM, Marcin Borkowski wrote:
>>>>
>>>> I'd like to export a Org-mode formatted string to markdown, but without
>>>> the table of contents.
>>>>
>>>> (org-export-string-as my-string 'md t '(toc nil))
>>>>
>>>> didn't work (the ToC was still there).  What am I missing?
>>>
>>> It does seem odd that BODY-ONLY as `t' gives a toc. With latex it does not 
>>> regardless of `:with-toc'.
>>>
>>> : (org-export-string-as my-string 'md t '(:with-toc nil))
>> Thanks!
>> http://mbork.pl/2021-05-02_Org-mode_to_Markdown_via_the_clipboard
>
> The following links posted earlier to this mail list might be
> interesting for you since they are related to "exporting" of org text
> to other applications:
>
> https://github.com/tecosaur/emacs-everywhere
> System-wide popup Emacs windows for quick edits
>
> https://github.com/jkitchin/ox-clip/
> Copy formatted content from org-mode
>
> The latter copies HTML, not markdown though.

Thanks, both look really interesting!

-- 
Marcin Borkowski
http://mbork.pl



Re: How to export to markdown programmatically without the table of contents?

2022-05-02 Thread Marcin Borkowski


On 2022-05-01, at 22:01, Berry, Charles  wrote:

>> On May 1, 2022, at 2:20 AM, Marcin Borkowski  wrote:
>> 
>> Hi fellow Orgers,
>> 
>> I'd like to export a Org-mode formatted string to markdown, but without
>> the table of contents.
>> 
>> (org-export-string-as my-string 'md t '(toc nil))
>> 
>> didn't work (the ToC was still there).  What am I missing?
>
>
> It does seem odd that BODY-ONLY as `t' gives a toc. With latex it does not 
> regardless of `:with-toc'.
>
> : (org-export-string-as my-string 'md t '(:with-toc nil))
>
> seems to give what you want.

Thanks!

http://mbork.pl/2021-05-02_Org-mode_to_Markdown_via_the_clipboard

Best,

-- 
Marcin Borkowski
http://mbork.pl



How to export to markdown programmatically without the table of contents?

2022-05-01 Thread Marcin Borkowski
Hi fellow Orgers,

I'd like to export a Org-mode formatted string to markdown, but without
the table of contents.

(org-export-string-as my-string 'md t '(toc nil))

didn't work (the ToC was still there).  What am I missing?

TIA,

-- 
Marcin Borkowski
http://mbork.pl



Re: Read only org view mode

2022-01-23 Thread Marcin Borkowski


On 2022-01-23, at 08:19, Arthur Miller  wrote:

> Hi mailing list,
>
> is something like this of interest to add to org-mode?

Yes! Yes! Yes!

I can see all sorts of stuff going from here.  Three examples follow.

1. I have a daily journal in Org-mode, and I wrote a simple function
showing me "what happened on this day in all previous years of
journaling".  Making that read-only, with view-mode-like bindings is an
obvious thing to do.  (In fact, I plan to blog about that function
soon.)

2. I imagine this could be used to create menus, a bit like Magit, with
toggleable sections etc.

3. I once coded myself a kind of "dashboard", showing various things in
(almost) real time - think current time, weather, departures of busses
from a nearby bus stop, Emacs uptime, number of open buffers, a todo
list for today etc.  (Sadly, I didn't finish it, though.)  A mode
derived from your mode could be great for that.

Thanks a lot for working on this,

-- 
Marcin Borkowski
http://mbork.pl



Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-10 Thread Marcin Borkowski
uble accounting.  It's neither
very hard nor boring!

Best,
mb



>
> I will take a look at the other suggestions with specific Org Mode formulas, 
> looked awesome, thanks.
>
> On Mon, Jan 10, 2022, at 10:31 AM, Greg Minshall wrote:
>> > I'm wondering if your opinion about Ledger isn't influenced by the fact
>> > that it uses basic accounting principles, like the idea of double-entry
>> > accounting.  For me, it's /very/ simple and intuitive, but I graduated
>> > in economics many years ago and had a (basic, but still) course on
>> > accounting.  If that is your problem, I'd suggest spending some time on
>> > understanding that - even if you don't end up using Ledger but some
>> > other software, you might find learning about accounting useful.  (Also,
>> > it's fascinating.  No, really!  It's an extremely clever abstract
>> > system with a real-life use-case.)
>> 
>> i agree that learning the principles of double-entry is worthwhile,
>> actually interesting, and of a very interesting history!
>> 


-- 
Marcin Borkowski
http://mbork.pl



Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-09 Thread Marcin Borkowski


On 2022-01-10, at 04:42, Samuel Banya  wrote:

> Ah, Ledger is way too complicated for what it's worth. I've seen videos on 
> YouTube about it, and every person who's praised it is pretty much too smart 
> enough to be able to explain it in simple terms.

Interesting - I've been using Ledger for many years now, and while
I agree that it has its dark corners, it's much like Org in that respect
- you are not forced to use them at all.  And the "core" is IMHO /very/
simple - you just record your "transactions" (e.g., using the very nice
Emacs ledger-mode) and look at a report.

I basically use just one kind of report - the balance report, both to
reconcile my ledger file with my cash and bank and to see the
current/previous month's income and expenses.

Before I started using Ledger, I used GNUcash (on and off for a few
years, too) - I can't say a bad word about it, but it's not Emacs-based,
so you know.  Also, it's not exactly text-based (AFAIR, it uses XML, so
it "kind of" is, but...) - a big advantage of Ledger is that I can keep
my books in Git.  (Of course, using Org would have the same advantage.)

Also, if you don't insist on Ledger, https://plaintextaccounting.org/
has a comparison of other text-based accounting tools.

I'm wondering if your opinion about Ledger isn't influenced by the fact
that it uses basic accounting principles, like the idea of double-entry
accounting.  For me, it's /very/ simple and intuitive, but I graduated
in economics many years ago and had a (basic, but still) course on
accounting.  If that is your problem, I'd suggest spending some time on
understanding that - even if you don't end up using Ledger but some
other software, you might find learning about accounting useful.  (Also,
it's fascinating.  No, really!  It's an extremely clever abstract
system with a real-life use-case.)

That said, there are people who just use a regular spreadsheet for their
personal/household finance, and it seems to work for them.  Go figure.
(Now that I think of it, I'll have to ask someone who does how they
manage that.)

Having said all that, would someone be interested in a blog post(s) with
a Ledger basics crash course?

Hth,

-- 
Marcin Borkowski
http://mbork.pl



Re: [tip] Inline tasks as anonymous sections

2022-01-08 Thread Marcin Borkowski


On 2022-01-08, at 12:32, Juan Manuel Macías  wrote:

> Hi,
>
> I think that a very efficient way to take advantage of inline tasks (in
> the framework of document authoring and exporting) is to treat them as
> anonymous sections, that is, those sections that do not have a title and
> are normally separated in books by some special symbol: three asterisks
> (a dinkus: https://en.wikipedia.org/wiki/Dinkus), an asterism (three
> asterisks forming a triangle), or any other fancy symbol. Users can
> associate their own export functions with the variables
> `org-latex-format-inlinetask-function',
> `org-odt-format-inlinetask-function', etc. Well, you can always add the
> separation symbol directly in your text, but the advantage of using
> inline task is that we can conveniently have those sections delimited,
> as real sections (with properties, todo states, etc).
>
> If anyone wants to explore this possibility, I am attaching a test org
> document. I have defined two LaTeX commands: \anonsectionbreak and
> \anonsectionmark; and the 'anonsection' environment[1].

I don't expect this to be useful for me personally, but I love the idea!

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: From macros to elisp programming?

2021-12-07 Thread Marcin Borkowski
 comes with Emacs itself.

Another thing I'd like to add here is that asking on this list is
usually a good idea.  I learned a lot (and I'm still learning a lot)
just by reading emails here.

Other resources I'd mention are:
- Emacs source code (though it is very complicated in some places...)
- source code of various packages
- Emacs blogs (https://planet.emacslife.com/)

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: On zero width spaces and Org syntax

2021-12-04 Thread Marcin Borkowski


On 2021-12-04, at 08:22, Ihor Radchenko  wrote:

> Marcin Borkowski  writes:
>> 2. We modify Emacs itself to somehow highlight the ZWS.  There is (kind
>> of) a precedent – a no-breaking space is already fontified with
>> =nobreak-space= face.  At the very least, make whitespace-mode somehow
>> show ZWSs (which it doesn't now, and I'd probably say it's a bug).
>>
>> I know that my point 2. is a bit controversial, since it could lead to
>> alignment issues where a ZWS is displayed as something with a positive
>> width. OTOH, even now changing the face of a ZWS leads to a narrow
>> (1-pixel wide) line of a different color.  Is there a way to make it
>> a bit stronger?
>
> We can try to create an accent. Try the following:
> 1. Open new empty org buffer
> 2. Disable font-lock-mode
> 3. M-: (insert (compose-string "a​" nil nil (list ?a '(bl . tl) ?␣)))
>
> The result will look like on the attached image.

I'm not sure if I like that idea - looks great, but I'd be a bit afraid
of unintended consequences.

Either way, personally I can live with ZWSs in my Org files, so whatever
is decided, it's fine with me.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: On zero width spaces and Org syntax

2021-12-03 Thread Marcin Borkowski


On 2021-12-03, at 13:48, Juan Manuel Macías  wrote:

> Hi all,
>
> It is usually recommended, as you know, to insert a zero width space
> character (Unicode U+200B) as a sort of delimiter mark to solve the
> scenarios of emphasis within a word (for example, =/meta/literature=)
> and others contexts where emphasis marks are not recognized (for example
> =[/literature/]=). I believe that as a puntual workaround it is not bad;
> however, I find it problematic that this character is part, more or less
> de facto, of the Org syntax. For two main reasons:
>
> 1. It is an invisible character, and therefore it is difficult to
> control and manage. I think it is not good practice to introduce this
> type of characters implicitly in a plain text document.
>
> 2. It is more natural that this type of space characters are part of the
> 'output' and not of the 'input'. In the input it is better to introduce
> them not implicitly but through their representation. For example, in
> LaTeX (with LuaTeX) using the command '\char"200B{}' (or '200b'),
> '' in HTML, etc.
>
> In any case, as an implicit character, I do not see it appropriate for
> the syntax of a markup language. The marks should be simply ascii
> characters, IMHO. So what if Org had a specific delimiter mark for the
> scenarios described above? For example, something like that:

Hi all,

I've skimmed through this discussion.  FWIW, I also use zero-width
spaces in my Org files for this precise reason.  However, I agree that
extending syntax is dangerous.

How about a solution (or maybe it's only a "solution"...) where:

1. We take care to modify the "official" exporters to throw out the ZWSs.
Or even better, convert them to something reasonable, e.g. with LaTeX
they can be discarded or converted to some command – possibly even one
defined in the preamble – so that nothing is lost.  I'd even say that an
option deciding what to do with those could be nice.

2. We modify Emacs itself to somehow highlight the ZWS.  There is (kind
of) a precedent – a no-breaking space is already fontified with
=nobreak-space= face.  At the very least, make whitespace-mode somehow
show ZWSs (which it doesn't now, and I'd probably say it's a bug).

I know that my point 2. is a bit controversial, since it could lead to
alignment issues where a ZWS is displayed as something with a positive
width. OTOH, even now changing the face of a ZWS leads to a narrow
(1-pixel wide) line of a different color.  Is there a way to make it
a bit stronger?

Just some random ideas,

-- 
Marcin Borkowski
http://mbork.pl



Re: "Orgdown", the new name for the syntax of Org-mode

2021-11-29 Thread Marcin Borkowski


On 2021-11-29, at 19:27, M. ‘quintus’ Gülker  wrote:

> Am Montag, dem 29. November 2021 schrieb Karl Voit:
>> It seems to be the case that the name "Orgdown" is the reason why
>> the Org-mode community does not support the idea of an
>> implementation-agnostic definition of the syntax. Which is ... kinda
>> funny if you think about it.
>>
>> Well if the project is not working out, at least I made my point and
>> we continue to have all those misunderstandings and lack of Orgdown
>> support in 3rd party tools (because Org-mode is way too big).
>
> I think the project has value; better tooling outside of Emacs is
> something org can only profit from in my opinion. One point that has not
> been raised yet are scenarios of collaborative work; I would enjoy it
> quite a bit if I could work on documents together with people who do not
> like Emacs as an editor for whatever reason. Currently, org as a file
> format is pretty much excluded if collaboration is intended with someone
> who does not use Emacs. The natural choice in these cases is Markdown.

This!

>> Oh, there is a very large danger here of getting something that is
>> not compatible with Org-mode any more. I don't think that this would
>> be a good thing. At least the different flavors killed the fun of
>> Markdown for me.
>
> The astonishing thing is that most people manage to get along despite of
> the incompatibilities of the different Markdown flavours. Otherwise
> Markdown would not be such a success. Why is this? What can be learned
> from this for creating org tools outside of Emacs? Actually surveying
> this might be of interest.
>
> Maybe most documents are very simple files. README files for FLOSS
> projects, forum posts, blog posts. For such content the features where
> the Markdown implementations differ are usually not required. It
> suffices to use unstyled text, headings, code blocks, quotes, emphasis.
> That is it basically. org shines on documents where more is required --
> documentation, books, since recently scientific articles. Markdown’s
> common subset is not expressive enough for these documents, whereas for
> simple documents there is not much benefit in trading in Markdown for
> org. Thus, maybe it is more fruitful to try to market org(down) as a
> markup for complex documents, with the added benefit that it does
> incidentally also cover simple documents nicely on par with Markdown.

I agree.  When I type Markdown (and I often do, in a few places),
I mainly use `backticks` (single and triple ones) for code etc.,
_italics_,
- sometimes
- bulleted
- lists,

> quotations (not very often),

and a

# Heading

on rare occasions.  That's pretty much it.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Is it possible to add a "cumulative" column in column view?

2021-11-29 Thread Marcin Borkowski
Hi fellow Orgers,

I started using column view recently, and I would greatly appreciate it
if I could add a column with "cumulative sum".  In a less-than ideal
world it would be the sum of all the values of some property until the
current row.  In an ideal world, it could only count values of some
property A for rows in which property B is set to certain value.

I looked at the docstring of `org-columns-summary-types', and it is
obviously impossible to do it with it (the `summarize' function always
gets all the values and doesn't get the row number on anything like
it).  How difficult would it be to extend it?  (A cursory look at
`org-colview.el' suggests that there are quite a few layers of
abstraction, so it doesn't look like a 10-minute hack...)

TIA,

-- 
Marcin Borkowski
http://mbork.pl



Re: "Orgdown", the new name for the syntax of Org-mode

2021-11-29 Thread Marcin Borkowski


On 2021-11-29, at 13:18, Juan Manuel Macías  wrote:

> Marcin Borkowski writes:
>
>> Quite the contrary.  The amount of confusion between TeX (engine)/TeX
>> (language)/TeX (distro)/TeX-aware text editor/LaTeX (whatever) among
>> novice/casual users has always been terrible.
>
> It's natural when those novice/casual users approach something that is
> new to them, but nothing invincible when they want to learn. The "TeX"
> ecosystem is not trivial, but I think that all, or almost all of us,
> understand each other when things like 'TeX/LaTeX code', 'TeX engine',
> 'LaTeX format', etc. are said. If the TeX language were somewhat
> self-contained and widely used outside of TeX, I would see OK that the
> language had its own name. But, since the TeX language is something that
> almost only TeX understands (roughly said), I think the economy wins
> here (IMHO). I don't see how we could improve everything by having half
> a dozen more exotic names.

Agreed, I just wanted to say that the situation with TeX is more
complicated.  Especially that 92%* TeX users are novice/casual users.

* Number made up, but loosely based on anecdotal evidence;-).

-- 
Marcin Borkowski
http://mbork.pl



Re: "Orgdown", the new name for the syntax of Org-mode

2021-11-28 Thread Marcin Borkowski


On 2021-11-28, at 23:25, Juan Manuel Macías  wrote:

> Hi,
>
> [...] For example: there is TeX (the typographic engine) and TeX
> (the programming language for that engine). And there has never been any
> conflict.

Quite the contrary.  The amount of confusion between TeX (engine)/TeX
(language)/TeX (distro)/TeX-aware text editor/LaTeX (whatever) among
novice/casual users has always been terrible.

Just my 2 cents,

-- 
Marcin Borkowski
http://mbork.pl



Re: A mobile clocking solution?

2021-11-27 Thread Marcin Borkowski


On 2021-11-27, at 22:42, Samuel Banya  wrote:

> Lol, okay. Well then, I tried to offer some advice. Good luck with MacOS.

Well, thanks - it was actually valuable.  Also - out of curiosity - what
gave you the impression I'm using MacOS???  Fun fact: I did once use an
iPad (a borrowed one) for half a day, and I found the experience
terrible enough to not come near anything Apple-related;-).

Best,
mbork


>
> Its better to keep Emacs uncaged :)
>
> On Sat, Nov 27, 2021, at 7:25 AM, Marcin Borkowski wrote:
>> 
>> On 2021-11-26, at 22:16, Samuel Banya  wrote:
>> 
>> > Hey Marcin,
>> >
>> > There are a few options that exist, so I'm going to drop a few ideas in 
>> > this email.
>> >
>> > *"Buy A Rooted Phone" Option:*
>> > Why not just get a rooted Android phone with Replicant on it from eBay in 
>> > the first place?
>> >
>> > Then, you can use Termux to ssh into a local or cloud VPS file server 
>> > where you're hosting your .org files. Most people even use Dropbox (or 
>> > SyncThing, whatever floats your boat).
>> >
>> > Worst case scenario, you can maybe just run a terminal version of Emacs on 
>> > the rooted Android phone (or even your current non-rooted phone), and 
>> > clock in like that.
>> 
>> Well, doesn't that have the same security issue I mentioned?
>> 
>> > If you're on iOS though... well... maybe its time to get out of the walled 
>> > garden?
>> 
>> Of course not.
>> 
>> > *"Just Use A Laptop" Option:*
>> > I'd say maybe just get a laptop, put some decent Linux distro on it, and 
>> > use Emacs on that instead.
>> 
>> Out of question.  I need this exactly for the times when I cannot use my 
>> laptop.
>> 
>> > Worst case scenario, you can maybe just run a terminal version of Emacs on 
>> > the rooted Android phone, and clock in like that.
>> >
>> > *Bash Script Approach:*
>> > The only other thing I could think of is to do this via an easy Bash 
>> > prompt to find the same files on the ssh machine. This might be 
>> > preposterous to those on the list that might want to use Elisp for 
>> > everything, but maybe its on a device where a Linux Bash terminal just is 
>> > present by default.
>> 
>> That /could/ be a solution.
>> 
>> > *"Just Log The Time Later" Approach:*
>> > You could always even just make org capture templates to estimate time 
>> > later too.
>> 
>> And I think this is the way to go.  Probably also use/write some very
>> simple time tracking app on the phone.
>> 
>> > *Summed Up:*
>> > The most sane approach in my opinion, is just use a computer that can 
>> > normally just use Emacs as-is. 
>> >
>> > Then again, this is coming from someone who respects the "Getting Things 
>> > Done" method a ton, but doesn't clock in every single personal task, 
>> > because I think its really unnecessary and tedious. I think this kind of 
>> > clocking ideas are better suited for work based todo lists if you're 
>> > trying to get things done for work or something.
>> 
>> I don't clock everything either, but there are some things that I do,
>> and that's why I want a reasonable mobile solution.
>> 
>> > I've seen the Android apps for Emacs Org Mode demo'd on YouTube, and it 
>> > looks clunky. Its nice for what it is, but yeah, I think Emacs overall is 
>> > just better suited for a laptop or desktop computer since you really need 
>> > to just use a keyboard to pull off most of the magic.
>> 
>> Of course.  I don't need Org editing etc. (well, maybe capture), just
>> the clocking.  That seems easy enough on mobile (UI-wise)..
>> 
>> > Good luck with this though,
>> 
>> Thanks!
>> 
>> -- 
>> Marcin Borkowski
>> http://mbork.pl
>> 


-- 
Marcin Borkowski
http://mbork.pl



Re: A mobile clocking solution?

2021-11-27 Thread Marcin Borkowski


On 2021-11-26, at 22:16, Samuel Banya  wrote:

> Hey Marcin,
>
> There are a few options that exist, so I'm going to drop a few ideas in this 
> email.
>
> *"Buy A Rooted Phone" Option:*
> Why not just get a rooted Android phone with Replicant on it from eBay in the 
> first place?
>
> Then, you can use Termux to ssh into a local or cloud VPS file server where 
> you're hosting your .org files. Most people even use Dropbox (or SyncThing, 
> whatever floats your boat).
>
> Worst case scenario, you can maybe just run a terminal version of Emacs on 
> the rooted Android phone (or even your current non-rooted phone), and clock 
> in like that.

Well, doesn't that have the same security issue I mentioned?

> If you're on iOS though... well... maybe its time to get out of the walled 
> garden?

Of course not.

> *"Just Use A Laptop" Option:*
> I'd say maybe just get a laptop, put some decent Linux distro on it, and use 
> Emacs on that instead.

Out of question.  I need this exactly for the times when I cannot use my laptop.

> Worst case scenario, you can maybe just run a terminal version of Emacs on 
> the rooted Android phone, and clock in like that.
>
> *Bash Script Approach:*
> The only other thing I could think of is to do this via an easy Bash prompt 
> to find the same files on the ssh machine. This might be preposterous to 
> those on the list that might want to use Elisp for everything, but maybe its 
> on a device where a Linux Bash terminal just is present by default.

That /could/ be a solution.

> *"Just Log The Time Later" Approach:*
> You could always even just make org capture templates to estimate time later 
> too.

And I think this is the way to go.  Probably also use/write some very
simple time tracking app on the phone.

> *Summed Up:*
> The most sane approach in my opinion, is just use a computer that can 
> normally just use Emacs as-is. 
>
> Then again, this is coming from someone who respects the "Getting Things 
> Done" method a ton, but doesn't clock in every single personal task, because 
> I think its really unnecessary and tedious. I think this kind of clocking 
> ideas are better suited for work based todo lists if you're trying to get 
> things done for work or something.

I don't clock everything either, but there are some things that I do,
and that's why I want a reasonable mobile solution.

> I've seen the Android apps for Emacs Org Mode demo'd on YouTube, and it looks 
> clunky. Its nice for what it is, but yeah, I think Emacs overall is just 
> better suited for a laptop or desktop computer since you really need to just 
> use a keyboard to pull off most of the magic.

Of course.  I don't need Org editing etc. (well, maybe capture), just
the clocking.  That seems easy enough on mobile (UI-wise)..

> Good luck with this though,

Thanks!

-- 
Marcin Borkowski
http://mbork.pl



Re: A mobile clocking solution?

2021-11-25 Thread Marcin Borkowski


On 2021-11-24, at 15:30, Daniel Baker  wrote:

> Oops.  I'm sorry, I forgot to include the link. That would be for orgzly.
>
> https://github.com/orgzly/orgzly-android/pull/691

Thanks!

Although, after some thinking, I'm a bit afraid of using this, for the
simple reason: I don't consider data on my phone "safe" (it's much
easier to lose a phone than a computer - or to have it stolen), so I'd
prefer not to put my Org files there...

I think I have an idea for a solution - but thanks anyway!

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: A mobile clocking solution?

2021-11-23 Thread Marcin Borkowski


On 2021-11-21, at 15:25, Daniel Baker  wrote:

> Hi Marcin,
>
> There's an open pull request on github that has a working implementation
> for clocking in and out. There's a few ui things to fix. I'm running that
> branch at the moment and it works quite well.

Thanks, but... which app are you talking about?

-- 
Marcin Borkowski
http://mbork.pl



A mobile clocking solution?

2021-11-21 Thread Marcin Borkowski
Hi all,

AFAIK, there are a few mobile Org-mode apps for Android (I know about
organice and Orgzly).  From a skim of their docs I think they don't
support clocking.  Is that correct?  If so, are there any mobile apps
supporting clocking on a phone?

TIA,

-- 
Marcin Borkowski
http://mbork.pl



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



  1   2   3   4   5   6   7   8   >