Commit Graph

948 Commits

Author SHA1 Message Date
396ec4fca5
Ignore inaccessible directories when searching for changed git repos 2025-02-23 09:59:15 +01:00
be280ba373
Ensure bookmarks are loaded when opening via Org link 2025-02-23 09:38:48 +01:00
73a8e3be4b
Do not depend on autoloading db-org.el for bookmark links
Let's keep db-org a collection of autoloadable functions and move the
actual configuration of Org bookmark links to init.el.
2025-02-22 20:54:31 +01:00
795fcde3b8
Use default mechanism to store URL bookmarks directly after creation
Nicer :)
2025-02-22 20:54:31 +01:00
35cc0080d5
Set bookmark type for URLs
Just for display, nothing else should change with this (yet).
2025-02-22 20:54:31 +01:00
e32a67d666
Fix performance issue with file comparison on Windows
`file-equal-p` makes creating links too slow with bookmark links
enabled (which is the case by default).
2025-02-22 20:54:26 +01:00
4ddb17f204
Allow to run git-repo-change-checker command under old script name
Old habits die hard …
2025-02-22 10:24:24 +01:00
31e448d838
Add Org links to bookmarks
This is to remove redundant references in both bookmarks and links in
Org files.

The code is based on the original implementation of `ol-bookmark.el` by
Tokuya Kameshima, as found in [org-contrib][1].

[1]: bd39cca48b/lisp/ol-bookmark.el
2025-02-21 17:39:14 +01:00
003121ba0c
Add simple function to list changed git repositories
This is akin (in purpose) to `magit-list-repositories`, but also
descends into submodules.  It's not as nice as
`magit-list-repositories`, though … more of a draft version right now.

This replaces a shell script with similar purpose.
2025-02-16 17:51:00 +01:00
3a6d2005cb
Fix some flycheck warnings 2025-01-17 19:37:27 +01:00
6e31e4a707
Clean up draft of Org list item conversion function
The template is still fixed, should it be customizable?
2025-01-17 18:10:20 +01:00
2960652d66
Draft function to convert Org items to headlines
This usually happens when I try to convert loose entrie in my refile
file into proper headlines.

Usage of Org capture functionality is inspired by Sacha Chua [1].

[1]: https://sachachua.com/blog/2020/12/org-mode-create-a-quick-timestamped-note-and-capture-a-screenshot-by-prefilling-a-capture-template-via-emacs-lisp/
2025-01-17 17:54:06 +01:00
a1e372e31e
Use builtin project instead of external projectile from now on
`projectile` is nice, but I rarely use a fraction of its functionality
and not having to use an external package for project management feels
more robust.
2024-12-31 14:57:56 +01:00
ffe7eaf727
Minor identation fix
Done automatically, not fighting it.
2024-12-30 10:39:46 +01:00
ae5657fcc9
Add small utility to zoom into dedicated window
Taken from prot, see comment.
2024-12-30 10:39:29 +01:00
60463a01e3
Do not print “Template” in checklist when no other items exist
I tend to remove “Template” anyway when it's the only block inserted as
checklist, so let's do this automatically.

This commit also includes a minor refactoring of moving around variable
declarations to be closer to the code that actually uses them.
2024-12-20 10:54:20 +01:00
3a397139f2
Do not clock into interrupted task when it's the default task
Clocking into the default task should only happend as last resort.
2024-12-14 10:32:02 +01:00
661c5f9b22
Add small utility to quickly update complex Org reports 2024-12-14 09:39:22 +01:00
bac4fb389a
Fix handling of last day in workload overview report
Previously, the last day added had been removed on the assumption that
it was the frist day after `end-date` (after which the while loop
aborts).  However, when this last day is filtered because of
`:skip-matches`, this would result in accidentally removing a valid day
from the overview time period.  This has been fixed by checking for this
very case, and keeping the last day added in case it is still within the
requested time period.
2024-12-04 16:23:05 +01:00
311d6e81b6
Explicitly set visibility when jumping to current clock in Org mode
This is another try to reduce the number of Org items that are unfolded
when jumping to the current clock.  This is particularly important with
periodic items with many subtasks, because unfolding all siblings might
be irritating (at least to me).
2024-11-30 15:26:07 +01:00
8521d627b4
Add convenience function to retrieve auth-source entries
Again inspired by https://magnus.therning.org/2024-09-01-improving-how-i-handle-secrets-in-my-work-notes.html.
2024-11-16 17:17:19 +01:00
5a25d5d069
Revoke special password implementation for SQL Org source blocks
Turns out this can be done by a simple function call, as demonstrated by
https://magnus.therning.org/2024-09-01-improving-how-i-handle-secrets-in-my-work-notes.html.
So we just extend `org-password-manager-get-password-by-id` accordingly
and use that instead.  No need to patch the default implementation of
Org!
2024-11-16 12:30:20 +01:00
3d38510284
Readd duplicate call to org-fold-reveal
This reverts 05bb198.

