Re: [O] tsia-up sorting strategy sorts agenda by date and ignores time. How can I change that?

2017-03-29 Thread Arkady Grudzinsky
On Wed, Mar 22 2017, Arkady Grudzinsky wrote:

> On Tue, Mar 21 2017, Matt Lundin wrote:
>
>> You could use something like this and then add user-defined-up or
>> user-defined-down where desired in org-agenda-sorting-strategy:
>>
>> (defun my-sort-by-inactive-timestamp-incl-time (a b)
>>   (let* ((ma (get-text-property 1 'org-marker a))
>>  (mb (get-text-property 1 'org-marker b))
>>  (tsa (with-current-buffer (marker-buffer ma)
>>  (org-entry-get (marker-position ma) "TIMESTAMP_IA")))
>>  (tsb (with-current-buffer (marker-buffer mb)
>>  (org-entry-get (marker-position mb) "TIMESTAMP_IA")))
>>  (seca (if tsa (org-time-string-to-seconds tsa) 0))
>>  (secb (if tsb (org-time-string-to-seconds tsb) 0)))
>> (cond ((> seca secb) 1)
>>   ((> secb seca) -1)
>>   (t nil
>>
>> (setq org-agenda-cmp-user-defined 'my-sort-by-inactive-timestamp-incl-time)
>>
>> I imagine there are ways to do this more elegantly (e.g., by iterating
>> over a and b), but this gets the job done for me.
>
> This works.  Awesome!  Thanks.  

When this user-defined-up is set in agenda view (C-c a a), the
agenda view throws an error message.

,
| set-buffer: Wrong type argument: markerp, nil
`

It works in the todo list views, though, which is good enough for me.

Thanks again.  Just wanted to mention this for the record.

-- 
Arkady



Re: [O] tsia-up sorting strategy sorts agenda by date and ignores time. How can I change that?

2017-03-22 Thread Arkady Grudzinsky
On Tue, Mar 21 2017, Matt Lundin wrote:

> You could use something like this and then add user-defined-up or
> user-defined-down where desired in org-agenda-sorting-strategy:
>
> (defun my-sort-by-inactive-timestamp-incl-time (a b)
>   (let* ((ma (get-text-property 1 'org-marker a))
>  (mb (get-text-property 1 'org-marker b))
>  (tsa (with-current-buffer (marker-buffer ma)
>  (org-entry-get (marker-position ma) "TIMESTAMP_IA")))
>  (tsb (with-current-buffer (marker-buffer mb)
>  (org-entry-get (marker-position mb) "TIMESTAMP_IA")))
>  (seca (if tsa (org-time-string-to-seconds tsa) 0))
>  (secb (if tsb (org-time-string-to-seconds tsb) 0)))
> (cond ((> seca secb) 1)
>   ((> secb seca) -1)
>   (t nil
>
> (setq org-agenda-cmp-user-defined 'my-sort-by-inactive-timestamp-incl-time)
>
> I imagine there are ways to do this more elegantly (e.g., by iterating
> over a and b), but this gets the job done for me.

This works.  Awesome!  Thanks.  

-- 
Arkady




[O] tsia-up sorting strategy sorts agenda by date and ignores time. How can I change that?

2017-03-20 Thread Arkady Grudzinsky
Hi,

I'd like to sort my tasks in agenda by inactive creation
timestamp which includes the time portion.  I have found that
tsia-up strategy ignores the time portion of the timestamp.  Is
there a way to take time into account?

Thanks.

-- 
Arkady




Re: [O] org-mode 9.0 LaTeX export figure labels do not work

2016-11-23 Thread Arkady Grudzinsky
On Wed, Nov 23 2016, Arkady Grudzinsky wrote:

> org-mode 9.0 seems to generate random figure labels instead of
> the ones specified in #+NAME:, so the cross-references do not work.

Figured out that the LaTeX reference syntax does not work
anymore.  But the org-mode reference [[fig:tcprofile]] does.  OK.
Makes sense.

>
> .org source:
> ,
> | Temperature profile is shown in Fig. \ref{fig:tcprofile}.
> | 
> | #+NAME: fig:tcprofile
> | #+CAPTION: Temperature Cycling Profile
> | [[./tc_profile.png]]
> `
>
> .tex output:
> ,
> | Temperature profile is shown in Fig. \ref{fig:tcprofile}.
> | 
> | \begin{figure}[htbp]
> | \centering
> | \includegraphics[width=.9\linewidth]{./tc_profile.png}
> | \caption{\label{fig:orgceb3fa6}
> | Temperature Cycling Profile}
> | \end{figure}
> `
>
> PDF output:
>
> ,
> | Temperature profile is shown in Fig. ??.
> `
>
> Is this a new feature or a bug?

-- 
Arkady




[O] org-mode 9.0 LaTeX export figure labels do not work

2016-11-23 Thread Arkady Grudzinsky

org-mode 9.0 seems to generate random figure labels instead of
the ones specified in #+NAME:, so the cross-references do not work.

.org source:
,
| Temperature profile is shown in Fig. \ref{fig:tcprofile}.
| 
| #+NAME: fig:tcprofile
| #+CAPTION: Temperature Cycling Profile
| [[./tc_profile.png]]
`

.tex output:
,
| Temperature profile is shown in Fig. \ref{fig:tcprofile}.
| 
| \begin{figure}[htbp]
| \centering
| \includegraphics[width=.9\linewidth]{./tc_profile.png}
| \caption{\label{fig:orgceb3fa6}
| Temperature Cycling Profile}
| \end{figure}
`

PDF output:

,
| Temperature profile is shown in Fig. ??.
`

Is this a new feature or a bug?


-- 
Arkady




Re: [O] Repeating tasks with scheduled time

2016-10-05 Thread Arkady Grudzinsky
On Wed, Oct 05 2016, Nicolas Goaziou wrote:

> Hello,
>
> Arkady Grudzinsky  writes:
>
>> On Tue, Oct 04 2016, Arkady Grudzinsky wrote:
>>
>>> Say, I have this TODO item which needs to be repeated every
>>> evening after 20:00 and if it is not marked as DONE for several
>>> days, I want it to be moved to the NEAREST 20:00 in the future,
>>> i.e. to 20:00 TODAY if I mark it at noon.  I thought, this would
>>> accomplish the goal:
>>>
>>> * TODO Load and run the dishwasher
>>>   SCHEDULED: <2016-10-03 Mon 20:00 .+1d>
>>
>> Sorry, the correct syntax would be 
>>
>> * TODO Load and run the dishwasher
>>   SCHEDULED: <2016-10-03 Mon 20:00 ++1d>
>>
>> It still moves the scheduled time to the next day instead of
>> 20:00 today.
>>
>>
>>>
>>> Instead, marking this task as completed today at noon moves the
>>> schedule to 20:00 TOMORROW instead of 20:00 TODAY although the
>>> nearest 20:00 in the future is, technically, 20:00 TODAY.
>>>
>>> Is there a way to change this behavior?
>
> IIRC this was fixed in development version, i.e., Org 9.0.

Thanks.  I have 8.2 installed.  Do you know when 9.0 will be
released?

-- 
Arkady




Re: [O] Repeating tasks with scheduled time

2016-10-04 Thread Arkady Grudzinsky
On Tue, Oct 04 2016, Arkady Grudzinsky wrote:

> Say, I have this TODO item which needs to be repeated every
> evening after 20:00 and if it is not marked as DONE for several
> days, I want it to be moved to the NEAREST 20:00 in the future,
> i.e. to 20:00 TODAY if I mark it at noon.  I thought, this would
> accomplish the goal:
>
> * TODO Load and run the dishwasher
>   SCHEDULED: <2016-10-03 Mon 20:00 .+1d>

Sorry, the correct syntax would be 

* TODO Load and run the dishwasher
  SCHEDULED: <2016-10-03 Mon 20:00 ++1d>

It still moves the scheduled time to the next day instead of
20:00 today.


>
> Instead, marking this task as completed today at noon moves the
> schedule to 20:00 TOMORROW instead of 20:00 TODAY although the
> nearest 20:00 in the future is, technically, 20:00 TODAY.
>
> Is there a way to change this behavior?

-- 
Arkady




[O] Repeating tasks with scheduled time

2016-10-04 Thread Arkady Grudzinsky

Say, I have this TODO item which needs to be repeated every
evening after 20:00 and if it is not marked as DONE for several
days, I want it to be moved to the NEAREST 20:00 in the future,
i.e. to 20:00 TODAY if I mark it at noon.  I thought, this would
accomplish the goal:

* TODO Load and run the dishwasher
  SCHEDULED: <2016-10-03 Mon 20:00 .+1d>

Instead, marking this task as completed today at noon moves the
schedule to 20:00 TOMORROW instead of 20:00 TODAY although the
nearest 20:00 in the future is, technically, 20:00 TODAY.

Is there a way to change this behavior?

-- 
Arkady