Commit graph

211 commits

Author SHA1 Message Date
William Carroll
26bc3c01e5 Update displays.el
Today is my first day back in the office at Google (this time at MP2 in
Sunnyvale)! As such, I have a new desk, new monitors, so expect some changes to
my configuration until I stabilize everything.
2021-10-06 16:40:27 -07:00
William Carroll
b70dda5dcb Refactor window-manager-logout
`sudo systemctl suspend` wasn't working because it required a secure password
prompt to read the user's password for `sudo`. The recommended way to call
`shell-command` with a `sudo` command (from what I read online) is to set
`default-directory` to `/sudo::` before calling `shell-command`. This works just
fine, so I refactored the function, `window-manager-logout`.
2021-03-23 11:32:42 -04:00
William Carroll
02ce74eada Add elm-format-on-save-mode to elm-mode-hook
Instead of calling this manually.
2020-10-10 17:03:08 +01:00
William Carroll
fbd5e7fb18 Remove evil dependency from window-manager.el
When `keybindings` requires `window-manager`, the `evil-want-integration`
warning emerges. If I remove the `evil` dependency from `window-manager`, it
resolves the issue.
2020-10-04 18:27:38 +01:00
William Carroll
3ba4112849 Enable spell-checking during magit commit
This is another (overdue) change about which I'm quite excited. Add
spell-checking to my Git commit buffers. :)
2020-10-04 16:25:15 +01:00
William Carroll
48d9a70253 Extend "l" -> "L" KBD remapping for magit-{log,revision}-mode-map
Thankfully `general` made this change super easy and maintainable to support.
2020-10-04 16:23:25 +01:00
William Carroll
f3ee628a4c Support display-arrangement macro
I was tired of using `arandr` to manually configure my monitor positions, so I
encoded the settings in Elisp in the `display.el` module.

TL;DR:
- Drop support for `position` kwarg in `display-register` macro
- Support `coords` kwarg in `display-register`.
- `defconst` the `xrandr` arguments and command in `display-register`.
- Define `display-arrangement` macro that consumes the `xrandr` arguments that
  `display-register` defines to create an interactive function,
  `display-arrange-<NAME>`, which -- when invoked -- runs one xrandr command to
  configure a display "arrangement".
2020-10-04 16:20:16 +01:00
William Carroll
4187e888c8 Disable company-mode during git commits
Why didn't I configure this earlier? For years, my workflow involved checking a
buffer's major mode and then extending that major-mode's hook. Confusingly (to
me), the `major-mode` for `COMMIT_EDITMSG` is `text-mode`, and I didn't want to
disable `company-mode` for *all* `text-mode` buffers, which is what the
following would have done:

```elisp
(add-hook 'text-mode-hook (lambda () (company-mode -1))
```

Thankfully I recently invested some time into learning more about Emacs's
offline help system, `Info-mode`, so -- putting that knowledge to work -- I ran
`info-apropos` and searched "magit commit". After ~5 minutes of reading I knew
the recommended way of configuring this was to modify `git-commit-setup-hook`.

