Commit graph

29 commits

Author SHA1 Message Date
William Carroll
e61965cafd Drop support for compton
I'm finding myself running `pkill compton` offer. In the spirit of slimming down
my configuration, I'm dropping support for compton.
2020-02-17 21:18:03 +00:00
William Carroll
6051654527 Support additional notmuch saved queries
Today I setup declarative gmail filters using some Google internal tooling. I'm
now adding labels to messages from Critique, Sphinx, Ganpati, "The Daily
Insider", messages sent directly to me, and more. These labels are applied
server-side.

On the notmuch, client-side, I'm support saved queries for these newly created
gmail labels.
2020-02-16 17:16:05 +00:00
William Carroll
08c3f6dd69 Support KBDs for labelling emails
I can already tag emails with `+` and `-`. Here I'm defining KBDs for moving
messages from my inbox into: action, review, and waiting. I'm also mutually
excluding messages in action, review, and waiting from inbox and vice versa.

I'm also supporting a "muted" tag for now; I'm still learning how to use notmuch
with email threads, but I'm hoping the "muted" tag will prevent future messages
in a thread from arriving in my inbox.
2020-02-16 17:13:21 +00:00
William Carroll
1ed7f2ed73 Prefer newest-to-oldest sorting
The default sorting order of results from notmuch.el are in
oldest-to-newest. This prefers the opposite.
2020-02-14 18:01:38 +00:00
William Carroll
0456a1c4b4 Define notmuch KBDs
Until I have more opinions about my workflow with notmuch, I will redefine the
KBDs from Gmail that I'm comfortable with. While not many KBDs are defined here,
evil-collection defines dozens, many of which I find reasonable; those that I
disagree with, I've unbound in this commit.

Composing emails in notmuch feels similar to writing a commit message with
magit. I want to be able to type :x or :wq, but these commands don't DWIM. For
magit, I'd like that behavior to be the same as `C-c C-c`; not surprisingly, for
notmuch, I'd like the same.

I've bound :x to do this for notmuch. I'd like to define a macro that can easily
define buffer-local evil-ex commands for particular modes. This should lower the
cost of defining evil-ex commands and hopefully convince me to support some of
this desired behavior.
2020-02-14 15:38:28 +00:00
William Carroll
8105af7b8d Configure saved searches for notmuch
Mimmicking the "action", "review", and "waiting" labels that I had in Gmail
using the equivalent labels as tags in notmuch.
2020-02-14 15:38:05 +00:00
William Carroll
fa779ab7bf Support list/xs-distinct-by?
Supporting a predicate to check that all elements in a list are distinct after
applying a transformation function to them.
2020-02-14 15:34:56 +00:00
William Carroll
1a484b4b91 Disable auto pairing parens, brackets, quotes
I don't see much value in this tool for my workflow.
2020-02-12 18:07:31 +00:00
William Carroll
d81f31107d Support cycling through display configurations
Today when I opened my laptop, I wasn't sure if it was powered off or on because
the display was blank. Thankfully the volume was muted and the LED indicator was
on, which informed me that the laptop was powered on. This saved me from
unnecessarily rebooting.

What happened was that last night I was working from home and using my external
monitor. Usually I enable my external display and disable my laptop display. But
when I left for work this morning, I unplugged the HDMI cable from my laptop
without disabling the external display or enabling the laptop display.

I noticed a XF86 button on my laptop entitled XF86Display. I figured that this
could be a nice place to bind a key to toggle my laptop display on or off. At
the last minute, I had the idea to just cycle through all possible display
configurations that I use; there are only three anyways. When dealing with more
than two states, I realized I should use a cycle to model the configuration
states. Now I'm thinking that I should be using cycles to model toggles as well
- instead of just using a top-level variable that I `setq` over. I haven't
refactored existing toggles to be cycles, but I am excited about this new
keybinding.

This commit additionally:
- Moves keybindings out of display.el and into keybindings.el
- Conditionally sets KBDs if using work laptop
2020-02-11 13:56:10 +00:00
William Carroll
3fa8276816 Support C-k for upward movement in ivy-switch-buffer-map
Without these KBDs, C-k kills buffers. As an evil-mode user, I expect C-k to
move upwards. As such, adding the `ivy-switch-buffer-map` to my existing ivy
KBDs that handle a similar use-case.

