Skip to content

Commit a95a997

Browse files
committed
Polish
1 parent f60a109 commit a95a997

9 files changed

+40
-38
lines changed

doc/eva.info

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Eva’s User Manual
1313

1414
This manual is for Eva version 0.5-pre.
1515

16-
Copyright (C) 2020-2023 Martin Edström <[email protected]>
16+
Copyright (C) 2020-2024 Martin Edström <[email protected]>
1717

1818
You can redistribute this document and/or modify it under the terms
1919
of the GNU General Public License as published by the Free Software

doc/eva.org

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
:PREAMBLE:
33
#+AUTHOR: Martin Edström
44
5-
#+DATE: 2020-2023
5+
#+DATE: 2020-2024
66
#+LANGUAGE: en
77

88
#+TEXINFO_DIR_CATEGORY: Emacs
@@ -20,7 +20,7 @@
2020
This manual is for Eva version 0.5-pre.
2121

2222
#+BEGIN_QUOTE
23-
Copyright (C) 2020-2023 Martin Edström <[email protected]>
23+
Copyright (C) 2020-2024 Martin Edström <[email protected]>
2424

2525
You can redistribute this document and/or modify it under the terms
2626
of the GNU General Public License as published by the Free Software
@@ -120,7 +120,11 @@ The arguments to =eva-item-create= are as follows:
120120
- =:min-hours-wait= - the minimum amount of hours to wait before it is ok to query you for this info again
121121
- =:max-entries-per-day= - max amount of entries to make in a given day; this makes sense for some kinds of info
122122

