Re: org-log-note-clock-out ends action after note, forgetting to clock in to something

2022-03-17 Thread Ignacio Casso
> Anyone else duplicating this error would be useful to know.

I can't reproduce this bug in Emacs 27.2.

Please send some more information like your Emacs and Org versions and
your org related configuration. See
https://orgmode.org/manual/Feedback.html for an easy way to include
this information automatically and some more useful guidelines about how
to submit bug reports for org-mode.

> Let me know if there is somewhere else I should report this issue.

As far as I know this is the right place.



[PATCH] Fix for bug that makes the user have to answer the prompt more than once for resolving running clock after being idle

2022-03-17 Thread Ignacio Casso
Hello,

I have fixed the bug reported in
https://lists.gnu.org/archive/html/emacs-orgmode/2010-08/msg00188.html,
https://lists.gnu.org/archive/html/emacs-orgmode/2019-02/msg00333.html,
and
https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00127.html.

In the last of those threads (two emails) I explained in detail the bug and the
reason it happens. Here is the patch:

>From bb4c9e0836b039a496a033a002d97d7062bd8dc8 Mon Sep 17 00:00:00 2001
From: Ignacio 
Date: Thu, 17 Mar 2022 11:50:44 +0100
Subject: [PATCH] org-clock.el: resolve running clock after being idle only
 once

* lisp/org-clock.el (org-resolve-clocks-if-idle): Cancel timer
for `org-resolve-clocks-if-idle' while `org-clock-resolve' waits for
the user to answer the prompt.

