pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

pulse headline of the org mode entry you just clocked into

Open dandrake opened this issue 1 year ago • 3 comments

When you use C-c C-x C-i to clock into the current org entry, it would be nice to pulse the headline for that entry.

You could add the following suggestion to your documentation:

Pulsing the headline of the org mode entry you just clocked into: if you create a function that moves point inside a save-excursion and then calls pulsar-pulse-line, you can effectively pulse any other line. By calling that function from the org-clock-in-hook, you will pulse the headline line of the entry you just clocked into.

(The corresponding thing, pulsing a line when clocking out of a task, could be more complicated, since you can clock out of an entry/task that you are not currently in, or even that's in a completely different buffer.)

You can do this by defining this function:

(defun pulse-current-org-heading ()
  "Pulse the line of the current org heading.
Not sure if this can/should include some kind of `org-reveal' functionality."
  (interactive)
  (save-excursion
    (org-back-to-heading)
    (pulsar-pulse-line)))

and adding that from org-clock-in-hook .

(Naturally you should feel free to edit that as you see fit.)

dandrake avatar Nov 18 '23 21:11 dandrake

Hello Dan!

From: Dan Drake @.***> Date: Sat, 18 Nov 2023 13:11:20 -0800

When you use C-c C-x C-i to clock into the current org entry, it would be nice to pulse the headline for that entry.

Maybe we can add the relevant functions to the 'pulsar-pulse-functions'? Those would be 'org-clock-in' and 'org-clock-out'

All the best, Protesilaos (or simply "Prot")

-- Protesilaos Stavrou https://protesilaos.com

protesilaos avatar Dec 16 '23 09:12 protesilaos

From: Dan Drake @.***> Date: Sun, 17 Dec 2023 05:28:25 -0800

Adding the clock-in and clock-out functions to pulsar-pulse-functions seems like a good idea.

I will note that, by adding org-clock-in to that variable, if you clock into an entry while point is in the middle of the entry, then the current line gets pulsed, not the headline.

Oh, this is good to know.

I kinda like pulsing the entry headline, but the simplicity of just adding the org-clock-{in,out} functions to pulsar-pulse-functions seems like one nice approach.

Hopefully there is Org function that moves the point back to the heading. Then it should be added to the 'pulsar-pulse-functions'.

I have not tried this, but a quick look at the source code suggests that the function may be 'org-back-to-heading'.

-- Protesilaos Stavrou https://protesilaos.com

protesilaos avatar Dec 22 '23 08:12 protesilaos