How validating!
2020-10-04 14:57:23 +01:00
William Carroll
6df182d45e Move KBDs from window-manager.el to keybindings.el
Assuming (hoping) that this doesn't break anything.
2020-10-04 13:57:01 +01:00
William Carroll
6eac1de187 Debug Emacs initialization
Since "Briefcase" doesn't exist, `window-manager--switch` fails and so does
`exwm-init-hook`. It'd be nice to catch these errors earlier...
2020-10-04 13:54:57 +01:00
William Carroll
562c82f3f2 Bind "g SPC" to #'Info-scroll-up
I'm using the "g <char>" pattern that evil-collection uses, which I think is
okay.
2020-10-03 18:15:32 +01:00
William Carroll
4cd552de28 Alter doom-acario-dark's font for comments
Thanks to my newly acquired `Info-mode` navigation skills, I quickly learned how
to alter fonts in Emacs!
2020-10-03 18:14:34 +01:00
William Carroll
a8704bb54d Define KBDs for ibuffer
I'd like to start using ibuffer more, so I'm making it a more hospitable place
by defining useful KBDs.
2020-10-03 14:51:04 +01:00
William Carroll
990b6278a8 Define KBDs for Info-mode
I took the Info-mode tutorial (finally) and I found some things from
evil-collection that I liked, other things that I didn't like.
2020-10-03 14:50:38 +01:00
William Carroll
4c809ebf59 Set ibuffer's default sort to major-mode
I find this a more intuitive default.
2020-10-03 14:50:10 +01:00
William Carroll
b4b929a55b Define window-manager-swap-workspaces
This is a wrapper around the existing `exwm-workspace-swap` except it's aware of
my `window-manager-workspace` struct.
2020-10-03 14:49:33 +01:00
William Carroll
869bcf3fc8 Define fn for outputting the current workspace's label
This is a useful helper fn, and hopefully something I'll support in my mode line
soon.
2020-10-03 14:49:02 +01:00
William Carroll
8137eed738 Rename workspaces
Prefer "Web Browsing" and "Coding".
2020-10-03 14:48:46 +01:00
William Carroll
174d676c93 Ensure "RET" follows links in Info-mode
Shouldn't this be handled by evil-collection?
2020-10-03 11:01:00 +01:00
William Carroll
fb5952857e Prefer doom-acario-dark theme
I recently looked at the updated Doom themes, and the screenshot for this one
looked appealing. I'm going to give it a try.
2020-10-02 11:30:02 +01:00
William Carroll
204c0beb83 Create a workspace for logs
Now that I have a vertical monitor, I'd like to use it for terminals and logs.
2020-09-29 13:54:41 +01:00
William Carroll
ce61987959 Extend named-workspace struct to include display information
I want to couple my EXWM workspaces with monitors. E.g. - I'd like my "Chatter"
workspace to prefer my `4k-vertical`. This change supports that.

I also did a small amount of formatting, which I don't think belongs in a
separate commit.
2020-09-29 11:21:09 +01:00
William Carroll
fc0c795c4e Debug failed Emacs initialization
My newly minted macro for defining monitors introduced two bugs:
1. Laptop defined its position in terms of 4k-horizontal and 4k-horizontal
   defined its position in terms of laptop, I introduced a circular dependency.
2. The identifier, `laptop-monitor`, which `window-manager.el` depends on, is
   now defined as `laptop`.

A friendly reminder to myself to always test new Emacs builds to make sure that
everything can initialize properly. This is something that my CI should be
automating, but ever since I moved flats, I lost my CI and need to restore it.

This is another reminder to drop into a TTY when Emacs fails to initialize, run
`nix-env --rollback`, then attempt to restart X. But this time, debugging this
entirely from a TTY wasn't so disappointing.
2020-09-29 10:10:24 +01:00
William Carroll
e41ca803c6 Support display-4k-vertical in exwm-randr-workspace-monitor-plist
EXWM needs to know about my newly defined monitor.
2020-09-28 13:43:24 +01:00
William Carroll
831dba20bf Define display-4k-vertical
I recently acquired a new monitor, which I'm orienting vertically for logs,
chats, etc. As such I needed to add more functions, KBDs to wrangle the
setup. To DRY up my code, I define a macro, `display-register`, as a DSL for
supporting new monitors. This:
- defines two functions for enabling and disabling the displays
- defines a constant, `display-<name>`

It's basically just a wrapper around `xrandr`, and that's good enough for now.
2020-09-28 13:41:24 +01:00
William Carroll
34ec3104f7 Debug dottime in modeline
My modeline was displaying the local time (not UTC time) and appending the UTC
timezone offset, which was confusing me.

When it was `00:03` in London, my modeline would read `00:03+01`. One way of
interpreting this is that it's `00:03` in London and the `+01` is a reminder
that I'm one hour ahead of UTC. However, I was reading it as though it was
`00:03` UTC and thus `01:03` in London.

I had to set `display-time-string-forms` instead of `display-time-string` to
pass the `t` argument to the `ZONE` parameter to indicate that I'd prefer to use
UTC time and not local time when expanding the variables.
2020-09-28 00:02:40 +01:00
William Carroll
1ad6c30acc Reuse helpful-mode buffers when traversing documentation
Instead of scattering helpful-mode buffers, reuse existing buffers when
traversing documentation.