Turns out this call is not that redundant after all.  Revealing should
be done after jumping to the next checkbox of the current item.
However, revealing the item at point only then leads to funny
flickering, so let's keep the old implementation for now and reveal
stuff twice.
2024-11-16 09:33:42 +01:00
05bb198e08
Remove duplicate call to org-reveal 2024-11-12 16:31:45 +01:00
aabcfcad06
Make actual timeline appear first in main display
When I copy over the timeline into the actual time sheet application, I
like to focus on the first line of the remaining report, moving it to
the top of the window.  Having the clocktime summary on top this hard,
because after redrawing, the summary will be on top and not the actual
timeline.  Changing the positions may help here.
2024-11-08 21:15:23 +01:00
c6e359546d
Do not show complete item when jumping to it
This should avoid “visibility jumps” when jumping to a currently clocked
in item that is already revealed.
2024-11-01 18:13:03 +01:00
8a3bba0afe
Sort category overview in timeline tools by total amount
Nice to read, I think.
2024-10-25 19:16:25 +02:00
2c0f2f2ab5
Include overview of booked categories in timeline tools report
This is to easy booking entries that should be distributed among other
topics done in the same time range.
2024-10-25 19:10:41 +02:00
cffe713fa9
Include day of week in daily timeline tool report
This way, it's easier to see at glance what day the current report is
for.
2024-10-25 18:55:38 +02:00
986ae68730
Fix some checkdoc warnings in customization settings 2024-10-20 19:12:02 +02:00
0f43b7303f
Add custom function to start ement.el without prompts
Inspired by https://github.com/alphapapa/ement.el/issues/32#issuecomment-902539093.
2024-10-20 19:11:19 +02:00
78924c841e
Add first draft function to compute time at home for given date
This is supposed to be used with `db/org-workload-overview-report`.
2024-10-12 17:08:23 +02:00
a67e64a906
Include computation of already spent work time in overview report
This change is an experimental, as quite a bit of code had to be
touched.  Further testing and bug hunting will be necessary.

Workload overview reports now only allow increments of one day
(`+1d`), since the current implementation cannot accomodate for arbitray
time ranges anymore (my fault, sorry).  Also, the default start time for
workload overview reports has been changed to 23:59 on the previous
day (`"-1d 23:59"`) to include the current day in the report.  The
rational behind this is that since the remaining work hours of today are
now included in the computation for the report, showing the entry for
today will show an accurate estimation of the remaining work time in
contrast to a constant value.

There are now additional parameters named `:work-hours` and
`:work-items-match` that specify how much work time is available on a
day and which Org items are considered work, respectively.
`:work-hours` can also take a function to compute for a given date how
much time can be spent on work.  An example could be something like
this:

```emacs-lisp
(defun db/get-worktime-for-date (date)
  "Return planned working time for DATE."
  ;; This is a simplification, as `date' might be the start of the day or the end.
  (cond
   ((string-match-p "Sa" date) "6:00")
   ((string-match-p "So\\|Sun" date) "4:00")
   ((string-match-p "Wed\\|Mi" date) "3:00")
   (t "2:00")))
