Questions tagged [idle-timer]

19 questions
11
votes
3 answers

Make use of an empty echo area to display information

The echo area is empty most of the time, which makes me think that I could use it to display some information. For example, org-clock displays the current task, the remaining time and the total elapsed time on the modeline. This information is not…
T. Verron
  • 4,233
  • 1
  • 22
  • 55
7
votes
2 answers

Looking for something like a `first-keypress-in-a-while-hook`

Suppose that I have an Emacs session running, and that I step away from my computer for, say, 20 minutes. Upon returning to my Emacs session, at some point I will press some key while the Emacs window has the focus. This would be an example of the…
kjo
  • 3,145
  • 14
  • 42
6
votes
4 answers

Buffer local idle-timer

I would like to use an idle timer that is local to the current buffer in one of my packages. However, I can't seem to find out how. How can I create (or fake) the behavior of a buffer local idle timer? Is the only way to call a function that checks…
PythonNut
  • 10,243
  • 2
  • 29
  • 75
4
votes
1 answer

How can I test an idle timer with ERT?

Say I have a function that is called on an idle timer: (defun tmp:create () (mkdir "test")) (run-with-idle-time 3 nil #'tmp:create) How can I test that this function works? Using something like (ert-deftest async () "" (should-not (file-exists-p…
Sean Allred
  • 6,861
  • 16
  • 85
3
votes
1 answer

force-window-update vs redisplay

During idle time with run-with-idle-timer I parse text around a point and update header-line-format. Unfortunately I can't see update to header line unless I type any key. So I should trigger redisplay. With (redisplay) header line isn't updated.…
gavenkoa
  • 3,352
  • 19
  • 36
3
votes
1 answer

Effect of multiple idle timers

Suppose I set two idle timers (run-with-idle-timer 3 nil #'function1) (run-with-idle-timer 3 nil #'function2) What is the effect? After roughly 3 seconds will emacs run function1 and then wait 3 further seconds, or will there be no second delay…
Andrew Swann
  • 3,436
  • 2
  • 15
  • 43
2
votes
2 answers

run c-c c-k after edit text automatically

I would like to config emacs to run c-c c-k command after edit text happen and delay 3 secs. if edit happen within 3 secs, then no need to run the command. if edit happened then after 3 secs not edit happen, I need to run c-c c-k command. How can I…
lucky1928
  • 1,622
  • 8
  • 28
1
vote
0 answers

Semantic Idle Service Error semantic-idle-summary-idle-function

Context Hey, I've discovered semantic and how useful it is when writing coding, it provides some handy features. I'm mostly using it for C/C++ programming, although there's a bug that kept on showing, and it's bothering me a lot. I've debugged it…
0x0584
  • 121
  • 4
1
vote
1 answer

How to temporarily disable/reset idle timers?

I have a package which uses mouse motion, currently the idle timers aren't reset on mouse motion - causing idle timers to run, even when from a user perspective - Emacs is not idle. How can I stop idle timers from running while my function runs?
ideasman42
  • 8,375
  • 1
  • 28
  • 105
1
vote
0 answers

Get time since last keystroke

I would like to know how many seconds have passed since the last keystroke (or character that showed up in the screen, whatever is easier). Is there a timer that is associated to self-insert-command? Alternatively, what is a simple way to achieve…
scaramouche
  • 1,772
  • 10
  • 24
1
vote
1 answer

How to block output of a command run with via `run-with-idle-timer`?

I use (run-with-idle-timer 45 t 'org-save-all-org-buffers) to automatically save all org-mode buffers when I am idling for 45 seconds. What I don't like about this is that it prints "All org-mode buffers have been saved" to the minibuffer. How can…
CrabMan
  • 255
  • 1
  • 5
1
vote
1 answer

Count down timer and org

count down timer This code starts a count down timer every time org file is opened , but asks for a permission to reset timer every time . Can it be automated, meaning it should start counting as soon as org file is opened. Second, it should show a…
Vaibhav
  • 573
  • 3
  • 15
1
vote
0 answers

mode-specific idle timer?

I have my idle timer which saves the current buffer automatically just once when idle for three seconds. It's handy but when I stop typing while in helm, it opens up a prompt that asks me where to save the helm buffer, since it's not an already…
stacko
  • 1,577
  • 1
  • 11
  • 18
1
vote
1 answer

Rebuilding Org Agenda Buffer With Timer

I am trying to rebuild my Org Agenda buffer with a timer. I am trying to do it like this: (defun renewOrgBuffer () (interactive) (dolist (buffer (buffer-list)) (with-current-buffer buffer (when (derived-mode-p 'org-agenda-mode) …
Jesse
  • 267
  • 3
  • 10
0
votes
2 answers

Is post-command-hook or idle timer better for doing something when the user becomes idle?

Let's say I want to write a mode which updates the display (e.g. adds some annotation) when the user edits the buffer or just moves around. What is the recommended way to implement this? Using post-command-hook with sit-for, so my function does its…
Tom
  • 1,190
  • 7
  • 16
1
2