Commit Graph

835 Commits

Author SHA1 Message Date
Daniel - 6fb76d1efd
Decrypt SSH key password on demand and not unconditionally
This still always decrypts the password, because `ssh-add` does not check
whether the key is already present in the current agent.  This should propably
done separately before calling `ssh-add`.
2023-07-09 19:17:26 +02:00
Daniel - 603315e5b1
Delay computation of SSH-Key password until start of `ssh-add`
This is to prepare computing the password only when needed, i.e., when the key
is not already included in the running agent.  We are not there yet, though.
2023-07-09 17:55:19 +02:00
Daniel - 83e66e785f
Make default system open function work on Linux
I am not sure why it hasn't been working until now, and I am not sure why it
indeed does work now, but it does, and that sufficient for me – at least for
now.
2023-07-07 17:02:42 +02:00
Daniel - 3bb5b4481d
Search through all Org mode buffers when inserting backlinks
This seems to be fast enough, and since I often find myself aborting a current
backlink insertion query because I missed to include all Org mode buffers,
making it the default only seems to be reasonable.
2023-07-02 16:44:36 +02:00
Daniel - d8a41ca0cf
Move Dired utility functions to general utility library 2023-07-01 17:02:12 +02:00
Daniel - 908b5f278e
Remove some byte-compiler warnings 2023-06-27 21:04:02 +02:00
Daniel - ebb84f2139
Generalize SSH key adding function to additional password backends
Untested for Org password manager.
2023-06-27 20:20:28 +02:00
Daniel - 096f790fab
Change some code heading 2023-06-27 19:40:09 +02:00
Daniel - 74659e7548
Add simple convenience function to add known SSH keys
This is supposed to avoid manually inserting passwords for SSH keys when they
have expired from the local ssh-agent instance.
2023-06-27 19:40:00 +02:00
Daniel - 8f383bcbdb
Make checkdoc happy about db-music.el 2023-06-12 19:38:10 +02:00
Daniel - 4677ea74c7
Ensure number comparison when updating favorites playlist 2023-06-12 19:32:33 +02:00
Daniel - 9ff7c848a1
Change shortcut for interactive clock selection
This is for consistency with all other commands that use "s" to select a running
clock from the history.
2023-05-28 15:30:18 +02:00
Daniel - f8caaae071
Allow adding links to Org items also in non-Org-mode buffers
The relevant use-case (for me at least) is to insert links to Org items in the
minibuffer when capturing new items.
2023-05-26 18:08:22 +02:00
Daniel - 113f3f4495
Fix invalid logic for nil dates in workload report
When not provided in dynamic workload reports, `start-date` and `end-date`
should be treated as unconstrainted.  However, instead dates were queried
interactively in that case, because `org-read-date` is being used to normalize
date display.  Fixed that.
2023-05-24 19:25:02 +02:00
Daniel - a4712cf155
Include items in workload overview planned before given start date 2023-05-24 18:59:39 +02:00
Daniel - 242d5cbcba
Add function to retrieve library version
This could come in handy when checking for necessary library versions.
2023-05-18 19:07:21 +02:00
Daniel - cac41d0759
Do not recenter position when jumping to current clock
This keeps the current view as it is in case it's already visible in some
buffer.
2023-05-16 18:26:14 +02:00
Daniel - 58e5cd3506
Jump to headline of the currently clocked item when going there
Before this change, we went to the position of the open clock, which is not
where we want to be in case no open checklist item is found.
2023-05-16 18:25:00 +02:00
Daniel - 0b315f44a3
Go to Org item when trying to insert checklist directly in agenda
This is expected behavior in my point of view.
2023-05-13 10:30:29 +02:00
Daniel - 8e192e5cfb
Downcase login name in eshell prompt
Windows sometimes likes to display the login name in all-caps, this is annoying.
2023-05-09 17:53:36 +02:00
Daniel - 01b5e1b8db
Fix incorrect restriction handling when inserting templates
We must widen the current restriction when searching for the template item, not
when copying the body from it.  In the latter case, `org-with-point-at` will
handle the necessary widening.
2023-05-06 18:03:14 +02:00
Daniel - 925cf115be
Remove ID and CUSTOM_ID properties when inserting checklist template
When the template associated with the item at point contains sub-items itself,
those may have been assigned ID or CUSTOM_ID properties.  Copying the template
would thus duplicate these properties, violating their implicit uniqueness
constraint, so we now remove those properties from the inserted checklist
template.
2023-05-06 16:54:38 +02:00
Daniel - fa56dfdd4d
Ensure `CHECKLIST_INSERTED_P` will be inserted at original heading
When a checklist template contains headings on its own, the
`CHECKLIST_INSERTED_P` property until now would be inserted at the last heading
in this template, instead of at the heading where the template is supposed to be
inserted in the first place.  Fixed this.
2023-05-06 15:30:16 +02:00
Daniel - 7db9f8d56c
Fix indentation in utility library to conform to Common Lisp
This is the current indentation default.
2023-04-30 17:28:23 +02:00
Daniel - 28b9918325
Add utility function to create selector functions from table headers
This might be useful to work with table data from Org tables in source blocks,
maybe.

