Commit graph

198 commits

Author SHA1 Message Date
Vincent Ambo
28ec16e618 feat(tools/emacs): Add a function to graph unread emails per label
This uses the built-in chart.el library to create a quick graph of the
number of unread emails in each notmuch tag. Some generic tags are
excluded from the overview.
2020-03-08 23:58:01 +00:00
Vincent Ambo
65e533431a refactor: emacsPackagesNg -> emacsPackages
The former is now just an alias for the latter anyways.
2020-03-08 23:20:03 +00:00
Vincent Ambo
6cbcadc2e4 feat(tools/emacs): Install org-journal & org-ql 2020-03-08 23:16:44 +00:00
Vincent Ambo
4c0e565fe1 feat(tools/emacs): Install cmake-mode 2020-02-26 15:20:41 +00:00
Vincent Ambo
bbab6cd1c1 feat(tools/emacs): Use patched rcirc 2020-02-24 16:40:43 +00:00
Vincent Ambo
4bbbb58cb5 chore: Rename pkgs->depot in all Nix file headers 2020-02-21 13:54:53 +00:00
Vincent Ambo
14b5447aac Merge branch 'feat/cheddar-extensions' 2020-02-09 12:07:10 +00:00
Vincent Ambo
31b3e533c6 chore(tools): Remove //tools/blog_cli
No longer needed with the deprecation of tazblog.
2020-02-09 01:30:25 +00:00
Vincent Ambo
ec42a67569 feat(tools/emacs): Bump EXWM to recent master
This version of EXWM fixes some issues with binding keys in EXWM as
well as other minor annoyances.
2020-02-07 12:41:43 +00:00
Vincent Ambo
c56968a767 feat(tools/emacs): Install ace-link
It now has vterm-mode support, which has finally convinced me to try it.
2020-02-05 11:58:57 +00:00
Vincent Ambo
dba2e5426e fix(emacs-pkgs/nix-util): Don't leave sly build out-links around 2020-01-27 02:11:04 +00:00
Vincent Ambo
a2d0b7f399 feat(emacs.d): Add interactive 'scrot-select' screenshot function 2020-01-26 19:13:59 +00:00
Vincent Ambo
fb5f26e548 feat(emacs.d): Add notmuch-depot-apply-patch helper function
This function lets me interactively apply a patch from the currently
opened notmuch message to the depot.
2020-01-24 18:51:13 +00:00
Vincent Ambo
98cc5f9fac feat(emacs.d): Add key binding for counsel-notmuch 2020-01-22 17:26:11 +00:00
Vincent Ambo
8f68497269 fix(emacs-pkgs/nix-util): Ensure compatibility with non-native JSON 2020-01-20 00:58:46 +00:00
Vincent Ambo
d752cbecc0 feat(cheddar): Add toggle flag for about-filter behaviour
Cheddar now needs to be passed the --about-filter flag to toggle the
behaviour for rendering Markdown into HTML.

By default Markdown will be highlighted like normal source code (i.e.
cgit source-filtering is the default behaviour).
2020-01-19 23:54:30 +00:00
Vincent Ambo
0b3b8a07c4 feat(emacs): Install geiser for Guile 2020-01-19 19:35:27 +00:00
Vincent Ambo
9879703155 fix(emacs-pkgs/dottime): Do not call telega macros in advice setup
This advice is potentially defined before the autoloads for telega
have run, which means that the macro-expansion fails and
`telega-ins-fmt` is looked up as a function.

With this setup the initialisation works as expected.
2020-01-19 16:48:11 +00:00
Vincent Ambo
f09c6a8ecd feat(emacs.d): Switch font to JetBrains Mono
Lets evaluate this for a bit. With the current settings it even seems
to render _okay_ on nugget.
2020-01-19 16:39:21 +00:00
Vincent Ambo
3567f8bd0a fix(emacs.d): Use "light" Input font on nugget 2020-01-19 02:27:54 +00:00
Vincent Ambo
bdd488ce27 fix(emacs-pkgs/nix-util): Use lexical-let to allow variable capture
The lambda that acts as the sentinel for building SBCL with packages
needs to be able to capture variables if lexical binding is enabled,
which is made possible by the lexical-let form.
2020-01-17 19:09:46 +00:00
Vincent Ambo
815a224744 feat(emacs): Install lispy for evaluation
Not configuring this automatically yet, I mostly want to try it out.
2020-01-17 17:48:13 +00:00
Vincent Ambo
86c8275a53 fix(emacs.d): Load relevant modes for Lisp development in IELM 2020-01-17 16:52:17 +00:00
Vincent Ambo
381a859b3b feat(emacs-pkgs/nix-util): Add nix/sly-from-depot function
Adds a function that can launch Sly with a pre-configured SBCL for a
Lisp derivation in the depot.