```

An example report is then the following:

```
|               End Time | Planned Work | Work Hours | Utilization |
|                    <r> |          <r> |        <r> |         <r> |
|------------------------+--------------+------------+-------------|
| [2024-10-06 Sun 23:59] |         1:00 |       1:00 |   *100.00%* |
| [2024-10-07 Mon 23:59] |         4:15 |       3:00 |   *141.67%* |
| [2024-10-08 Tue 23:59] |         7:00 |       5:00 |   *140.00%* |
| [2024-10-09 Wed 23:59] |         9:15 |       8:00 |   *115.62%* |
| [2024-10-10 Thu 23:59] |        12:30 |      10:00 |   *125.00%* |
| [2024-10-11 Fri 23:59] |        13:15 |      12:00 |   *110.42%* |
| [2024-10-12 Sat 23:59] |        19:30 |      18:00 |   *108.33%* |
| [2024-10-13 Sun 23:59] |      1d 1:30 |      22:00 |   *115.91%* |
| [2024-10-14 Mon 23:59] |      1d 1:45 |    1d 0:00 |   *107.29%* |
| [2024-10-15 Tue 23:59] |      1d 2:30 |    1d 2:00 |   *101.92%* |
|------------------------+--------------+------------+-------------|
```
2024-10-06 15:31:04 +02:00
344dde2821
Fix divison by zero in workload overview report
When today's work hours are used up, show some sensible value instead of “-nan%”.
2024-10-06 11:48:48 +02:00
fa6bd0e713
Introduce first draft to compute time spent on work today
This is supposed to be used later on in workload overview reports, to
make the display of the current day account for already spent time.
2024-10-05 14:26:07 +02:00
9e3fe2a3b0
Allow to specify available work hours using custom functions
This allows to specify variable work hours depending on the
corresponding date.
2024-10-03 18:01:02 +02:00
d63cba9756
Use more speaking name for skip date function in workload report 2024-10-03 17:47:38 +02:00
62d4f62af4
Fix wrong usage of pcase 2024-10-03 17:46:59 +02:00
bdfcc61dd2
Refactor and simplify work hour computation in overview report
This is to prepare a generalization of how to specify work hours, namly
using a function from date to available work hours on that day.
2024-10-03 17:40:46 +02:00
9d03f2d953
Show available work hours in overview report to easy comparison
This is also helpful to plausibilize the shown entries, e.g. checking
whether holidays were accidentally included.
2024-10-03 17:30:56 +02:00
e9627e69fd
Mark entries with high utilization in workload overview report
That makes spotting over-utilization easier.
2024-10-03 10:32:42 +02:00
ca1b3613f9
Add simple computation of utilization to workload overview report
This way, it should be easier to spot days where utilzation is too high
to take any more work.
2024-10-03 10:32:29 +02:00
f948f3dca3
Make skip-matches also skip computations in workload overview report
This avoids unnecessary computations.
2024-10-03 09:54:15 +02:00
d0b126ec54
Add missing id: prefix when adding DATE references to checklists
Forgot this, oops.
2024-09-19 15:47:47 +02:00
dbda1928ce
Catch errors on user clock choice to ensure continuous clocking 2024-09-15 13:09:12 +02:00
75b54128bd
Ignore SOMEWHEN items in checklist backlinks
Since these are deferred items, they don't have to show up in checklists.
2024-08-25 09:07:46 +02:00
d01b3bdc09
Add clocktable formatter to filter entries with small clocking time
Whenever I try to check what I actually in the past couple of days, I
try to use a clocktable for this.  However, those clocktables are
usually littered with small entries, i.e. entries where I only spent a
couple of minutes on (example: a quick chat with a colleague).  Those
entries clutter the view for the relevant entries, making it hard to
make sense of past activities.

Restricting the clocktable to a certain depth somehow helps, but major
single tasks are hidden this way, and I usually want to see those.

The custom formatter added in this commit tries to alleviate this
situation by providing a mechanism to filter out those entries using a
minimum clocktime threshold.  Let's see how this feature plays out.
2024-08-17 16:07:17 +02:00
33b7d5d8d3
Allow to skip entries in workload-overview-reports
This is especially useful when skipping weekends, but also allows for
future extensions where based on the date more complex skipping criteria
can be implemented, e.g. for holidays or vacations.
2024-08-02 18:42:59 +02:00
f110d147fa
Improve implementation to find next started or open checkbox
The algorithm has been simplified and has been commented where
appropriate (from my point of view).  An extensive docstring has been
added to describe the intention of the approch and its recursive nature.
2024-07-12 08:58:01 +02:00
4a1509981b
Descend into sublists when searching for first open checkbox 2024-07-11 21:53:56 +02:00
21200d8bc4
Try to refine Org QL query for currently active DATE entries
`ts-now` should be better than `today`, as it includes the current time.
2024-07-10 15:24:08 +02:00
a3e6130056
Fix wrong defaults for frequently used shortcuts 2024-07-08 13:59:22 +02:00
7309cee413
Insert active concurrent DATE entries when inserting checklist
Those DATE entries may be relevant to the item at hand.

Caveat: the query to determine active, concurrent DATE entries is not
quite right yet, two disjoint time ranges that do not include today but
cover the past and the future would also be considered as concurrent
active date.  This needs to be fixed.
2024-07-06 13:50:33 +02:00
94187697e6
Remove checklist entry for relevant backlinks when there are none
The original motivation to keep this entry was to signify that backlinks
where searched for, but none where found.  However, I now think that it
is enough to just rely on the code to search for relevant backlinks, and
where there are none, to just print nothing.
2024-07-06 12:51:51 +02:00
2318ffa199
Add handling for ledger errors when converting to Org tables 2024-07-06 12:03:46 +02:00
7d75bae3ed
Hide drawers when jumping to current clock via custom function
Open drawers confuse me.
2024-07-06 09:42:32 +02:00
0acc0687ea
Save bookmarks added with custom handlers
I am saving bookmarks anyway, so why not do it automatically.
2024-07-06 09:18:31 +02:00
6f4baa885e
Conduct a bit of refactoring for ledger to Org table converter 2024-07-01 20:52:40 +02:00
e7c08b088d
Introduce helper function to format Ledger CLI output as Org table
This function is ideal, but it's doing the job.  It can be used to
format output of calls to ledger as follows:

    #+begin_src emacs-lisp :results value raw table
    (db/ledger-cli-to-org-table-list
     (concat "ledger -f finance.ledger "
             "--period monthly --depth 2 "
             "--display 'd >= [2024-07-01]' "
             "--empty "
             "lisp ^Expense"))
    #+end_src
2024-07-01 20:11:40 +02:00
e84b4fb825
Ensure org-password-manager only checks for properties when in Org
This surpresses warnings like

> Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *Org Agenda*> (org-agenda-mode)

among others.
2024-06-19 16:45:01 +02:00
5d28ab04a6
Fix some warnings in timeline-tools 2024-06-11 18:19:37 +02:00
051b578ba0
Do not include archives in timeline-tools by default
They are usually not needed, and can be included explicitly when
necessary.
2024-06-11 18:17:08 +02:00
2144c7e110
Fix headline display in timeline tools
Why did I do this that complicated to begin with?
2024-06-11 18:12:51 +02:00
1f348e256d
Disable refile verification when jumping to any Org item
Any item could be of interest, not only those that are valid refile
targets.

This might be slow.  May we should not be using the refile mechanism to
jump to any item?
2024-04-01 11:16:15 +02:00
63eeefcb8e
Ignore backlink items tagged HOLD in default checklist
Items tagged with HOLD should be ignored in normal processes and should
thus not appear as backlinks.  Items tagged WAIT are supposed to appear,
though, and are not excluded from the list of relevant backlinks.
2024-03-25 17:48:50 +01:00
c6bfd493db
Minor reformatting in music-control hydra
This way, the help page for the `music-control` hydra show a link to
`db/play-auto-playlist`, as for all the other key bindings.
2024-03-24 16:55:19 +01:00
8876f04756
Harden shortcut to jump to any Org heading from anywhere
In the previous implementation, when in some buffer which is not an Org
buffer that accidentally contains lines that partially match the regular
expression describing an Org heading, errors could occur when the Org
refile cache was empty.  To address this issue, let's temporarily switch
to some Org buffer before generating the list of all Org heading
targets.
2024-03-16 17:08:00 +01:00
42074f7d6a
Fix some docstring formatting 2024-03-09 16:30:08 +01:00
dbd19d0da8
Extend candidate list for custom grep-files function with history
It might be useful to actually see the history entries, so let's
explicitly include them in the candiate list.
2024-03-09 16:18:51 +01:00
4124bc28d5
Provide default value for custom grep-files pattern query function 2024-03-09 16:16:03 +01:00
7d398a66c8
Replace counsel Org heading dispatch by org-refile
This is nice enough and removes the last dependency to counsel :)
2024-03-09 15:04:21 +01:00
aadca01244
Simplify Org clocking hydra
No need to define an anonymous function her, just make the call
directly.
2024-03-09 15:03:10 +01:00
8150725233
Use default completion functions for Info and Unicode lookup
Using vertico completion, they are quite nice! :)
2024-03-09 14:08:41 +01:00
f6c40ad619
Fix wrong candiate specification in custom grep-read-files function
Somehow mixed up the order, I suppose.
2024-03-09 13:45:49 +01:00
1cc7abd4d7
Clarify that remaining time is computed over clocked time of subtree 2024-01-22 19:52:27 +01:00
af05bd2106
Collect custom Org key bindings in a custom hydra 2024-01-07 17:12:27 +01:00
dc841d4790
Allow to reset current text scaling directly
This is easier then adjusting the text scale manually until it reaches
zero.

The additional indentation fixes are bonus ;)
2024-01-04 08:28:14 +01:00
b7d190c513
Introduce separate hydra for Org jump commands
`hydra-org-clock` thus only hosts keybindings for clock-related
commands, while the new `hydra-org-jump` is for jumping to Org items in
various ways.  Feels cleaner to me this way.
2024-01-01 17:04:55 +01:00
5ebeeef3fd
Ensure point is on current clock when setting default task
Not sure whether this is the case otherwise.

Also add output when the default task is set, to see when it's set
accidentally.
2023-12-10 19:04:07 +01:00
d1e3409e80
Only search for parent task for clock continuation when necessary
Avoid unnessary work by leveraging the fact that `setq` returns the new
value of the variable being set :D
2023-12-08 17:45:10 +01:00
498f4b78c4
Automatically clock into interrupted task only when not closed yet
This is to avoid jumping back to old task that are still pointed at by
`org-clock-interrupted-task` that have long been closed.  Let's see
whether this is enough to handle this case.
2023-12-08 17:43:59 +01:00
7128144ee0
Fix errors in some docstrings 2023-12-08 17:27:29 +01:00
482cebea68
Fix docstring for clock continuation function
Forgot to adapt this previously.
2023-12-06 16:40:56 +01:00
416ba934f9
Resume clock at interrupted task when available 2023-12-06 16:31:05 +01:00
ed0286dc95
Include last modification time when adding custom-type bookmarks 2023-11-27 18:02:14 +01:00
15d202340f
Remove obsolete part of a function docstring 2023-11-27 17:46:12 +01:00
11ae275bb8
Do not use closures as handlers for custom bookmark types
Using closures leads to errors when using standard bookmark functions,
as they seem to expect a symbol as handler.
2023-11-27 17:35:33 +01:00
2407f4196f
Fix typo in hydra docstring 2023-11-05 12:04:38 +01:00
a959152d21
Increase highlighting of valid keys in Org clock hydra
This improves spotting the available keys, I think.
2023-11-04 09:35:40 +01:00
f14a5b6237
Make default Org clock hydra a bit more descriptive 2023-11-03 16:55:24 +01:00
44b78dbef1
Make main Org hydra a bit more consistent and self documenting
In particular, use “j” instead of “c” for jumping to the current clock, like the
standard Org bindings use it.
2023-11-01 21:06:35 +01:00
7b3b0811a1
Separate TeX configuration into separate package
This allows to not have to install the `auctex` package without errors on
startup, cf. 886598e.
2023-10-28 12:06:27 +02:00
375ead7c7e
Add missing type and group declaration in plantuml-mode 2023-10-27 17:06:01 +02:00
55c19e5b78
Replace obsolete usage of cl in plantuml-mode with cl-lib 2023-10-27 17:05:43 +02:00
aeff0883bb
Fix missing description in main Org hydra 2023-10-23 17:37:38 +02:00
9441800587
Also change to default-directory when not in eshell already
This is the expected behavior, and also how `db/run-or-hide-shell` works.  The
implementation is structured differently, though … because I reinvented the
implementation of `db/run-or-hide-eshell` instead of generalizing the one of
`db/run-or-hide-shell`.  Ah, anyway …
2023-10-12 16:39:29 +02:00
f2a62083d7
Allow overriding presence check for adding known SSH keys
Providing a non-nil universal argument to `db/load-known-ssh-keys` now readds
all known SSH keys to the current SSH agent, irregardless of whether they are
already present or not.
2023-10-01 09:51:53 +02:00
badbb85da0
Ensure org-password-manager is loaded when loading password by ID
Otherwise, `org-password-manager-default-password-wait-time` may be undefined
during runtime.
2023-08-18 19:21:14 +02:00
a6324a668d
Move custom org-password function to db-org
This is where it belongs, even if there's a warning about free variable
referencing.
2023-08-17 17:06:42 +02:00
e30ab3f260
Ensure inserting links works when the source buffer is narrowed 2023-08-15 18:11:47 +02:00