Does this exist somewhere already?
2023-04-30 17:26:56 +02:00
Daniel - 7bd8c0ef2b
Remove obsolete function to conditionally enable lispy
Not using this anymore.
2023-04-30 17:25:53 +02:00
Daniel - b67a920780
Fix wrong search region for inserting active filter display 2023-04-29 17:35:20 +02:00
Daniel - a44b7b660e
Remove obsolete function to skip tags in agenda views 2023-04-29 17:28:35 +02:00
Daniel - 8c9c47f6e3
Prominently display of active filters in agenda view
Displaying the current filters in the mode line alone often goes unnoticed for
me, so I need a more direct display.  Let's add it to the first structural
header.
2023-04-29 17:27:50 +02:00
Daniel - 2f1868da43
Only treat automatically named (e)shell buffers special
This allows to have custom named (e)shell buffers that are treated like any
other buffer, and not as the special bottom shell buffers.
2023-04-16 19:02:24 +02:00
Daniel - 71f07d1e8f
Remedy some flycheck and checkdoc warnings coming from `db-org.el` 2023-04-07 12:52:35 +02:00
Daniel - 347a3bf08d
Clean up personal Org utility functions
Mostly moving functions around and updating page headers.  Also removed some
obsolete functions, see updated command list for `db-org` use-package
declaration.
2023-04-07 11:49:58 +02:00
Daniel - c3a96fc342
Use display-buffer when jumping to currently clocked item 2023-04-06 18:10:56 +02:00
Daniel - c061357893
Note current limitation in computation of remaining effort time 2023-04-06 17:58:22 +02:00
Daniel - f120e4b01f
Remove redundant conversion of remaining effort durations
When sorting, we need the remaining efforts as numbers, so let's return those
numbers directly instead of first converting them to durations only for them to
be converted back to numbers.
2023-04-02 10:36:13 +02:00
Daniel - 866f652c4b
Fix nil display in agenda when remaining effort is not set
Just return the empty string instead.
2023-04-01 17:01:00 +02:00
Daniel - 0a14f01729
Sort agenda entries by remaining effort by default
This might be slow and buggy, but let's keep it for now.
2023-04-01 16:57:37 +02:00
Daniel - 1f9e032a1a
Display remaining effort in Org agenda by default
Note that sorting is wrong now, this needs to be fixed later.
2023-04-01 16:50:30 +02:00
Daniel - 7d5c6624e6
Improve eshell git prompt check for ongoing merges
Checking for filenames is fragile if gitdir files are being used (as is common
for submodules).  Better try to resolve MERGE_HEAD via git.
2023-03-23 20:02:40 +01:00
Daniel - 6bac3973f9
Make eshell git prompt function more robust
When checking whether we are in a git repository or not, remove all symbolic
links in the current path before looking for a .git in the current path;
otherwise, symbolic links might mislead `locate-dominating-file` to find some
.git directory which is only reachable via symbolic links, which subsequently is
ignored by git (rightly so!) and thus yields errors.

Also, catch the case that the current git repository is not initialized yet by
checking the return value of `git rev-parse --abbrev-ref HEAD`.
2023-03-23 19:50:35 +01:00
Daniel - 13cbd90ec6
Improve checklist insertion
Do not reveal whole subtree, but only the body.  Also jump to first open
checklist item after checklist insertion.
2023-03-21 16:52:27 +01:00
Daniel - ba9edc5f12
Display remaining effort of items in workload reports
This is rather experimental, but seems to work fine so far.  The most
complicated part is to compute the overall clocked time of an item.