See this blog post for more information:
https://d12frosted.io/posts/2019-06-26-emacs-helpful.html
2020-09-27 23:49:38 +01:00
William Carroll
12bd12434d Define KBD gu to browse-url-at-point
This is handy!
2020-09-08 13:12:47 +01:00
William Carroll
34af54eb04 Prefer .ssh/config instead of Tramp's defaults
Instruct Tramp to use my SSH settings in .ssh/config.
2020-09-08 13:12:17 +01:00
William Carroll
74f1359924 Install additional KBDs for bookmark.el
Generate KBDs to call `find-file` on the bookmark.
2020-09-07 23:37:58 +01:00
William Carroll
60fd538a10 Remove Emacs config for Google languages
My custom language settings conflict with Google-Emacs's language settings, and
I'm not interested in finding a more harmonious solution. For now, I'm dropping
my settings altogether in favor of Google-Emacs's settings.
2020-09-07 23:28:20 +01:00
William Carroll
a599e7a1c7 Define KBDs for quickly visiting BRIEFCASE magit-status
I'd rather be able to jump straight here instead of visiting a file or directory
first.
2020-09-07 23:22:30 +01:00
William Carroll
1ece8c083b Drop support for Nix home-manager
On my work machines, I'm finding home-manager to be more bothersome than
helpful. I'm preferring a simpler workflow for the time being.
2020-09-07 23:01:59 +01:00
William Carroll
88a683e408 Display all byte-compile-warnings
I've reconsidered; setting this to just '(cl-functions) is not what I want.
2020-09-07 19:48:50 +01:00
William Carroll
62a7478bd2 defgroup for timestring.el
Trying to be more idiomatic.
2020-09-07 19:48:27 +01:00
William Carroll
8022b7a811 Increase the default size of my workstation font
Consider moving some of this logic into my work-specific configuration.
2020-09-07 19:47:54 +01:00
William Carroll
b01ce5059d Debug defensive call to (server-start)
I was previously relying on the variable `server-process` being set, but this
only resulted in false-negatives and broken initializations. This should make my
Emacs initialization more stable.
2020-09-07 16:30:54 +01:00
William Carroll
3a87f3485f Conditionally load-theme
When the `window-system` is set, use `solarized-light`. When it's not,
use `wombat`.
2020-09-07 16:14:42 +01:00
William Carroll
bdd9d963be Conditionally start Emacs server
Only attempt to start the Emacs server if there isn't already one
running.
2020-09-07 16:14:42 +01:00
William Carroll
0f2a13a32a Vertically align search results conditionally
Only when `window-system` is set.
2020-09-07 16:14:42 +01:00
William Carroll
3dc10f167b Install keybindings for bookmark.el
I would like to restore these KBDs.
2020-09-07 16:14:42 +01:00
William Carroll
a366f352e6 Suppress cl deprecation warnings during initialization
See the URL I linked to for more information.
2020-09-07 15:47:47 +01:00
William Carroll
cc1a91078a Drop support for building emacs.glinux
I'm defining a fork of this function in my work configuration, so I longer want
this here.
2020-09-07 15:47:17 +01:00
William Carroll
12b5a10b05 Debug project-find-file for briefcase
As the name suggests, `f-parent-of?` only returns true when A is a *parent* of
B. What I want instead if `f-ancestor-of?`.
2020-09-07 15:41:54 +01:00
William Carroll
43fc1d93fb Prefer 'vc as the project-find-file type when at briefcase's root
See the explanatory comment that I left in the code.
2020-09-06 18:20:19 +01:00
William Carroll
5cf6a0b23d Add defgroup vterm-mgt for vterm-mgt
In the past I used `defconst` in many of my Elisp libraries where I should've
used something like:

```elisp
;; some/path/to/some-lib.el

(defgroup some-lib nil)

(defcustom some-lib-setting nil
  :group 'some-lib)
```

When I encounter code that I should've structured this way, I'm cleaning it up
to prefer this more idiomatic pattern.
2020-09-06 13:49:53 +01:00
William Carroll
b89d1f0a1f Call make-process instead of call-process in scrot.el
While attempting to debug why pressing `C-s-s` from an X-window screenshots my
entire screen, I switched from `call-process` to `make-process`, which is
async.

I still haven't debugged the original issue, but I think this is an improvement
regardless.
2020-09-04 21:06:18 +01:00
William Carroll
4763c7ca45 Restore KBDs for changing my font size
When I removed the KBD logic from fonts.el, I should have moved it here, but I
did not.
2020-09-04 21:04:56 +01:00
William Carroll
73af825389 Debug broken pulse-audio KBDs
Looks like when I linted my Emacs I forgot to change the prefix from
`pulse-audio/` to `pulse-audio-`.
2020-09-04 21:04:10 +01:00
William Carroll
aae5b4c88c Enable font ligatures for Emacs 27!
Now that Emacs is capable a rendering font ligatures, I defined a function to
enable them in fonts.el. Everything works, and it's beautiful.
2020-09-04 21:03:16 +01:00