Note: I'm unsure why the KBDs in evil-collection didn't cover this.
2020-02-10 11:36:09 +00:00
William Carroll
52831c7136 Disable ido-mode
For awhile I had a mixture of ivy and ido. Disabling ido and preferring ivy for
everything.
2020-02-10 11:35:27 +00:00
William Carroll
2af05f698c Support vterm-mgt.el
I enjoyed using term-switcher so much that I ended up adopting vterm as my
primary terminal. After reaching for vterm as often as I did, I realized that I
would enjoy supporting cycling through instances, creating new instances,
deleting existing instances, renaming instances. Thus spawned vterm-mgt.el.

I'm particularly excited about the KBD to toggle between vterm instances and
source code buffers.
2020-02-10 10:06:40 +00:00
William Carroll
8584059e7c Support cycle/{append,remove}
Supporting these functions was a little tricky. For example, how should we
handle calling cycle/remove on the item that is currently focused? After
attempting to be clever, I decided to just set the value to nil and let the
consumer decide what is best for them. I can always support a more opinionated
version that fallsback to previous-index if previous-index is set. But until I
have a better idea of how I'm going to consume this, I think nil is the best
option.
2020-02-10 10:06:33 +00:00
William Carroll
f145bc9eb6 Support cycle/focus-item
I oftentimes call `cycle/focus` and pass `(lambda (a) (equal a b))`. This
function should tighten up my code.
2020-02-08 15:55:59 +00:00
William Carroll
3f54dd8601 Support cycle/empty?
Add predicate for determining if a cycle contains items.

Updated cycle/{new,from-list} to support setting current-index to nil when a
consumer calls it with an empty list.
2020-02-08 15:55:53 +00:00
William Carroll
52d284f59d Remove assertions that prelude/executable-exists?
I'm in the midst of transitioning onto a few new tools.

My previous workflow just used `nix-env` to install *some* packages. I didn't
have a prescribed methodology for which packages I would install using `nix-env`
and which ones I would install using `sudo apt-get install`. Sometimes if a
package would be available in my aptitude repositories, I'd use that; other
times when it wasn't available I'd use `nix-env`. One complication about being
on gLinux intead of NixOS is that some packages (e.g. nixpkgs.terminator) is
available via `nix-env -iA nixpkgs.terminator`, but the installation won't
actually run on my gLinux. In these instances, I would install terminator from
the aptitude repositories.

Then @tazjin introduced me to his Emacs configuration that he builds using
Nix. What appealed to me about his built Emacs is that it worked as expected on
either a NixOS machine and on gLinux (and presumably on other non-NixOS machines
as well).

A setup towards which I'm working is to own one or a few NixOS machines whose
configurations are entirely managed with Nix. On devices like my work machines,
which cannot run NixOS, I can build as much of the software that I need using
Nix and attempt to minimize the ad hoc configuration either with shell scripts,
python, golang, or more Nix code... it's clear that I still don't have a clear
idea of how that part will work.

For now, I'm adopting nix, nix-env, lorri, direnv, and weening off of aptitude
as much as I can. Things are a bit messy, but my general trend feels
positive. Stay tuned for more updates.
2020-02-07 11:01:24 +00:00
William Carroll
b4dd290745 Temporarily disable initialization code
My Emacs initialization fails for a few reasons, which I haven't prioritized
time to investigate yet:

- Some OCaml deps are absent
- godoc is absent
2020-02-05 23:33:29 +00:00
William Carroll
05135ef875 Further configure Go tooling
- Prefer goimports to gofmt. goimports calls gofmt; it also adds and removes
  dependencies.
- Assert the presence of goimports, godoc, godef
- KBD godef to M-.
- Support the M-x compile command for calling `go build -v`
2020-02-05 17:58:15 +00:00
William Carroll
cce926d60f Remove KBDs supporting undesired Ergodox configuration
I mistakenly mapped one of my dual-function keys on my Ergodox to send Shift+CMD
instead of CMD. When some of my Emacs keybindings weren't firing, I noticed that
the key event they received was some like `C-S-s-<char>` instead of say
`C-s-<char>`. As a quick fix, I duplicated each of my keybindings that relied on
the CMD key to support Shift+CMD as well until I remapped the key on my
Ergodox. This morning, I remapped the Shift+CMD key to CMD, so I'm bidding adieu
to this code.
2020-02-03 10:54:15 +00:00
William Carroll
4de3e5c392 Add KBDs to vterm
Support pasting and scrolling.
2020-02-02 18:31:39 +00:00
William Carroll
ffbe5c9757 Support emacs fn for rebuilding wpcarros-emacs
Call `M-x` `nix/rebuild-emacs` to build and link `wpcarros-emacs`.
2020-02-02 18:31:33 +00:00
William Carroll
2cfcb1c34d Support focusing EXWM X-application buffers
Press `<M-escape.` to display a list of buffers hosting X applications. Use
`completing-read` to select and focus one of these.