This makes it convenient to spin up development environments for Lisp
libraries and programs by simply calling `M-x nix/sly-from-depot RET
tools.something`.

This relies on `nix-depot-path` being configured currently as I have
not yet reliably added the depot to my NIX_PATH on all machines.
2020-01-17 16:43:49 +00:00
Vincent Ambo
bfd0bc2a79 feat(emacs.d): Configure Sly for Common Lisp
Sets up Lisp modes in Sly REPL and points at the local hyperspec
checkout.

In fact the Hyperspec bit should probably be managed by Nix, but one
step at a time.
2020-01-15 11:42:19 +01:00
Vincent Ambo
829de752da fix(emacs.d): Trim superfluous whitespace from TODO comments 2020-01-11 23:23:46 +00:00
Vincent Ambo
2236d43ff7 feat(cheddar): Implement callout paragraphs
Implements support for tagging paragraphs that begin with a callout
word (TODO, WARNING, QUESTION, TIP) with an additional `cheddar-*`
class that makes it possible to render these callouts specially.

This is currently not the nicest implementation, but it works.
2020-01-11 05:06:36 +00:00
Vincent Ambo
d4e469508f refactor(cheddar): Extract code block highlighting into function
Since I am going down the path of adding additional Markdown
extensions it makes sense to avoid letting `format_markdown` turn into
a giant beast of a function.

Therefore this commit extracts the logic for rendering code blocks via
syntect and changes the innards of `format_markdown` to instead
provide arbitrary AST value replacements.
2020-01-11 02:17:19 +00:00
Vincent Ambo
cd0093d46e fix(emacs): Minor typo fix 2020-01-08 00:32:56 +00:00
Vincent Ambo
9e2f86d65d chore(emacs): Bump emacs-libvterm to a more recent version 2020-01-07 22:28:36 +00:00
Vincent Ambo
efc782fcdc fix(emacs): Disable linking of imagemagick due to vterm crashes
See explanatory comment.
2020-01-07 22:28:17 +00:00
Vincent Ambo
1e71b80f6a fix(emacs): Build emacs with imagemagick support 2020-01-05 17:37:01 +00:00
Vincent Ambo
b2cd30bfd4 chore(emacs.d): Remove edwina configuration
Sounds good, doesn't work.

(Okay, it does - but not like I want it to and with too many caveats
at the moment - maybe later)
2020-01-05 01:13:00 +00:00
Vincent Ambo
3638048c9b fix(emacs.d): Use 'fish' from $PATH when launching vterms
This is required because the configuration is used on machines where
fish comes from Nix, and on ones where it does not.
2020-01-04 22:50:19 +00:00
Vincent Ambo
41232a1c78 feat(emacs.d): Toggle email signature manually with C-c C-w
The signature itself is read from ~/.signature
2020-01-01 16:28:47 +01:00
Vincent Ambo
39131d9e0f fix(emacs.d): Disable notmuch FCC directories 2019-12-30 22:19:56 +01:00
Vincent Ambo
08dd267c19 chore(dottime.el): Remove advice for notmuch date rendering
This code has moved into a patch for notmuch itself.
2019-12-27 19:18:00 +01:00
Vincent Ambo
100f451b0a fix(dottime.el): Defer package-specific setup 2019-12-27 13:04:49 +01:00
Vincent Ambo
a54cc040ad fix(emacs.d): Load dottime.el after libraries that it modifies 2019-12-27 12:54:12 +01:00
Vincent Ambo
309d1ac50f feat(dottime.el): Support dottime display in notmuch thread view
Advises notmuch to display `Date` headers using dottime.
2019-12-27 12:54:12 +01:00
Vincent Ambo
29e71053be feat(dottime.el): Add arbitrary offsets & prefixes to dottime-format
This gives users from Elisp slightly more flexibility about the
display of dottime.
2019-12-27 12:54:12 +01:00
Vincent Ambo
5fd7de921b feat(dottime.el): Use dottime in telega.el, too 2019-12-27 12:54:12 +01:00
Vincent Ambo
b48797e4ce chore(emacs.d): Remove explicit FCC dir for private account
No longer required because Gmail does this automatically.
2019-12-26 15:14:37 +01:00
Vincent Ambo
cf9dd380f3 chore(emacs.d): Remove GPG agent warmup from mail sending
Fetching credentials is no longer handled by msmtp itself.
2019-12-26 14:13:40 +01:00
Vincent Ambo
29af390e8c fix(emacs.d): Slightly more reliable way of setting edwina prefix 2019-12-25 14:10:00 +01:00
Vincent Ambo
b59788779a fix(emacs.d): Display newest emails first in notmuch 2019-12-25 14:09:42 +01:00
Vincent Ambo
4a0cf0de98 fix(emacs.d): Avoid advising split-window-* functions
Advising these functions apparently breaks things internally.
2019-12-24 18:43:52 +01:00
Vincent Ambo
637cb0bd2a fix(emacs.d): Pick new buffers *into* the active window
Instead of splitting below and moving the target buffer into the new
split, split and move the buffer into the active window.