After the user answered the prompt to resolve the running clock, the
pending scheduled calls to `org-resolve-clocks-if-idle' (one for each
minute it took the user to answer) were being executed immediately.
But after an old change in Emacs, the user answer does not reset the
idle timer anymore, so each of those calls thought that the user was
still idle and prompted them again, to the user had to answer the same
prompt again N times.  This commit fixes that bug.

TINYCHANGE
---
 lisp/org-clock.el | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 6f441c18e..83e6dd319 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1231,7 +1231,9 @@ so long."
 	   (org-clock-user-idle-start
 	(time-since org-clock-user-idle-seconds))
 	   (org-clock-resolving-clocks-due-to-idleness t))
-  (if (> org-clock-user-idle-seconds (* 60 org-clock-idle-time))
+  (when (> org-clock-user-idle-seconds (* 60 org-clock-idle-time))
+  (cancel-timer org-clock-idle-timer)
+  (setq org-clock-idle-timer nil)
 	  (org-clock-resolve
 	   (cons org-clock-marker
 		 org-clock-start-time)
@@ -1240,7 +1242,10 @@ so long."
 		 (/ (float-time
 			 (time-since org-clock-user-idle-start))
 			60)))
-	   org-clock-user-idle-start)
+	   org-clock-user-idle-start)
+  (when (and (org-clocking-p) (not org-clock-idle-timer))
+(setq org-clock-idle-timer
+	  (run-with-timer 60 60 #'org-resolve-clocks-if-idle)))
 
 (defvar org-clock-current-task nil "Task currently clocked in.")
 (defvar org-clock-out-time nil) ; store the time of the last clock-out
-- 
2.25.1



Re: Question About Low Level Issues To Fix

2022-03-17 Thread Max Nikulin

On 17/03/2022 00:32, Russell Adams wrote:

On Wed, Mar 16, 2022 at 01:07:48PM -0400, Samuel Banya wrote:

On a related note, I took a look at what's present, but was kind of
lost in terms of what to necessarily fix.

I saw the general TODO list present, but wasn't sure if there are
any low level issues that should be looked at.

Or should I primarily focus on what's been reported directly on the
Source Hut repo itself?


I believe the main git is on GNU Savannah, however many of the devs
use Sourcehut.


I guess, Samuel is asking about worg.

Samuel, I think, the core developers and maintainers of Org are 
currently rather busy with activities unrelated to Org, so it is 
unlikely that you will get some list of tasks.


On this mail list there were at least two or three requests during last 
couple of weeks to update some outdated links.


Perhaps you faced some inaccuracies in the docs when you were trying 
some new features and you have got more experience since that time. 
Fixing them may improve experience of new users.





Re: org-log-note-clock-out ends action after note, forgetting to clock in to something

2022-03-17 Thread Tory S. Anderson
Ignacio Casso  writes:

>> Anyone else duplicating this error would be useful to know.
>
> I can't reproduce this bug in Emacs 27.2.

This is good news: it means I can probably proceed with bisection and debugging 
after updating to see if the issue persists. Thanks!

I'm on orgmode 9.4.6, with emacs 28.0.50.



Re: Problem with org-babel and geiser

2022-03-17 Thread Rudolf Adamkovič
Bob Heffernan  writes:

> I did as you described and the patched version of ob-scheme.el *does*
> seem to solve the problem.

Today, I needed to use Scheme with Org (9.5.2-24-g668205), and I found
that the #+RESULTS: always come back empty.  Oh, well!  I use Guile and
have everything configured correctly.  Has anyone merged the patch
discussed in this thread into Org?

Thank you.

Rudy
-- 
"Thinking is a momentary dismissal of irrelevancies."
-- Richard Buckminster Fuller, 1969

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



Re: org-log-note-clock-out ends action after note, forgetting to clock in to something

2022-03-17 Thread Ignacio Casso


"Tory S. Anderson"  writes:

> Ignacio Casso  writes:
>
>>> Anyone else duplicating this error would be useful to know.
>>
>> I can't reproduce this bug in Emacs 27.2.
>
> This is good news: it means I can probably proceed with bisection and 
> debugging after updating to see if the issue persists. Thanks!
>
> I'm on orgmode 9.4.6, with emacs 28.0.50.

On second though I realize I should have told you my org version, not
Emacs. It's 9.5.2. And I have checked it in my org built-in version,
9.4.4, and there I can reproduce the bug, so it's not your
configuration's fault and it was a bug that has already been fixed. I
suggest you upgrade to a later org version to fix the issue.



Re: org-log-note-clock-out ends action after note, forgetting to clock in to something

2022-03-17 Thread Tory S. Anderson
Ignacio Casso  writes:

>>> I can't reproduce this bug in Emacs 27.2.
>>
>> This is good news: it means I can probably proceed with bisection and 
>> debugging after updating to see if the issue persists. Thanks!
>>
>> I'm on orgmode 9.4.6, with emacs 28.0.50.
>
> On second though I realize I should have told you my org version, not
> Emacs. It's 9.5.2. And I have checked it in my org built-in version,
> 9.4.4, and there I can reproduce the bug, so it's not your
> configuration's fault and it was a bug that has already been fixed. I
> suggest you upgrade to a later org version to fix the issue.

Excellent news! That saves me hours of bisection! (as long as those hours 
aren't spent fixing things after an orgmode upgrade)
- Tory



Org and multimedia (tips?)

2022-03-17 Thread Juan Manuel Macías
Hi all,

I've been trying for a while to use Org also to store and org-anize the
data of my music and video files, so that I can conveniently access them
via helm-org-ql and play them using EMMS. I was wondering if anyone is
trying this too, and thought maybe it would be nice to share tips and
hacks.

What I do is quite simple and rudimentary. For example, I have all my
music files stored on a hard drive on my Raspberry. As a media server I
use GNUMP3d, which is pretty clunky and outdated, but it works fine and
is very easy for me to administer. GNUMP3d serves a local web page with
the list of titles and artists. I convert that web to an Org node using
org-web-tools (https://github.com/alphapapa/org-web-tools), and some
extra elisp to clean up inconsistencies and format everything so that
each artist/title is a sub-tree. The process is not quite fine-tuned: I
have to see how labels and properties could be added automatically:
music gender, year, etc. I have also defined a new type of link to be
able to play the content (*.m3u) via EMMS[1], and I have also added a new
action to helm-org-ql. Finally, in another section I am also storing
links to radio stations, TV, single songs (captured with org-capture),
etc. I have also found 'sacad' useful for downloading the cover art
(https://github.com/desbma/sacad).

This is my system for organizing my media files in Org. If anyone is
interested, I can expand on specific details. And here, a couple of
screenshots:

https://i.imgur.com/NKybgPV.png

https://i.imgur.com/DtfoyZl.jpg

[1]
#+begin_src emacs-lisp
  (org-link-set-parameters
   "url-media"
   :follow (lambda (path) (emms-play-url path))
   :face '(:foreground "chocolate" :weight bold :underline t))
#+end_src

Best regards,

Juan Manuel



[BUG] Error when using mouse to set TODO state [9.5.2 (9.5.2-g91681f @ /home/garyo/.emacs.d/straight/build/org/)]

2022-03-17 Thread Gary Oberbrunner
I'm using org and org-roam. I tried to use the mouse-3 menu to toggle the
state of a TODO item, but I get this error:


Debugger entered--Lisp error: (void-variable org-todo)
  (funcall org-todo "DONE")
  menu-function-79()
  funcall-interactively(menu-function-79)
  popup-menu((nil ["TODO" (funcall org-todo "TODO") :style toggle :selected
t] ["WAITING" (funcall org-todo "WAITING") :style toggle :selected nil]
["DONE" (funcall org-todo "DONE") :style toggle :selected nil] ["CANCELLED"
(funcall org-todo "CANCELLED") :style toggle :selected nil] "--" ["Check
TODOs" org-show-todo-tree t] ["List all TODO keywords" org-todo-list t]
[#("List only TODO" 10 14 (fontified t face (org-todo org-level-1)))
(org-todo-list (match-string 0)) t]))
  org-mouse-context-menu((mouse-3 (#
1735 (42 . 240) 88049612 nil 1735 (3 . 13) nil (9 . 12) (11 . 22
  org-mouse-show-context-menu((mouse-3 (# 1735 (42 . 240) 88049612 nil 1735 (3 . 13) nil
(9 . 12) (11 . 22))) nil)
  funcall-interactively(org-mouse-show-context-menu (mouse-3 (# 1735 (42 . 240) 88049612 nil 1735 (3 . 13)
nil (9 . 12) (11 . 22))) nil)
  call-interactively(org-mouse-show-context-menu nil nil)
  command-execute(org-mouse-show-context-menu)
---

Manually calling (funcall org-todo "DONE") works fine with point on that
todo item. "org-todo" is an interactive native-compiled Lisp function, so I
don't know why the error says "void-variable" -- why is its variable value
being used rather than its function value?
Toggling the TODO state with C-c C-t d works fine, no error. Just the
mouse-3 menu.

To repro, use this startup file (emacs -Q -l ~/.emacs-test), create foo.org
with a single TODO item, right-click and select DONE.

 .emacs-test 
;;; Set up package system -- straight.el
(defvar bootstrap-version)
(or (boundp 'native-comp-deferred-compilation-deny-list)
(setq native-comp-deferred-compilation-deny-list '()))

(let ((bootstrap-file
   (expand-file-name "straight/repos/straight.el/bootstrap.el"
user-emacs-directory))
  (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
 "
https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el";
 'silent 'inhibit-cookies)
  (goto-char (point-max))
  (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'use-package)
(defvar straight-use-package-by-default)
(setq straight-use-package-by-default t) ; make use-package use straight

(use-package org
 :config
 (require 'org-mouse)
)
-- cut ---

System config:
WSL2 on Windows 11, Ubuntu.
Emacs compiled locally Jan 24 2022, with native compilation enabled.

--

Emacs  : GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
3.24.20, cairo version 1.16.0)
 of 2022-01-24
Package: Org mode version 9.5.2 (9.5.2-g91681f @
/home/garyo/.emacs.d/straight/build/org/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-directory "~/Documents/synced/RoamNotes"
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-tag-faces '(("@work" . "#0066ff") ("@home" . "#bb") ("volunteer" .
"#005500"))
 org-log-done 'time
 org-agenda-custom-commands '(("w" "At work" ((agenda "" ((org-agenda-span
2))) (tags-todo "+PRIORITY=\"A\"") (tags-todo "@work"))
   ((org-agenda-compact-blocks t)))
  ("h" "At home" ((agenda "" ((org-agenda-span
4))) (tags-todo "+PRIORITY=\"A\"") (tags-todo "@home"))
   ((org-agenda-compact-blocks t)))
  ("i" "Inbox" ((tags-todo
"+CATEGORY=\"Inbox\"")))
  ("u" "Uncategorized" ((tags-todo "-{.*}"
((org-agenda-overriding-header "Uncategorized TODOs")
  ("U" "Unscheduled"
   ((todo ""
 ((org-agenda-overriding-header
"Unscheduled TODOs")
  (org-agenda-skip-function
'(org-agenda-skip-entry-if 'scheduled)))
 )
)
   )
  )
 org-startup-folded nil
 org-agenda-skip-scheduled-if-done t
 org-agenda-files '("~/Documents/synced/RoamNotes")
 org-capture-templates '(("t" "Todo [inbox]" entry (file+headline "inbox.org"
"Tasks") "* TODO %i%?\n  %U" :prepend t)
 ("." "Today" entry (file+headline "inbox.org"
"Tasks") "* TODO %^{Task}\nSCHEDULED: %t\n"
  :immediate-finish t)
 ("s" "Scheduled TODO" entry (file+headline "
inbox.org" "Tasks") "* TODO %? %^G \nSCHEDULED: %^t\n  %U")
 ("d" "Deadline" entry (file+headline "inbox.org"
"Tasks") "* TODO %? %^G \n  DEADLINE: %^t" :empty-lin

Patch links babel graphviz-dot

2022-03-17 Thread General discussions about Org-mode.
Patch to update some links.

Greetings,

Nicolas

>From 0f336a1e225a13be45109d247d00474a0310e3dd Mon Sep 17 00:00:00 2001
From: Nicolas Graves 
Date: Thu, 17 Mar 2022 14:30:22 +0100
Subject: [PATCH] updating links to graphviz documentation.

---
 org-contrib/babel/languages/ob-doc-dot.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-contrib/babel/languages/ob-doc-dot.org b/org-contrib/babel/languages/ob-doc-dot.org
index f056e4d8..20775c75 100644
--- a/org-contrib/babel/languages/ob-doc-dot.org
+++ b/org-contrib/babel/languages/ob-doc-dot.org
@@ -88,7 +88,7 @@ There are two =dot= specific header arguments that can be used to
- =:cmdline= :: the default sets the =dot= flag =-T= to the
extension of the output file in order to indicate
the output format. =Graphviz= recognizes three
-   dozen [[http://www.graphviz.org/content/output-formats][output formats]]. [[http://www.graphviz.org/content/command-line-invocation][Other flags]] that can be set
+   dozen [[http://www.graphviz.org/docs/outputs/][output formats]]. [[http://www.graphviz.org/doc/info/command.html][Other flags]] that can be set
with =:cmdline= control default graph, node, and
edge attributes, among other functionality.
 
-- 
2.34.0