Commit Graph

131 Commits

Author SHA1 Message Date
Daniel - 83421c072a
Remove trailing whitespace after HTML rendering a file
Those whitespaces are neither necessary nor helpful.
2022-02-06 20:57:36 +01:00
Daniel - eafebe1cb9
Add simple function to directly render html from a file
This is simpler than opening the file in a buffer and calling shr-render-buffer,
with some buffer maneuvring afterwards.
2021-12-13 21:17:45 +01:00
Daniel - 6064f0e4b3
Add more test cases for base45 decoder 2021-11-07 10:04:16 +01:00
Daniel - b072e32988
Add more test cases for base45 decoder function 2021-11-07 09:10:09 +01:00
Daniel - 24bb768e3d
Simplify character conversion in base45-decode-string
This actually renders the separate translation function obsolete, it has been
inlined now.
2021-11-07 08:56:06 +01:00
Daniel - f1c3af9ea7
Add some regression tests for base45 decoder 2021-11-07 08:41:00 +01:00
Daniel - f52f48273a
Allow input of base45 decoder to also contain lower-case letters 2021-11-07 08:40:30 +01:00
Daniel - e15be73bc1
Fix insertion of text from hex numbers
Using `insert` directly makes use of character conversion and may scramble the
byte when inserting into the buffer (indeed, `insert` does not seem to insert
the byte, but the characters whose code-points is given in the string; same for
2021-11-06 17:49:49 +01:00
Daniel - a8cfeaf69f
Add simple function for base45 decoding
For playing around with EU Covid Certificates.
2021-11-06 17:49:46 +01:00
Daniel - ef2932fed7
Always print two bytes when converting text to hex 2021-11-06 15:35:29 +01:00
Daniel - a1f0acfd87
Add custom function to list git-annex files via dired
This can already be done by using `db/dired-from-shell-command`, but it's more
convenient to have a specific command for this.
2021-08-24 10:18:36 +02:00
Daniel - e14a7248b0
Directly complain when not file are available in custom dired view
Otherwise, a rather confusing error message is displayed about not being able to
find a file called "Command output" in the current directory.
2021-08-22 09:32:05 +02:00
Daniel - 106f286285
Include symlinks in custom file listings, even if they are dangling
When listing files, it's not relevant whether the file is readable or whether
a symbolic link points to a non-existing file.  What matters is that the file
itself exists, either as a file or as a symbolic link.

This is relevant when using `git annex find` to list files matching some search
2021-08-21 09:51:54 +02:00
Daniel - e4f02647a2
Refactor code to update magit's repository list to separate function
This allows easier updates of this list, without having resort to executing the
corresponding code manually.  In the future, we could even update that list
automatically by attaching the new function to some of projectile's hooks or
2021-01-17 09:15:01 +01:00
Daniel - 56c9f940ce
Fix line-ending issues with MIME and Outlook
Outlook seems to expect CRLF in S/MIME signed+encrypted mails, so we add those
somewhere in the process of encoding the mail.  Furthermore, Outlook is sending
MIME messages with CRLF line endings, and we have to take care of that when
looking for the end headers.

The changes proposed here are preliminary and subject to further testing.
2020-12-12 18:05:57 +01:00
Daniel - 6742695f53
Enable flycheck mode in Emacs Lisp only when buffer has a file
Flycheck used to be activated unconditionally, resulting in annoying warnings
when evaluating Lisp expressions in the minibuffer with `pp-eval-expression`,
and in the scratch buffer.
2020-11-28 08:50:47 +01:00
Daniel - 5961491f77
Replace custom imenu support use-package with builtin one
2020-09-11 16:47:28 +02:00
Daniel - c9e84a7e28
Offer simple completion when creating external bookmarks
In dired, offer all marked files, or the currently selected file if there are
none.  Otherwise, just use the list of recently opened files as completing.

This is meant as a very simple replacement for dired+'s dired bookmarks.
2020-09-07 18:10:44 +02:00
Daniel - 88e0a5021d
Add custom function for keyboard-quit
This version should also quit the minibuffer even if not selected.  Found at
2020-08-26 10:30:25 +02:00
Daniel - e38ae56584
Rework logic of `db/run-or-hide-shell'
It's a bit clearer now what the function is doing when ARG is given, I hope.  It
also turns out that switching to the current working directory does not make
much sense when we are in the shell buffer, because CWD is then just the, well,
current directory.  The original logic used to CWD of the previous buffer (by
closing the shell buffer and immediately reopening it), but that's actually not
what the function is supposed to be doing, is it?
2020-07-31 16:18:35 +02:00
Daniel - 25abde2d9c
Rewrite `db/run-or-hide-shell' to mimic EShell counterpart 2020-07-31 15:58:37 +02:00
Daniel - ac815a06f1
Close window when hiding current shell
For eshell we do the same.
2020-07-12 13:00:28 +02:00
Daniel - 72768b659f
Print result of `db/ntp-to-time' when called interactively
Otherwise no result is displayed.
2020-06-27 12:27:42 +02:00
Daniel - 5b6dcfe8d2
When switching themes, only do so temporarily
If changes need to be done permanently, customize `custom-enabled-themes'.
2020-06-27 11:16:49 +02:00
Daniel - c96083c871
Declare `w32-shell-execute' to silence byte-compiler 2020-06-27 09:42:16 +02:00
Daniel - f1932e7032
Fix precision error in `db/ntp-to-time'
A curcial step in the conversion, namly the computation of the actual time from
the seconds since the epoch, had been conducted with too little precision.  Now
the precision is fixed to a high value throughout the whole computation, and the
tests succeed again.
2020-06-27 09:35:31 +02:00
Daniel - b5ed51d8e8
Silence most byte-compiler warnings in `db-utils' 2020-06-27 09:03:23 +02:00
Daniel - 46d9973146
Move last Org Mode utility function from `db-utils' to `db-org' 2020-06-27 08:56:53 +02:00
Daniel - 0583c08cda
Move Org Mode utilities to `db-org'
`db-utils', the original place, is used for general purpose utility functions.
2020-06-26 23:21:37 +02:00
Daniel - 5009eb39f9
Move eshell popup function to `db-eshell'
That's where it belongs.
2020-06-26 23:08:00 +02:00
Daniel - 336ee9d7c4
Incorporate some suggestions from the byte compiler 2020-06-26 21:59:25 +02:00
Daniel - a404f9a8c2
Add missing `save-restriction' to template copy function 2020-05-24 16:46:24 +02:00
Daniel - fba18ca527
Add helper function to insert templates of periodic tasks
A periodic task is a task tagged with :PERIODIC:, and whose first child is an
item called "Template".  Following the template are the instances of the
periodic tasks, which constitute the actual things to do and which can be
scheduled independently of each other.  Whenever such an instance is due, the
template of the periodic task is supposed to be copied to the instance as a
first step.  This copying can be done manually, but of course doing it
automatically is easier.  The new function added in this commit represents a
first try to add such an automatism.
2020-05-23 16:25:13 +02:00
Daniel - 004ac490ef
Reintroduce helper functions to quickly switch between themes 2020-04-17 18:58:18 +02:00
Daniel - 7a78446a92
Make capitalization a bit more consistent 2020-04-17 18:50:01 +02:00
Daniel - 3fc25e3cad
Require customizations in utilities package
The function may make use of some custom variables, and this way we make sure
they are there when needed.
2020-01-19 17:21:32 +01:00
Daniel - 38f7fd7c88
Move some more custom org mode link handlers to `db-org'
This is where they belong, nowhere else.
2020-01-19 17:21:14 +01:00
Daniel - c566908deb
Let the org mode RFC link handler cache its documents
RFC documents do not change over time.  The custom org mode link handler
`db/org-rfc-open' now makes use of this by downloading RFC documents to
`db/rfc-cache-path' (if defined) and opening the files locally.  If
`db/rfc-cache-path' is not defined, the RFC is opened in an external browser as

This allows to keep a selection of used RFC documents locally on the filesystem
for future reference, without the need to retrieve them again from the IETF.

Since this is all org mode related, the handler now also resides in `db-org'
instead of `db-utils'.
2020-01-19 17:17:47 +01:00
Daniel - 31bde05efa
Add missing word in comment
Sorry, but need to have it there …
2020-01-18 10:25:40 +01:00
Daniel - 66eb5e3da4
Fix missing handling of optional NTP format string 2020-01-18 10:24:49 +01:00
Daniel - 010f3cec86
Reimplement NTP conversion using Calc
The previous implementation made use of `encode-time', which is not
guaranteed to work with times before the unix epoch.  Indeed, on at least one
Windows machine, the corresponding function `db/ntp-to-time' could not handle
such dates.  However, Calc can handle those independently of `encode-time',
and `db/ntp-to-time' has now been reimplemented in terms of the corresponding
Calc functions.

All (both) tests still pass.
2020-01-18 10:17:54 +01:00
Daniel - 158a232cfe
Move some personal customization variables to dedicated package 2020-01-11 12:35:53 +01:00
Daniel - f4b55ad777
Add tests for NTP time conversion 2020-01-11 10:13:30 +01:00
Daniel - df2464ce5b
Check input of NTP conversion function 2020-01-09 21:35:23 +01:00
Daniel - 57107c0c75
Prettify docstring 2020-01-09 21:35:12 +01:00
Daniel - 52de03a8c0
Note simple test case for NTP conversion function 2020-01-09 21:34:55 +01:00
Daniel - 97e3b4da13
Fix computation of seconds in NTP conversion function 2020-01-09 21:34:38 +01:00
Daniel - c16500344c
Globally require `dash' 2020-01-09 21:02:23 +01:00
Daniel - b92d5e7819
Allow spaces in NTP time strings 2020-01-09 21:02:18 +01:00
Daniel - f44ed54318
Fix handling of dates before Unix epoch in NTP conversion 2020-01-09 20:58:01 +01:00