Skip to content

Commit 904e7df

Browse files
committed
Documentation, cursor control (cont.)
1 parent d673fa6 commit 904e7df

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

README.md

+23-20
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ down from (see later for more sophisticated options). When prompted for the
8787
message, enter a short description of the timer for display and notification.
8888

8989
Alternatively, you can use `M-x chronos-add-timers-from-string`. This function
90-
prompts for a string, from which one or more timers can be parsed.
90+
prompts for a string, from which one or more timers can be parsed. See the
91+
section [Add timers from string](#add-timers-from-string).
9192

9293
## Dependencies
9394

@@ -99,7 +100,7 @@ notifications section later.
99100

100101
## Enhancements
101102

102-
There is a helm interface for conveniently adding timers, `helm-chronos`.
103+
There is a helm interface for conveniently adding timers: `helm-chronos`.
103104

104105
See https://github.com/dxknight/helm-chronos
105106

@@ -121,7 +122,7 @@ with respect to a base time that, depending on circumstances, could be:
121122

122123
## absolute time
123124

124-
Start with an =, followed by a 24+hr clock time. For example, `=17:00` is an
125+
Start with an `=`, followed by a 24+hr clock time. For example, `=17:00` is an
125126
expiry time of five o'clock in the afternoon. Times are for the current day.
126127
If you want to refer to times tomorrow (i.e. past midnight), add 24 hours:
127128
e.g. `=25:30` specifies 1:30 tomorrow morning.
@@ -149,8 +150,8 @@ For example, if the base time is 17:00:
149150

150151
Negative relative times are more useful against existing timers. Here, a timer
151152
was set for the absolute time 19:00, then with the cursor on this timer and
152-
using `(C-u a)`, two relative timers were set to expire earlier, one with **-5**
153-
(five minutes before end, i.e. 18:55) and the other with **-15** (fifteen
153+
using `(C-u a)`, two relative timers were set to expire earlier, one with `-5`
154+
(five minutes before end, i.e. 18:55) and the other with `-15` (fifteen
154155
minutes before end, i.e. 18:45).
155156

156157
Expiry Elapsed To go Message
@@ -168,14 +169,15 @@ time, this is relative to current time or, with the prefix argument, to the
168169
currently selected timer. Subsequent timers are relative to the previous timer
169170
in the string.
170171

171-
The format of the string for a single timer is expiry specification/message.
172-
You can delimit multiple consecutive timers with '+'.
172+
The format of the string for a single timer is `<expiry specification>/<message>`.
173+
You can delimit multiple consecutive timers with `+`.
173174

174175
For example, you could enter a pomodoro style timer with:
175176

176177
25/Pomodoro: Work on helm-chronos + 5/Pomodoro: Rest
177178

178-
which will give a timer to go off in 25 minute and 30 (=25+5) minutes:
179+
which will give a timer to go off in 25 minutes and another in 30 (=25+5)
180+
minutes:
179181

180182
Expiry Elapsed To go Message
181183
[13:10] --now--
@@ -208,7 +210,7 @@ Key | Action
208210
--- | ------------------------------------------------------------------------------------
209211
a | add a timer by specifying expiry time and a message
210212
A | add multiple consecutive timer(s) in one go
211-
n/p | move selection down/up
213+
n/p | move selection down/up (also `C-n`/`C-p` `<down>`/`<up>`)
212214
SPC | pause/unpause (pausing affects time to go and the expiry time, but not elapsed time)
213215
d | delete selected timer
214216
D | delete all expired timers
@@ -238,7 +240,7 @@ Adding with `A` is the same as `M-x chronos-add-timers-from-string`.
238240

239241
A timer is selected when the cursor is on its line. The cursor can be
240242
moved down and up the timer list, wrapping as necessary, with `n` and
241-
`p`.
243+
`p` (also `C-n`, `C-p`, `<down>` and `<up>`).
242244

243245
The -now- timer can be selected, but cannot be paused, lapped or
244246
deleted.
@@ -271,9 +273,9 @@ message as a starting point.
271273
When a timer is lapped by pressing `l`:
272274
* The timer is paused and the time that had elapsed until the timer was
273275
lapped is appended to the message. If the message does not already include
274-
a lap number, <1> is inserted in the message.
276+
a lap number, `<1>` is inserted in the message.
275277

276-
* A new timer with the message <n+1> is run continuing on from the one just
278+
* A new timer with the message `<n+1>` is run continuing on from the one just
277279
lapped.
278280

279281
### Lap example
@@ -284,7 +286,7 @@ timer example.
284286
After running for six seconds, the timer was lapped with `l`.
285287
Eight seconds later, the timer was lapped again, then after five
286288
seconds and then four. These lap times, together with lap numbers in
287-
<> were appended to the messages. There is no lap time for lap 5, as
289+
`<>` were appended to the messages. There is no lap time for lap 5, as
288290
that timer hasn't been lapped yet.
289291

290292
The 'To go' column gives the total elapsed time, e.g. the first
@@ -303,10 +305,10 @@ four laps took 23 seconds.
303305

304306
## Freezing the display
305307

306-
Freezing the display with `F` prevents any updates to the \*chronos\*
307-
buffer or triggering of expiry actions, but does not stop the timers
308-
running. Unfreezing the display updates the \*chronos\* buffer to
309-
current values and triggers all outstanding actions.
308+
Freezing the display with `F` prevents any updates to the \*chronos\* buffer or
309+
triggering of expiry actions, but does not stop the timers running. Unfreezing
310+
the display with `F` again updates the \*chronos\* buffer to current values and
311+
triggers all outstanding actions.
310312

311313
## Quitting, Killing and restarting
312314

@@ -340,7 +342,8 @@ The hook `chronos-expiry-functions` is empty by default so it can be set
340342
directly as a list of functions, or `add-hook` can be used to add functions to
341343
it in the standard way.
342344

343-
This hook is "abnormal", in that all functions added must take an argument: the expired timer.
345+
This hook is "abnormal", in that all functions added must take an argument: the
346+
expired timer.
344347

345348
Standard functions available are:
346349

@@ -355,7 +358,7 @@ chronos-dunstify | Uses the `dunst` notification daemon (requires dunst and
355358
chronos-text-to-speech-notify | Uses `chronos-text-to-speech-program` (such as espeak) with `chronos-text-to-speech-program-parameters` to speak the expiry time and message.
356359

357360
For example, in my init file I have:
358-
361+
```elisp
359362
(setq chronos-shell-notify-program "mpv"
360363
chronos-shell-notify-parameters '("--really-quiet"
361364
"--af=scaletempo=speed=pitch"
@@ -367,7 +370,7 @@ For example, in my init file I have:
367370
chronos-buffer-notify
368371
chronos-shell-notify
369372
chronos-text-to-speech-notify))
370-
373+
```
371374

372375
This sets the notification sequence to pop up a dunst notification, put the
373376
message in the \*chronos\* buffer in big text, run `mpv` in the shell with

chronos.el

+3-1
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,10 @@ selected timer must be running."
848848
(chronos--set-message c2
849849
(chronos--lap-string c1-msg))
850850
(chronos--set-start-time c2 (current-time))
851+
(setq chronos--selected-timer c2)
851852
(push c2
852-
chronos--timers-list)))))
853+
chronos--timers-list)
854+
(chronos--update-display)))))
853855

854856
(defun chronos-edit-selected-line (time prefix)
855857
"Adjust the expiry time of a selected running or paused timer

0 commit comments

Comments
 (0)