Questions tagged [timers]
The timers tag has no usage guidance.
32
questions
0
votes
1
answer
28
views
How can I make a function that interactively passes a time to run-at-time?
I want to make a function that calls run-at-time while setting its repeat to nil. The only thing I want to be asked to supply is the duration after which run-at-time should call a function.
Evaluating ...
1
vote
0
answers
32
views
Insert output of slow external process in current buffer, character-by-character
Imagine in the current buffer I have the text:
Hello
Bye
I want to call an external program and add the output of it at the end of the buffer. The tricky thing is that the external program provides ...
-3
votes
1
answer
40
views
Coloured indicators defined by a time interval
Would it be possible to have a coloured indicator that light at each second, then starts all over again?
I would have a 4 column row in a buffer. After a predefined time interval the background ...
1
vote
1
answer
35
views
Timing a while loop
I am running two embedded loops that might take a long time. Would like to time the inner while loop. What can I do?
3
votes
1
answer
47
views
How to detect when a function was activated by a timer?
When running a function inside a timer, there are some constraints on whats possible.
Adding timers should not be done (according to the documentation).
Communicating with a sub-process is limited (...
1
vote
0
answers
28
views
Get backtrace while busy
Something in my configuration causes emacs to occasionally hang or enter a very long busy loop. I have been adding things to my .emacs for several decades, so figuring out what the problem is by ...
1
vote
1
answer
99
views
Identifying functions that trigger timers and cause redisplays when profiling Emacs execution
I'm experiencing serious performance degradation whenever I'm in dart-mode and LSP is enabled. This is a strange one because Emacs I don't experience any performance degradation on a fresh instance ...
4
votes
1
answer
45
views
Buffer file replaced with lockfile/backupfile location
I have been suffering this issue for a few months, unable to reproduce it until now.
In short, the issue is that when creating a new file, editing it, and then deciding to rename the file, the buffer'...
1
vote
0
answers
29
views
How to impose a timeout on ert tests?
When using ert I'd sometimes like to have tests abort after some timeout. I could program this in advance in the test-case but this is not what I need.
Imagine a situation where I use ert-run-tests-...
0
votes
2
answers
747
views
Trying to set org-clock-sound for org-timer
I'm trying to set up a notification alert for org timer. I'm using Dunst on Arch for notifications.
Used the following lines in my config file:
(require 'org)
(setq org-clock-sound "~/Downloads/...
4
votes
1
answer
219
views
Timer runs immediately then periodically
I have a timer I want to run every day at 4am. Thus, I put something like this in my configuration.
(defvar my/timer nil)
(unless my/timer
(setq my/timer (run-at-time "04:00am" (* 24 60 ...
2
votes
1
answer
273
views
start-process: Setting current directory: No such file or directory
I have a timer which call a function itself calling start-process. Whenever the current buffer's directory changed (deleted/moved), I have the error
start-process: Setting current directory: No such ...
0
votes
1
answer
118
views
Locking an org-timer into the mode-line
Context. I frequently use
org-mode timers
The org-mode clock (which just displays the clock in the org-mode mode-line)
A custom "target time" clock, which shows a point in time (either a ...
2
votes
2
answers
219
views
How to time org-mode code block execution?
Is there an easy way to time how long it takes to execute source code blocks in org-mode (maybe with header arguments or similar), if so, how? Or do I have to implement it in the code itself?
I'm ...
0
votes
1
answer
574
views
Error running timer (wrong-number-of-arguments equals 3)
I am trying to automatically change my Emacs theme according to time set (Thanks to answer provided by Dan).
My code looks like this:
(setq emacs-curr-theme nil)
(setq emacs-light-theme 'faff)
(setq ...
4
votes
1
answer
331
views
run-at-time in the future only
I want to capture a journal entry several times a day. Here was my initial solution:
(setq org-capture-templates '(("w" "Weekly" item
(file+olp+...
1
vote
1
answer
190
views
Can I set a timer to run at 7am tomorrow?
It seems to me I can either set a time for today or some relative time in the future.
But can I combine the two somehow to set a timer for 7am tomorrow, for example?
1
vote
0
answers
54
views
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? ...
0
votes
0
answers
151
views
Error running timer ‘ac-update-greedy’: (void-variable org-link-types)
I very recently updated to Emacs 26.3 and Org 9.2.6, and am getting the above-mentioned error whenever I type "[[" in an org-mode buffer to type a hyperlink. Unsurprisingly, no error after turning off ...
5
votes
2
answers
760
views
Timer on modeline: how to update modeline every second?
As part of my custom mode-line, I've included a feature that displays a countdown timer (timers are created using the chronos package) when it recognises that there is one running.
Works great, but ...
2
votes
1
answer
114
views
Toggle timer function
I want to write a function that starts a timer if timer does not exists or stop it if that one exists. I mean something like:
(defun toggle-mytimer ()
(interactive)
(if (timerp TIMER_NAME)
...
4
votes
1
answer
383
views
Prevent Emacs from messaging when it writes recentf
I've configured Emacs to save recentf every five minutes by using this code:
(run-at-time nil (* 5 60) 'recentf-save-list)
It works great, but after writing recentf Emacs feels it has to tell me ...
1
vote
1
answer
146
views
Time-of-day triggers
How can I set timers in Emacs to trigger at certain times of day? Midnight mode adds hooks for a single "midnight" time, but I would like to create separate hooks for multiple clock times.
1
vote
1
answer
991
views
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 ...
0
votes
0
answers
162
views
Monitoring and restarting background processes in Emacs
I have a background process to sync and index email. The two function calls in there, (mail-sync) and (mail-index) are calls with start-process. I then run the mail-background function periodically ...
1
vote
0
answers
715
views
Enabling Company CAPF backend with timer in Major Mode
I've be working on a new major mode for a DSL. I'm planning to use the CAPF backend for company mode and would like to provide the integration. The completion at point functions produce the correct ...
1
vote
1
answer
54
views
Change buffer displayed in window after x amount of time
I find myself switching between buffers constantly to double check activity in other buffers. Is it possible for windows to display different buffers after x amount of time? In other words can I get "...
3
votes
1
answer
885
views
Error running timer "show-paren-function" when displaying matching line in message/mini buffer
I want to display the line contains matching bracket in the message/mini buffer at the bottom of emacs. I found some code on emacs Wiki, after put it in init file, emacs do show the maching line in ...
6
votes
3
answers
117
views
How to detect if `read-event` or `y-or-n-p` is running?
In haskell-doc-mode we have a timer that shows useful tips in minibuffer when cursor is idle for a moment. In other part of Haskell Mode there is code asking questions using y-or-n-p or read-event. ...
10
votes
2
answers
371
views
How to set temporary halt after C-x C-c?
If I run C-x C-c in emacs, it will close immediately. If I set confirm-kill-emacs to y-or-n-p it will ask for confirmation before closing.
Instead of y-or-n-p, I want to set some temporary timer for ...
1
vote
1
answer
400
views
run-at-time under certain circumstance [closed]
I need to backup few files on my Mac, and it can be done inside of Emacs by calling a function. But it is a tedious task to do everyday and sometimes I forgot doing it.
I wonder if I can automate it ...
9
votes
1
answer
3k
views
Is it possible to execute a function or command at a specific time?
Is it possible to execute a function or command at a specific time? As an explicit example, is it possible to kill emacs at a specific time (time determined by the OS).