Any clocktime modifiers like “today” or “total” are currently ignored.
2023-03-19 20:56:15 +01:00
Daniel - 10ee65f55a
Automatically set property to avoid double checklist insertions 2023-03-19 13:21:18 +01:00
Daniel - efa55cb75d
Insert checklists at end of subtrees, before possible children 2023-03-19 13:14:01 +01:00
Daniel - 26d9dc0614
Make inserting whitespaces around checklist a bit more intelligent
Not quite sure yet whether this is really it, and maybe it would be better to
create some new utility functions to ensure enough blank lines before and after
point.  But let's try it out first and fix it later.
2023-03-11 09:47:42 +01:00
Daniel - ddbcfee3d9
Allow to jump to template checklist instead of inserting it
This is a convenience shortcut.  Maybe the code to insert the complete checklist
also needs to go into another function, for implementatio clarity.  Do this as
soon as it seems appropriate or necessary.
2023-03-05 16:35:23 +01:00
Daniel - c5f1e98bf8
Make storing note upon headline change more robust
Let's not wait until our code turns out to be broken, but fix it now.
2023-02-14 16:42:34 +01:00
Daniel - fb60b22c5e
Reference blog entry showing how to programmatically add Org notes
The current implementation of `db/org-update-headline-log-note` seems to be
fine, but if it turns out to be broken, we can try the approach of Sacha Chua.
2023-02-14 16:30:10 +01:00
Daniel - 47d7e31800
Let display-buffer handle window placement for shells
This provides the same functionality, but makes it more configurable.
2023-02-13 13:22:51 +01:00
Daniel - 9b8d3d6d44
Ignore duplicates when computing daily agenda effort 2023-02-12 13:49:43 +01:00
Daniel - aec896c939
Always display shell buffers at bottom of frame in dedicated window
Inspired by https://www.masteringemacs.org/article/demystifying-emacs-window-manager.
2023-02-11 19:33:19 +01:00
Daniel - 95920f8291
Extend default scope for `db/org-get-location` when in agenda files
When inside a file that is part of `org-agenda-file`, the default scope to
search for locations via `db/org-get-location` (used for example when
interactively inserting links) is extended to include all agenda files, and not
only the current buffer.  The idea behind this is to consider all agenda files
as one large data collection, and not only individual files.  This inhibits the
usual error, when trying to insert links at items located in refile.org, that
links are only displayed for items in refile.org itself – which are usually not
many – when instead links to items in the default org files where actually
requested.

This should not be an issue for performance, as searching through all agenda
files for valid locations is fast even on Windows.
2023-01-20 18:39:00 +01:00
Daniel - d9b0543409
Remove obsolete warning in workload overview report docstring 2023-01-16 19:21:49 +01:00
Daniel - d373976965
Fix off-by-one error in workload overview report end-date handling
Pushed one to much, so just removed it afterwards.
2023-01-16 19:20:44 +01:00
Daniel - 558bb0b1cc
Make timestamp format in workload overview report consistent
Brackets for both timestamps.
2023-01-16 19:16:04 +01:00
Daniel - bb7da2e08e
Change timestamp format in workload overview report to internal time
`org-read-date` seems to have bug that it does not consider the hh:mm part of an
input string sometimes.  Trying to work around this by using internal times
whenever possible, but it's not complete yet.
2023-01-16 19:09:04 +01:00
Daniel - 4e5cad2842
Fix off-by-one error in workload overview report
Found that the report will only produce reasonable output when always working on
00:00.  Left a note in the docstring to warn about this, should be fixed later on.
2023-01-16 17:26:32 +01:00
Daniel - d699fc8450
Add property to exclude individual Org items as checklist backlinks
Use case: do not add a workload report (which usually contains links to all
current tasks) when inserting checklist backlinks; they do not carry any
information and are thus not relevant.
2023-01-13 22:31:41 +01:00
Daniel - fc4d6b7767
Fix some identation
but not all, in particular not the one of the `cl-flet` call; see
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=9622 for this.
2023-01-12 16:46:26 +01:00
Daniel - f534833520
Add caption with time for workload reports
Those reports are only relevant when known when they have been generated.

This is similar to the caption added to dynamic clocktable blocks.
2023-01-12 16:33:07 +01:00
Daniel - 2423dcf6cd
Fix start date in workload overview report to midnight
This is the expected behavior: when no start date is given, it should default to
today (the whole day), and not exactly now, so that day increments do not start
in the mid of the day, yielding misleading results.
2023-01-11 21:17:02 +01:00
Daniel - 28b2047ad6
Fix stacking of summed effort estimations upon agenda refresh
When refreshing the Org agenda without completing redrawing it (i.e, by calling
`org-agenda-filter-by-tag`), effort estimates where added for every refreshing,
causing them to stack up.  We now check whether a summed effort estimate is
already present and remove it before adding it again.