See the function docs and TODOs for more information.
2020-02-02 18:31:33 +00:00
William Carroll
2e76601f70 Blacklist additional non-source-code modes
I don't want vterm buffers or magit buffers showing up when I cycle throw
buffers.
2020-02-02 18:31:33 +00:00
William Carroll
5521db80b1 Attempt to debug xrandr behavior in display.el
Currently, after I connect my monitor to my laptop, I run `display/enable-4k`,
which will use `xrandr` to enable the display. The scaling of the enabled
display is not what I expect. So I've habituated re-running the same function,
`display/enable-4k`, which scales the display and meets my expectations.

What's strange is that if instead of running `display/enable-4k` the first time
from Emacs, I call `xrandr ...` from a terminal, this enables the display and
scales it properly on the first invocation.

I'm unsure how to explain this behavior. It's possible that a environment
variable is set properly in the terminal that isn't set in my Emacs, but this is
just a guess.

I'm going to using a different invocation in display.el that explicitly passes
the monitors dimensions. Let's see if that works.
2020-02-02 18:31:32 +00:00
William Carroll
2ec436b2b5 Support KBDs for term-switcher package
To facilitate transitioning from using `terminator` to using `vterm`, I'm
defining some KBDs that I hope will help me habituate my usage of `vterm`.
2020-02-02 18:31:32 +00:00
William Carroll
851aba8201 Support timestring.el
Quickly access strings that encode time is various formats. See the module docs
in timestring.el for more information.
2020-02-02 18:31:32 +00:00
William Carroll
e8b47d5030 Support golang
I decided to start writing go code for scripts instead of python. I think this
will be a learning opportunity for me and should increase the integrity of my
scripts by adding some static type checking.
2020-01-31 23:18:59 +00:00
William Carroll
837cfe07c7 Rename dotfiles -> briefcase
Renaming my mono-repo briefcase.

I first introduced this commit in master, but it introduced a bug where one of
two things would happen:

1. Emacs wouldn't start and would crash X.
2. Emacs would start but my keyboard wouldn't work.

I learned some valuable debugging skills in the process. Here are some of them:

When my keyboard was broken, I wanted to control my computer using my
laptop. Thankfully this is possible by using `x2x`, which forward X events from
the SSH client to the SSH host.

```shell
> # I'm unsure if this is the *exact* command
> ssh -X desktop x2x -west :0.0
```

Git commit-local bisecting. I didn't need to do a `git bisect` because I knew
which commit introduced the bug; it was HEAD, master. But -- as you can see from
the size of this commit -- there are many changes involved. I wanted to binary
search through the changes, so I did the following workflow using `magit`:

- git reset --soft HEAD^
- git stash 1/2 of the files changed
- re-run `nix-env -f ~/briefcase/emacs -i`
- restart X session
- If the problem persists, the bug exists in the non-stashed files. Repeat the
  process until you find the bug.

In my case, the bug was pretty benign. Calling `(exwm/switch "Dotfiles")` at the
bottom of `window-manager.el` was failing because "Dotfiles" is the name of a
non-existent workspace; it should've been `(exwm/switch "Briefcase")`.

There may have been more problems. I changed a few other things along the way,
including exposing the env vars BRIEFCASE to `wpcarros-emacs` inside of
`emacs/default.nix`.

The important part is that this was a valuable learning opportunity, and I'm
glad that I'm walking away from the two days of "lost productivity" feeling
actually productive.
2020-01-31 15:27:48 +00:00
William Carroll
578ed1ba98 Move move .emacs.d out of configs/shared
Moving all of my Emacs-related files into their own directory at the root of
this repository.
2020-01-30 16:00:29 +00:00