Re: [O] Inserting todo time range

2019-06-26 Thread Raimund Kohl-Füchsle
Yepp, that is how I do it, too. I just thought there were something more 
convenient.

Thank you anyway :-)

⁣Gesendet mit Blue ​

Am 27. Juni 2019, 00:53, um 00:53, Kyle Meyer  schrieb:
>Raimund Kohl-Füchsle  writes:
>
>> I do have a recurring task Mo-Fri, but not at weekends.
>>
>> I searched the manual and it offers a time range - like
>>
>> ** Test Time range
>>
>>      <2004-08-23 Mon>--<2004-08-26 Thu>
>>
>> But, of course, this doesn't mark a recurring task.
>>
>> If instead I would use
>>
>> ** TODO Test Time range
>>
>>      <2004-08-23 Mon>--<2004-08-26 Thu>
>>
>> then this for org-mode would just be one todo; if I mark it done on
>Mon
>> all other days are marked as done, too.
>>
>> So how would I schedule a daily TODO only, say, this week from Mo -
>Fr?
>
>The way I handle this, which isn't particularly elegant, is to just
>have
>a heading for each day of interest.  So, in your case, something like
>
>  ** TODO task (Mon)
>  SCHEDULED: <2019-07-01 Mon ++1w>
>
>  ** TODO task (Tue)
>  SCHEDULED: <2019-07-02 Tue ++1w>
>
>  [...]
>
>  ** TODO task (Fri)
>  SCHEDULED: <2019-07-05 Fri ++1w>
>
>--
>Kyle


[O] org-scheduled-time-hour-regexp doesn't capture split repeats used by habit

2019-06-26 Thread Damian
The ':scheduled*' value for org-agenda-entry-types uses 
org-scheduled-time-hour-regexp to match related entries. The current 
regexp doesn't match entries with split repeats like those used by 
habits- for example:   'SCHEDULED: <2019-06-25 Tue 20:30 .+1d/2d>'. 
Because those entries show up in the agenda with a timestamp I believe 
they should be caught by the regexp.


org.el:
 (defconst org-scheduled-time-hour-regexp
  (concat "\\<" org-scheduled-string
  " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9+:hdwmy 
\t.-]*\\)>")
  "Matches the SCHEDULED keyword together with a time-and-hour 
stamp.")


Fix?
   (defconst org-scheduled-time-hour-regexp
  (concat "\\<" org-scheduled-string
  " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9+:hdwmy 
\t./-]*\\)>")
  "Matches the SCHEDULED keyword together with a time-and-hour 
stamp.")


Thanks,
-Damian




Re: [O] Inserting todo time range

2019-06-26 Thread Kyle Meyer
Raimund Kohl-Füchsle  writes:

> I do have a recurring task Mo-Fri, but not at weekends.
>
> I searched the manual and it offers a time range - like
>
> ** Test Time range
>
>      <2004-08-23 Mon>--<2004-08-26 Thu>
>
> But, of course, this doesn't mark a recurring task.
>
> If instead I would use
>
> ** TODO Test Time range
>
>      <2004-08-23 Mon>--<2004-08-26 Thu>
>
> then this for org-mode would just be one todo; if I mark it done on Mon 
> all other days are marked as done, too.
>
> So how would I schedule a daily TODO only, say, this week from Mo - Fr?

The way I handle this, which isn't particularly elegant, is to just have
a heading for each day of interest.  So, in your case, something like

  ** TODO task (Mon)
  SCHEDULED: <2019-07-01 Mon ++1w>
  
  ** TODO task (Tue)
  SCHEDULED: <2019-07-02 Tue ++1w>
  
  [...]

  ** TODO task (Fri)
  SCHEDULED: <2019-07-05 Fri ++1w>

-- 
Kyle



Re: [O] [Proposal] Source Blocks with Post-Extensions

2019-06-26 Thread Martin Alsinet
Dmitrii,

I use a different approach, where I tangle the source into files in modules
and then I import those modules from other blocks.
This allows me to organize my document with different sections for the code
and its tests, which then get exported into their corresponding files.


* Square Function

This function receives a number and returns its square

#+BEGIN_SRC python :tangle ./utils/math.py :mkdirp yes
def square(x):
return x * x
#+END_SRC

** __init__.py (module setup)

#+begin_src python :tangle ./utils/__init__.py :mkdirp yes
from utils.math import square

#+end_src

** Test cases

1. The square of five should be 25
2. The square of zero should be 0
3. The square of a negative number should be positive

#+BEGIN_SRC python :tangle ./utils/test_square.py :mkdirp yes
from utils.math import square

def test_square_of_five():
assert square(5) == 25

def test_square_of_zero():
assert square(0) == 0

def test_square_of_negative():
assert square(-5) > 0
#+END_SRC

*** Run tests

#+begin_src sh :results output raw
pytest ./utils
#+end_src

#+RESULTS:
= test session starts
==
platform linux -- Python 3.7.3, pytest-4.6.3, py-1.8.0, pluggy-0.12.0
rootdir: /app
collected 3 items

utils/test_square.py ...
[100%]

=== 3 passed in 0.08 seconds
===






On Wed, Apr 24, 2019 at 2:19 PM Dmitrii Korobeinikov 
wrote:

> Sorry for not answering these two days.
>
> You are right, that's an option.
> But I just don't think that's the best possible one - for usability.
>
> Introducing this would imply architectural decisions, so it might not be
> immediately clear if it's right or not.
> Especially that the improvement might not seem that big.
> So, I understand that.
>
> I have proposed buffer lenses today and they seem like something that can
> solve the issue from the user side. Hopefully they will get some traction.
>
> пн, 22 апр. 2019 г. в 23:31, Berry, Charles :
>
>>
>>
>> > On Apr 22, 2019, at 10:15 AM, Dmitrii Korobeinikov 
>> wrote:
>> >
>> > Thank you!
>> > That's a handy technique and it does help.
>> > As I understand, there's no way to extend that to multiple lines?
>>
>> AFAICS, no there is no way to split the :epilogue arg to multiple lines.
>>
>> Of course, you can always follow a src block that provides a function
>> with another src block that imports the code via noweb and then tests the
>> function with as many lines of code as you need.
>>
>> Chuck
>>
>>
>>
>>


Re: [O] Insert time in Org-mode

2019-06-26 Thread Tim Cross


Marcin Borkowski  writes:

> 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'.
>

It is from a separate package called bind-key that you can install from
MELPA.

The excellent 'use-package' package uses it as a convenience method to
bind keys in use-pacakge definition blocks.

> 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'.
>

Yep, exactly my first thoughts when I saw the example. I use to have
something similar, but now my capture templates and 'Journal' option
take care of all of that, plus other useful details - like the
place/buffer/mode you were in when you took the note etc. 


-- 
Tim Cross



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] Insert time in Org-mode

2019-06-26 Thread Daniele Nicolodi
On 25/06/2019 22:54, Spenser Truex wrote:
> "Fraga, Eric"  writes:
> 
>> On Tuesday, 25 Jun 2019 at 18:41, gmx wrote:
>>> How to insert the current time? 
>>
>> Easiest immediate way is to insert an inactive time stamp by C-u C-c !
>> RET.
> 
> Robert Pluim  writes:
> 
>> C-u M-x org-time-stamp
>>
>> will prompt for a date and insert it along with the current time (I
>> bind org-time-stamp to "C-c ." for convenience)
>>
> 
> Strange, my system does not insert the current time, only the date. I
> have to insert the time manually. Same for inactive and active stamps.
> I'm on the latest master versions.

For it to insert the time you need a prefix argument (C-u) to
org-time-stamp, so it should be "C-u C-c ." to add an active time-stamp
and "C-u C-c !" for an inactive one.

Cheers,
Dan



[O] Inserting todo time range

2019-06-26 Thread Raimund Kohl-Füchsle

I do have a recurring task Mo-Fri, but not at weekends.

I searched the manual and it offers a time range - like

   ** Test Time range

    <2004-08-23 Mon>--<2004-08-26 Thu>

But, of course, this doesn't mark a recurring task.

If instead I would use

   ** TODO Test Time range

    <2004-08-23 Mon>--<2004-08-26 Thu>

then this for org-mode would just be one todo; if I mark it done on Mon 
all other days are marked as done, too.


So how would I schedule a daily TODO only, say, this week from Mo - Fr?

ray



[O] noweb strip-export

2019-06-26 Thread Thomas S. Dye

Aloha all,

The noweb strip-export setting leaves empty lines in the export.

I have this ecm:

 #+name: foo
 #+begin_src elisp
 (+ 1 1)
 #+end_src

 #+name: bar
 #+header: :noweb strip-export
 #+begin_src elisp
 <>
 (+ 2 2)
 #+end_src

LaTeX export renders this:

 \begin{minted}[fontsize=\footnotesize]{elisp}
 (+ 1 1)
 \end{minted}

 \begin{minted}[fontsize=\footnotesize]{elisp}

 (+ 2 2)
 \end{minted}

Note the blank line before (+ 2 2).

I'd like this LaTeX output:

 \begin{minted}[fontsize=\footnotesize]{elisp}
 (+ 1 1)
 \end{minted}

 \begin{minted}[fontsize=\footnotesize]{elisp}
 (+ 2 2)
 \end{minted}

Is it possible?

All the best,
Tom

--
Thomas S. Dye
http://tsdye.online/tsdye



Re: [O] Insert time in Org-mode

2019-06-26 Thread Russell Adams
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.

--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: [O] Insert time in Org-mode

2019-06-26 Thread Spenser Truex
"Fraga, Eric"  writes:

> On Tuesday, 25 Jun 2019 at 18:41, gmx wrote:
>> How to insert the current time? 
>
> Easiest immediate way is to insert an inactive time stamp by C-u C-c !
> RET.

Robert Pluim  writes:

> C-u M-x org-time-stamp
>
> will prompt for a date and insert it along with the current time (I
> bind org-time-stamp to "C-c ." for convenience)
>

Strange, my system does not insert the current time, only the date. I
have to insert the time manually. Same for inactive and active stamps.
I'm on the latest master versions.

-- 
Spenser Truex
use...@spensertruex.com
https://spensertruex.com/
San Francisco, USA




[O] Exporting to ODT with links to radio targets

2019-06-26 Thread Fraga, Eric
Hello all,

I need to share a document I have been writing in org which I would
normally export to PDF (via LaTeX, and which works very well).  To
share, I am exporting to ODT.  In general, the export is good enough for
my collaborator to make changes to the text (with track changes enabled
in whatever word processor he uses).  The exception is that links to
radio targets get exported to look like

  "some text OrgXref.org7b3090d more text" 

where the Orgxxx is where I expected the text which would link to the
radio target.  I hope I am making sense...

Is there an easy way to tell org to simply output the radio link text?

I have written an export filter to remove the extraneous XML stuff
around the text but this seems like overkill so I wonder if I missed
something simple.  No worries if not!

Many thanks.

PS - radio targets are brilliant for long documents without needing to
 create a full index.
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-379-g1b74ae