emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Agenda clockcheck: org-duration-to-minutes: Wrong type argument: stringp [9.0.5 (release_9.0.5-318-gb1353c @ /tmp/emacs/org-mode/lisp\ /)]
@ 2017-02-23  3:05 Dale
  2017-02-23 11:54 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Dale @ 2017-02-23  3:05 UTC (permalink / raw)
  To: emacs-orgmode

Hi!  I think org-mode from master currently has a bug in agenda's
clockcheck mode.  Steps to reproduce:

1. Start emacs -Q and load org-mode master (b1353cb6f83)

2. Open a empty org-mode buffer, e.g.: C-x C-f test.org RET

3. M-x org-agenda RET

4. Hit "a" for "Agenda for current day or week"

5. Hit "v" then "c" to switch to clockcheck view

Expected results: clockcheck view is engaged (albeit empty given the
empty org-mode file)

Observed results: I receive the following error:

    org-duration-to-minutes: Wrong type argument: stringp, 0

Due to this error, clockcheck mode does not seem to activate.

Emacs  : GNU Emacs 25.1.1 (x86_64-apple-darwin15.6.0)
 of 2017-01-30
Package: Org mode version 9.0.5 (release_9.0.5-318-gb1353c @
/tmp/emacs/org-mode/lisp/)

Other information:

I suspect this is happening as of the recent switch to using the
org-duration library (7e8cf5f4c20), which replaced some/all uses of
org-hh:mm-string-to-minutes with org-duration-to-minutes.
org-hh:mm-string-to-minutes accepted an integer as its argument
(despite its name):

    (cond
     ((integerp s) s)
     ...

In contrast, org-duration-to-minutes only expects a string as its
argument.  The "Wrong type argument" seems to be coming from its first
string-match-p call.

org-agenda-show-clocking-issues will potentially call
org-duration-to-minutes with the integer 0 as its argument:

    (mintime (org-duration-to-minutes
              (or (plist-get pl :min-duration) 0)))

The default value for org-agenda-clock-consistency-checks also
specifies :min-duration 0; that is, an integer rather than a string.

I cannot say whether org-duration-string should accept a number, as
org-hh:mm-string-to-minutes did, or instead whether org-agenda.el
should be changed to always pass it a string.

Kind regards,
Dale

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-23 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-23  3:05 Bug: Agenda clockcheck: org-duration-to-minutes: Wrong type argument: stringp [9.0.5 (release_9.0.5-318-gb1353c @ /tmp/emacs/org-mode/lisp\ /)] Dale
2017-02-23 11:54 ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).