The other way around does (for some reason I don't fully understand)
not work because `split-window-below` may return invalid windows.
2019-12-24 18:15:30 +01:00
Vincent Ambo
ceaa0ff0ba feat(emacs.d): Advise split-window-below to call edwina-arrange 2019-12-24 15:43:24 +01:00
Vincent Ambo
86c2ebc096 feat(emacs.d): Enable edwina package for window management
Configures edwina using `s-w` as the key prefix (in line with my other
EXWM-related commands).

An additional function is added that switches to a buffer (borrowing
the implementation from `ivy-switch-buffer`) but splitting it into a
new window instead.
2019-12-24 15:30:25 +01:00
Vincent Ambo
ccd31b8898 feat(emacs.d): Bind 's-g m' to notmuch UI 2019-12-23 16:05:05 +01:00
Vincent Ambo
a36e9f817d fix(cheddar): Fix errors if filename does not have an extension 2019-12-22 15:21:23 +00:00
Vincent Ambo
f1c018af18 feat(emacs): Install edwina package
No configuration for this yet, I just want to try it out. It seems
like an interesting way of managing Emacs windows!
2019-12-22 14:30:28 +00:00
Vincent Ambo
03acae2f85 feat(cheddar): Style pre-elements for better readability
Uses GitHub-like styling for <pre> elements, i.e. slight padding and
background colour highlighting.
2019-12-21 16:18:26 +00:00
Vincent Ambo
f904951384 feat(cheddar): Render code blocks in Markdown via syntect
Implements fully static (i.e. no JavaScript!) highlighting of code
blocks when rendering Markdown.

This works by walking through the Comrak AST and replacing any code
blocks with pre-rendered HTML blocks.

Syntaxes are chosen based on the "block info", which is the string
users put after the block's opening fence. This can either be
a (case-insensitive) name of a syntax, or alternatively a file
extension associated with the desired syntax.

The theme is set to one that imitates GitHub.
2019-12-21 15:57:02 +00:00
Vincent Ambo
671dbc7f72 docs(cheddar): Mention cgit filter compatibility in README 2019-12-21 15:56:44 +00:00
Vincent Ambo
d6c255a35d feat(cheddar): Render Markdown via Comrak
Renders any ".md" file by pushing it through the Comrak rendering
pipeline.

This does not yet implement syntax highlighting of fenced blocks, but
we're getting there.
2019-12-21 14:49:35 +00:00
Vincent Ambo
d35aa4ae46 refactor(cheddar): Set up scaffolding for Markdown rendering
Generalises the two bits of the program that will be required either
way (extension parsing and syntax loading).

A dependency on Comrak is introduced as I think GitHub-flavoured
Markdown (with all its fancy extensions) is desirable!
2019-12-21 14:09:12 +00:00
Vincent Ambo
81d9b81b06 feat(cheddar): Use syntax highlighting assets from bat
This uses Nix to inject the path to the syntax highlighting assets
that ship with the bat source code into the cheddar build at compile
time, where the Rust compiler then inserts it into the binary via
macros.

bat has a lot of custom syntax highlighting definitions that they
collected from all over the place (including for languages like Nix!)
and this makes them accessible to cheddar.

Also if you're reading this, can you just take a moment to appreciate
how incredible it is that Nix just lets us do something like this?!
2019-12-21 04:55:10 +00:00
Vincent Ambo
4681c07bde feat(tools/cheddar): Check in new syntax highlighting tool
The first step with this tool will be to use it as a source-filter for
cgit. The second step is to use it as the Markdown renderer by
depending on one of the Markdown libraries, with integration for
rendering code snippets directly.
2019-12-21 04:54:57 +00:00
Vincent Ambo
03bfe08e1d chore: Significantly restructure folder layout
This moves the various projects from "type-based" folders (such as
"services" or "tools") into more appropriate semantic folders (such as
"nix", "ops" or "web").

Deprecated projects (nixcon-demo & gotest) which only existed for
testing/demonstration purposes have been removed.

(Note: *all* builds are broken with this commit)
2019-12-20 20:18:41 +00:00
Vincent Ambo
e900c4279b feat(journaldriver): Add Naersk-based build configuration 2019-12-20 20:03:36 +00:00
Vincent Ambo
384ade5e39 merge(journaldriver): Merge journaldriver into tools/journaldriver 2019-12-20 19:44:19 +00:00
Vincent Ambo
5c0f874229 chore(tools/journaldriver): Prepare tree for depot merge 2019-12-20 19:43:50 +00:00
Vincent Ambo
7158d56499 fix(tools): Correctly resolve kms_pass->pass
The binary name doesn't match the one inside of the derivation, but
this is intentional.
2019-12-20 13:13:06 +00:00
Vincent Ambo
da9dd45ebf fix(emacs.d): Correctly restore default font size in randr-single 2019-12-20 12:37:16 +00:00
Vincent Ambo
90ebd154ca feat(emacs.d): Add key binding for opening telega 2019-12-19 15:19:24 +00:00
Vincent Ambo
c1a5d7d62a feat(emacs): Add telega.el support
Packages the telega-server binary and adds the required mode into
Emacs.

Unread message count is displayed in the modeline, which is neat.

Probably need to figure out some key bindings for this.
2019-12-19 14:48:22 +00:00
Vincent Ambo
166aff23bc fix(nix-util): Correctly enable lexical scope in this library 2019-12-19 14:23:14 +00:00
Vincent Ambo
c2f97577f7 feat(emacs-pkgs): Introduce nix-util helper library
Adds an Emacs library with so far a grand total of one helper function
that can prefetch and insert a git repository at point.

This is very useful for the various Go repo imports I am doing at the
moment.
2019-12-19 01:40:27 +00:00
Vincent Ambo
a40c2474fe feat(emacs.d): Set screen-specific default text scales 2019-12-17 17:48:13 +00:00
Vincent Ambo
be28071e56 feat(emacs.d): Add functions & bindings to manage global font size
This makes it possible to quickly adjust the size of text in all
frames using one keyboard shortcut. Each of these functions
understands a prefix argument to mean "please only operate on the
current buffer", hence the following bindings and effects:

Global:
* `C-=`: Increase the global font size (chosen because `+` lies on the
  `=` key)
* `C--`: Decrease the global font size
* `C-x C-0`: Restore the global default font size

Local:
* `C-u C-=`: Increase the local font size
* `C-u C--`: Decrease the local font size
* `C-u C-x C-0`: Restore the local default font size
2019-12-17 17:48:13 +00:00
Vincent Ambo
caf23a9e2a chore(emacs.d): Clean up unused functions 2019-12-17 12:33:15 +00:00
Vincent Ambo
940a9c580c feat(emacs.d): Add function to insert TODO comments 2019-12-17 12:09:44 +00:00
Vincent Ambo
cc68e28514 chore(emacs.d): Include all git repos under ~/ in magit 2019-12-17 11:47:30 +00:00
Vincent Ambo
ef3e5072ef fix(emacs.d): Fix regex passing in counsel-rg 2019-12-17 11:46:58 +00:00
Vincent Ambo
5727b6d24f refactor(emacs.d): Move ivy configuration to use-package 2019-12-17 11:46:41 +00:00
Vincent Ambo
7965f3ba3a fix(emacs.d): Disable C-x C-c 2019-12-17 00:45:30 +00:00
Vincent Ambo
3a719993fc fix(emacs.d): Change binding for ivy-browse-repositories
This avoids a conflict with some work tooling.
2019-12-17 00:38:18 +00:00
Vincent Ambo
0b6365efe5 fix(emacs): withLocalEmacs now loads packages via $EMACSLOADPATH
For some reason setting the initial load-path via `--directory` does
not work and leads to an Emacs without any packages.
2019-12-17 00:37:49 +00:00
Vincent Ambo
05168b9a3c feat(emacs): Add 'withLocalEmacs' override function
This function makes it possible to build an Emacs instance that,
instead of launching an Emacs built by Nix, configures an Emacs
already present on the system to use the packages built by Nix.

This **requires** that the versions of the two Emacsen (i.e. the one
used by Nix to build and the one used to run the packages) are kept in
sync, otherwise byte-code incompatibilities may lead to undefined
behaviour.
2019-12-16 23:57:32 +00:00
Vincent Ambo
43f07099a7 feat(emacs): Install 'request.el', an HTTP client 2019-12-16 23:57:17 +00:00
Vincent Ambo
99909ddd04 feat(emacs): Add withLocalConfig override function
This function makes it possible to pass in a folder with additional
local configuration from somewhere downstream.
2019-12-16 13:33:29 +00:00
Vincent Ambo
6ae799e8c8 feat(emacs): Make list of packages overridable
Exposes an `overrideEmacs` which can take a package function that
receives the current package list and can make arbitrary modifications
to it.

This makes it possible for me to maintain a private overlay for e.g.
work purposes with packages that should not be visible in my public
repos.
2019-12-16 11:59:07 +00:00
Vincent Ambo
67a9b3cc52 feat(emacs.d): Install refine 2019-12-16 11:38:22 +00:00
Vincent Ambo
e5839306f8 fix(emacs.d): Set correct magit-repository-directories path
This was set to my old home directory name from a different machine
and I had low-key been wondering why it didn't work, but not enough to
go do something about it.
2019-12-16 10:04:46 +00:00
Vincent Ambo
6108759688 fix(term-switcher): Add dependency on vterm 2019-12-16 03:57:03 +00:00
Vincent Ambo
20ef6710e0 fix(emacs.d): Only highlight current line in prog-modes
This is extremely annoying in vterms, so now it's gone!
2019-12-16 03:56:12 +00:00
Vincent Ambo
d63996c3cb feat(term-switcher): Use emacs-libvterm instead of launching X-terms 2019-12-16 03:51:28 +00:00
Vincent Ambo
e991834275 feat(emacs.d): Install and configure emacs-libvterm
This incredible package provides a fully functional, libvterm based
terminal emulator inside of Emacs.

Killer feature: It's possible to switch the buffer into a full Emacs
text mode (read-only) for selections and such.
2019-12-16 03:51:28 +00:00
Vincent Ambo
6b72c45ad3 feat(aoc2019): Add solutions for day4
Finally an excuse to use some cl-defstruct magic in Elisp!
2019-12-16 01:42:29 +00:00
Vincent Ambo
cc51fb6ce7 feat(aoc2019): Add solution for day3/2 2019-12-16 00:45:25 +00:00
Vincent Ambo
458163910b chore(emacs.d): Use local term-switcher package 2019-12-15 22:55:43 +00:00
Vincent Ambo
f34c82f765 refactor(emacs-pkgs): Extract term-switcher into separate emacs pkg 2019-12-15 22:54:58 +00:00
Vincent Ambo
9f8542fe75 chore(emacs.d): Remove smartparens
I actually find a lot of its behaviour very annoying, rather than
smart. Good old electric-pair-mode usually does what I want.
2019-12-15 22:54:58 +00:00
Vincent Ambo
97555884e2 fix(emacs.d): Fix uses use-package's :config instead of :init
In several places I used `:init` instead of `:config` and things
worked due to lazy loading anyways.

That's no excuse not to fix it though ...
2019-12-15 22:54:58 +00:00
Vincent Ambo
6ee061e205 refactor(emacs.d): Use dottime from my dottime package
Instead of locally advicing format-time-string, use my dottime
package.
2019-12-15 22:54:58 +00:00
Vincent Ambo
2bf2567284 feat(emacs-pkgs): Check in separate dottime package
This package adds a toggle for displaying modeline time in dottime, as
well as a function for formatting time as dottime generically.
2019-12-15 22:54:58 +00:00
Vincent Ambo
02e2877193 chore(emacs): Move carp-mode to third-party 2019-12-15 20:55:46 +00:00
Vincent Ambo
00c9060c2f feat(emacs.d): Introduce custom mc/mark-dwim cursor marker
Adds a "do what I mean" multiple-cursor selection with the logic that
I find most useful:

* If there is no active region, mark the next line (or lines, based on
  prefix argument)
* If there is an active region that spans multiple lines, call
  `mc/edit-lines`
* If there is an active region on a single line, trigger a custom
  selection hydra with functionality equivalent to
  `mc/mark-more-like-this-extended` but a slightly improved user
  experience

Hopefully this will make it easier to get into the habit of actually
using multiple-cursors without calling the mc commands via M-x
2019-12-15 17:13:17 +00:00