123-
It also has =:last-called= and =:dismissals= for internal use.
123+
It also has =:last-called= and =:dismissals= for internal use---do not set these.
124+
125+
#+begin_quote
126+
(ASIDE: There is also the boolean =:lookup-posted-time=, mainly existing for the special case of =eva-query-sleep= because that prompts about things that happened in the past instead of the now, recording sleep-timestamps that are in the past. I.e. it could be 3pm at the time it asks, but you woke up at 6am so 6am is the timestamp saved in the log. This affects the calculation of whether it's a good time to ask again.)
127+
#+end_quote
124128

125129
The order in which the items come in this list reflects the order in which you will be asked. To disable one of them, it is not necessary to remove it from this list, just cancel the query a few times with C-g and the VA will ask you if (s)he should disable it, which is recorded separately in =eva-mem=. To reenable, try =M-x eva-reenable-fn= and enter the name of that function, or simply edit =eva-disabled-fns=.
126130

@@ -239,7 +243,7 @@ If you do not use these in your =eva-items=, you can prevent the ESS initializat
239243
#+end_src
240244

241245
** Notes
242-
Note that when you re-eval =(setq eva-items ...)= seen in the previous section, it will reset the items' keys =:last-called= and =:dismissals=. This doesn't matter much while you are experimenting. but if you care about it, you can immediately eval =(eva--mem-restore-items-values)= before the reset values are written to disk (by a timer that runs every other minute).
246+
Note that when you re-eval =(setq eva-items ...)= seen in the previous section, it will reset the items' keys =:last-called= and =:dismissals=. This doesn't matter much while you are experimenting, but if you care about it, you can immediately eval =(eva--mem-restore-items-values)= before the reset values are written to disk (by a timer that runs every other minute).
243247

244248
Bit of a tangent, but you could use the functions from both =org-journal= and the =org-roam= dailies if your =org-journal-file-format= is the same file name format as used by your =org-roam-dailies-capture-templates=. So your =org-journal-dir= can refer to the same location as =(concat org-roam-directory org-roam-dailies-directory)=. Just a tip. That's pretty much what you have to do now if you want =eva-present-diary= to scan your org-roam dailies, since it as yet doesn't scan them specifically. Although it's likely you /don't/ use org-journal, in which case you can simply set org-journal-dir to your =~/org-roam/daily/= equivalent.
245249

eva-activity.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; eva-activity.el --- activity tracking -*- lexical-binding: t; -*-
22

3-
;; Copyright (C) 2021-2023 Martin Edström
3+
;; Copyright (C) 2021-2024 Martin Edström
44

55
;; This file is not part of GNU Emacs.
66

eva-builtin.el

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; eva-builtin.el --- Premade applications -*- lexical-binding: t; -*-
22

3-
;; Copyright (C) 2021-2023 Martin Edström
3+
;; Copyright (C) 2021-2024 Martin Edström
44

55
;; This file is not part of GNU Emacs.
66

@@ -122,16 +122,12 @@ Near equivalent to typing l v A after entering `org-agenda-list'."
122122
(eva-stop-queue))
123123

124124
(eva-defun eva-present-org-agenda ()
125-
"Send the user to an Org agenda with log and archives enabled.
126-
Near equivalent to typing l v A after entering `org-agenda-list'."
127-
(declare (obsolete eva-present-org-agenda-log-archive "2021-09-17"))
125+
"Send the user to an Org agenda."
128126
(require 'org-agenda)
129-
(message (eva-emit "Here's the agenda archive as of now."))
127+
(message (eva-emit "Here's the agenda as of now."))
130128
;; (message (eva-emit "Sending you to the Org agenda log + archive."))
131129
(sit-for eva-sit-short)
132130
(org-agenda-list)
133-
(org-agenda-log-mode t)
134-
(org-agenda-archives-mode t)
135131
(push (current-buffer) eva-excursion-buffers)
136132
(eva-stop-queue))
137133

@@ -475,10 +471,10 @@ of the month the last 12 months, and this date the last 50 years.
475471
Optionally, the point of reference can be TS instead of today."
476472
(let ((now (or ts (ts-now))))
477473
(-uniq (append
478-
(--iterate (ts-dec 'day 1 it) now 1) ;; yesterday
479-
(--iterate (ts-dec 'woy 1 it) now 4)
480-
(--iterate (ts-dec 'month 1 it) now 12)
481-
(--iterate (ts-dec 'year 1 it) now 50)))))
474+
(cdr (--iterate (ts-dec 'day 1 it) now 2)) ;; yesterday
475+
(cdr (--iterate (ts-dec 'woy 1 it) now 5))
476+
(cdr (--iterate (ts-dec 'month 1 it) now 13))
477+
(cdr (--iterate (ts-dec 'year 1 it) now 51))))))
482478

483479
(defun eva-past-sample-casual (&optional ts)
484480
"Return a list of ts objects.
@@ -487,9 +483,9 @@ months, and this date the last 50 years. Optionally, the point
487483
of reference can be TS instead of today."
488484
(let ((now (or ts (ts-now))))
489485
(-uniq (append
490-
(--iterate (ts-dec 'day 1 it) now 1)
491-
(--iterate (ts-dec 'month 1 it) now 6)
492-
(--iterate (ts-dec 'year 1 it) now 50)))))
486+
(cdr (--iterate (ts-dec 'day 1 it) now 2))
487+
(cdr (--iterate (ts-dec 'month 1 it) now 7))
488+
(cdr (--iterate (ts-dec 'year 1 it) now 51))))))
493489

494490
;; TODO: Allow a list of datetrees
495491
(defun eva--make-indirect-datetree (buffer dates)
@@ -586,7 +582,8 @@ Note that org-journal is not needed."
586582
(push (current-buffer) eva-excursion-buffers))
587583
(when (-non-nil discrete-files-found)
588584
(dolist (x discrete-files-found)
589-
(view-file x)
585+
;; (view-file x) ;; surprising
586+
(find-file x)
590587
(push (current-buffer) eva-excursion-buffers)))
591588
(eva-stop-queue))
592589
(kill-buffer datetree-buf)))))

eva-test.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; eva-test.el --- Unit tests -*- lexical-binding: t; -*-
22

3-
;; Copyright (C) 2020-2023 Martin Edström
3+
;; Copyright (C) 2020-2024 Martin Edström
44

55
;; This file is not part of GNU Emacs.
66

eva.el

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; eva.el --- Emacs virtual assistant -*- lexical-binding: t; -*-
22

3-
;; Copyright (C) 2020-2023 Martin Edström
3+
;; Copyright (C) 2020-2024 Martin Edström
44

55
;; Author: Martin Edström <[email protected]>
66
;; URL: https://github.com/meedstrom/eva
@@ -858,8 +858,8 @@ Digression: Should honestly be submitted to Emacs,
858858
(defun eva--log-idle ()
859859
"Log chunk of idle time to disk."
860860
(eva-tsv-append eva-idle-log-path
861-
(ts-format)
862-
(number-to-string (/ (round eva-length-of-last-idle) 60))))
861+
(ts-format)
862+
(number-to-string (/ (round eva-length-of-last-idle) 60))))
863863

864864
;; This trio of functions handles many edge cases elegantly. Modify with care.
865865
(defun eva--start-next-timer (&optional assume-idle)
@@ -928,6 +928,7 @@ separate function from `eva--user-is-present'."
928928
;; NOTE: If you change the order of keys, eva--mem-recover will set the
929929
;; wrong values henceforth! You'd better use `eva--mem-nuke-var' on
930930
;; `eva-items' then.
931+
;; TODO Put :fn first, easier inspection
931932
(cl-defstruct (eva-item
932933
(:constructor eva-item-create)
933934
(:copier nil))
@@ -1110,9 +1111,9 @@ NEW is assumed to be a list of buffers\; most likely, it is
11101111
(when (null (eva-item-dataset
11111112
(eva-item-by-fn eva-curr-fn)))
11121113
(eva-tsv-append
1113-
(expand-file-name (concat "successes-"
1114-
(symbol-name eva-curr-fn))
1115-
eva-cache-dir-path)))
1114+
(expand-file-name (concat "successes-"
1115+
(symbol-name eva-curr-fn))
1116+
eva-cache-dir-path)))
11161117
(setq eva--queue (cl-remove eva-curr-fn eva--queue :count 1))
11171118
;; TODO: if a fn is called in isolation manually, don't resume
11181119
;; HACK Because the current-buffer is still active, wait to be sure the
@@ -1160,8 +1161,8 @@ Return t if there was no problem with setup, nil otherwise."
11601161
(setf (eva-item-dismissals eva-curr-item) 0)
11611162
;; Save timestamp of this successful run.
11621163
(eva-tsv-append
1163-
(expand-file-name (concat "successes-" (symbol-name eva-curr-fn))
1164-
eva-cache-dir-path))
1164+
(expand-file-name (concat "successes-" (symbol-name eva-curr-fn))
1165+
eva-cache-dir-path))
11651166
;; Clean up, because this wasn't an excursion.
11661167
(named-timer-cancel :eva-excursion)
11671168
(remove-hook 'kill-buffer-hook #'eva--if-excursion-complete-do-stuff))
@@ -1343,11 +1344,11 @@ Return a list looking like
13431344
(let ((print-level nil)
13441345
(print-length nil))
13451346
(eva-tsv-append eva-mem-history-path
1346-
(prin1-to-string (car cell))
1347-
(if (ts-p (cdr cell))
1348-
;; Convert ts structs because they're clunky to read
1349-
(ts-format "%s" (cdr cell))
1350-
(prin1-to-string (cdr cell)))))))))
1347+
(prin1-to-string (car cell))
1348+
(if (ts-p (cdr cell))
1349+
;; Convert ts structs because they're clunky to read
1350+
(ts-format "%s" (cdr cell))
1351+
(prin1-to-string (cdr cell)))))))))
13511352

13521353
(defun eva--mem-last-value-of-variable (var)
13531354
"Get the most recent stored value of VAR from disk."

generate_an_ods.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# generate_an_ods.R
2-
# Copyright (C) 2021-2023 Martin Edström
2+
# Copyright (C) 2021-2024 Martin Edström
33

44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

init.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2021-2023 Martin Edström
1+
# Copyright (C) 2021-2024 Martin Edström
22

33
# This program is free software: you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by

make_data_for_plots.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2020-2023 Martin Edström
1+
# Copyright (C) 2020-2024 Martin Edström
22

33
# This program is free software: you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)