(Maybe one could also just skip the effort recalculation if the a summed effort
estimate is already present, but I am not sure whether this will cause display
inconsistencies when new events are added or old ones are deleted.)
2023-01-11 20:44:19 +01:00
Daniel - 6ed088d2da
Fix missing summation of time blocks in agenda 2023-01-11 20:22:29 +01:00
Daniel - a54ade74a4
Push links to Org items always to top of currently known links
When adding a link to an item via `org-store-link`, and the link is not known
yet, the links is always put at the beginning of the list of currently known
links, as stored in `org-stored-links`.  This allows to conveniently insert this
link via `org-insert-link` by just choosing the first element of the list, which
is selected by default.

However, when the link to the requested item is already present in
`org-stored-links`, the link is not pushed to the beginning of
`org-stored-links` by `org-store-link`, but kept where it is.  When calling
`org-insert-link` to insert a link to the item, manual selection of the correct
link is required, which is annoying and unnecessarily interrupting the current
workflow.  Even worse, when overlooking the notification that the link is
already stored, one will assume that the link to the requested item is at the
top of `org-stored-links` (which is isn't), subsequently inserting false links
when blindly calling `org-insert-link`.  (Yes, this has happend to me …)

This patch fixes this issue by ensuring that links to items (regardless whether
they have already been known or not) are always put at the front of the
`org-stored-links`.  This patch also removes the rarely used
`db/org-clear-stored-links` function, whose purpose was to provide some kind of
workaround, but turned out not to be convenient enough to actually be
used (because it also removed potentially useful links when clearing the cache).
2022-12-20 08:46:47 +01:00
Daniel - 461f212529
Simplify file pattern query for grep
The original version of `grep-read-files` includes file names in its default
values, giving an irritating completion candidate list when used with ivy.
Changed this to just let `completing-read` do the completion itself.
2022-12-15 16:29:36 +01:00
Daniel - 7c9f795a38
Add function to jump to template associated with the item at point 2022-12-15 14:16:52 +01:00
Daniel - 64bc1c762b
Jump to first open checkbox in currently clocked-in item by default
When no open checkbox is found, just jump to the headline of the item, as
before.
2022-11-19 16:09:38 +01:00
Daniel - 69f3f80a6e
Allow empty template when inserting checklists to Org item
In some cases, the backlinks may be sufficient as checklist.
2022-11-12 16:56:29 +01:00
Daniel - bba3adef3d
No not print empty backlink table when inserting checklist
In case there are not backlinks, replace the empty backlink table with a simple
"none".  I think that's cleaner :)
2022-11-12 15:46:49 +01:00
Daniel - d8c8e2b272
Do not backlinks in checklists when scheduled in the future
Items scheduled in the future are generally ignored, so let's do this in
checklists as well.
2022-11-12 11:50:53 +01:00
Daniel - 150b17c22b
Look up parent depth for backlinks in checklist via item property 2022-10-30 12:04:13 +01:00
Daniel - c9dcc7778e
Use Org builtin function to format links in strings 2022-10-29 10:17:28 +02:00
Daniel - e8fae32071
Match namespace prefix for project utilities with package name 2022-10-16 21:10:45 +02:00
Daniel - 4b4f187869
Update package comment for db-projects.el 2022-10-16 21:01:59 +02:00
Daniel - 425792a2ee
Do not create dummy directories when setting up a new project 2022-10-16 21:00:40 +02:00
Daniel - 72d6904968
Minor cosmetics in personal project utilities 2022-10-16 20:59:02 +02:00
Daniel - 7663b82800
Stop using “long names” in personal project utilities
They have only been used in project diaries, and since these are gone now, long
names should go too.
2022-10-16 20:58:11 +02:00
Daniel - 137bafeb0b
Remove bookmark management from personal project utilities
I stopped using project diaries some time ago, so let's get rid of this
functinality.
2022-10-16 20:56:28 +02:00
Daniel - 93fee67983
Remove obsolete eshell magit command
Just use `magit` directly, eshell understands this.
2022-10-13 17:22:31 +02:00
Daniel - 0c84493abc
Do not include TEMPLATE in inserted checklists
References to item at point contained in templates are usually not meant to be
considered manually, but just to automatically insert backreferences.
2022-10-09 11:36:43 +02:00
Daniel - 754e22dc77
Update function name and docstring for Org template copy function
We are now not merely copying a template from another item, but more abstractly
insert a checklist consisting of backlinks and a template.  Update docstring and
function name to reflect that, but keep the old name of `db/org-copy-template`
as an obsolete alias.
2022-10-09 11:22:36 +02:00
Daniel - 564990a1af
Automatically add backlinks when copying templates
Experimental

Backlinks are an integral part of the checklist for the item at point, so why
not include them per default?

Copying is for now done unconditionally and without any customization.  If those
will turn out necessary, then they will be added later.
2022-10-09 10:25:39 +02:00
Daniel - 799f1be1f6
Remove obsolete template copying functions
Everything is now covered by `db/org-copy-template`.
2022-10-09 09:56:09 +02:00
Daniel - 7169a6b83e
Allow general org-read-date syntax in workload overview report
This is already allowed by the docstring, but now also supported by calling
`org-read-date` on the original inputs (if given).
2022-10-07 15:45:53 +02:00
Daniel - 047627c6ac
Allow no start date in workload overview report
This is different from the previous default start date of today, as now all past
items will also be considered.  Additionally, also include the start date (or
today, if not given) to be included in the result table to show all efforts
still left for that day.
2022-10-07 15:42:02 +02:00
Daniel - bc3ab8b901
Fix template copy mechanism when template is in other buffer
Forgot to switch buffer when marker in other buffer is given.
2022-10-03 10:11:17 +02:00
Daniel - 12b001221c
Fix workload report in case of time range with individual timestamps
Simply replacing the first and last characters of a timestampt with `[` and `]`
is not sufficient when a time range is given with a start timestamp and an end
timestamp, because then the result would be something like `[2022-09-30 Fri
08:00>--<2022-09-30 Fri 09:00]`.  So let's replace all `<` with `[` and all `>`
with `]`, just to be save.
2022-09-30 14:54:30 +02:00
Daniel - befcf95d1f
Include deadlines in agenda time grid effort summary
When deadlines are listed on the time grid because they are due, their effort
should also be considered in the effort summary, shouldn't it?
2022-09-23 15:47:45 +02:00
Daniel - f4f69b34c7
Add first version of workload overview report
This report will list the incremental planned workload between a given time
range using a given increment.  This way, one may better at finding time to
schedule new tasks coming in.

The current implementation might be slow, because it's calling a complete
parsing process for each step in the overview report.  One could instead think
about calling it only once and then disecting the individual tasks for when they
are planned specifically.  But before we dive in these complications, let's
frist see whether the report is worth it.
2022-09-17 10:17:25 +02:00
Daniel - 5396c7c37f
Fix typo in workload report timestamp extraction 2022-09-15 10:22:27 +02:00
Daniel - 257c2c815d
Convert active timestamps in workload report into inactive ones
Otherwise, agenda views get mixed up.
2022-09-10 09:55:55 +02:00
Daniel - e5bad8b847
Allow entries in workload report to be sorted 2022-09-10 09:40:32 +02:00
Daniel - 735570d7c0
Include various timestamps in workload report
This should make it easier to decide which entries could be moved in case too
much work is planned for the upcoming days.
2022-09-10 09:25:37 +02:00
Daniel - cbd088977e
Update docstring for workload report 2022-09-10 09:17:41 +02:00
Daniel - 2e895a23fa
Allow nil dates in workload report to ignore those constraints
Emacs Lisp is fun :)
2022-09-10 09:12:02 +02:00
Daniel - 2616693233
Allow custom org-ql filter expression in workload report
Nice!
2022-09-08 18:37:42 +02:00
Daniel - 5ab5ec6aec
Format links in workload report to not include links themselves
Standard.
2022-09-07 18:06:36 +02:00
Daniel - 88a0d85006
Handle unset efforts in workload report 2022-09-07 17:41:09 +02:00
Daniel - 2e09ef6c9e
Add workload report functionality
This special kind of dynamic block inserts all planned tasks between two dates
and sums up it's efforts.  This could help in deciding what additional tasks to
accept or what dates to promise for completion of new tasks.
2022-09-06 18:34:12 +02:00
Daniel - 8b97b092c4
Allow to customize whether the eshell prompt contains the git state
Since all of this is slow on Windows, it's better to be able to disable it.

Sigh.
2022-08-31 18:43:35 +02:00