diff options
Diffstat (limited to 'tools/emacs/config')
-rw-r--r-- | tools/emacs/config/functions.el | 29 | ||||
-rw-r--r-- | tools/emacs/config/init.el | 19 | ||||
-rw-r--r-- | tools/emacs/config/look-and-feel.el | 9 |
3 files changed, 50 insertions, 7 deletions
diff --git a/tools/emacs/config/functions.el b/tools/emacs/config/functions.el index 2b9713006837..1bec8ecd98a7 100644 --- a/tools/emacs/config/functions.el +++ b/tools/emacs/config/functions.el @@ -203,7 +203,7 @@ (save-excursion (move-end-of-line nil) (insert (format " %s TODO(%s): %s" - comment-start + (s-trim-right comment-start) (if prefix (read-string "Who needs to do this? ") (getenv "USER")) todo)))) @@ -238,4 +238,31 @@ (if prefix (text-scale-adjust 0) (set-face-attribute 'default nil :height (or to 120)))) +(defun notmuch-depot-apply-patch () + "Apply the currently opened notmuch message as a patch on the + depot." + + (interactive) + ;; The implementation works by letting notmuch render a raw message + ;; and capturing it by overriding the `view-buffer' function it + ;; calls after rendering. + ;; + ;; The buffer is then passed to `git-am'. + (cl-letf (((symbol-function 'view-buffer) + (lambda (buffer &optional exit-action) buffer))) + (if-let ((raw-buffer (notmuch-show-view-raw-message))) + (progn + (with-current-buffer raw-buffer + (call-shell-region (point-min) (point-max) "git am -C ~/depot") + (message "Patch applied!") + (kill-buffer)) + (magit-status "~/depot")) + (warn "notmuch failed to render the raw message buffer")))) + +(defun scrot-select () + "Take a screenshot based on a mouse-selection and save it to + ~/screenshots." + (interactive) + (shell-command "scrot '$a_%s.png' -s -e 'mv $f ~/screenshots/'")) + (provide 'functions) diff --git a/tools/emacs/config/init.el b/tools/emacs/config/init.el index eac109f985d0..d705274e9397 100644 --- a/tools/emacs/config/init.el +++ b/tools/emacs/config/init.el @@ -73,7 +73,9 @@ (use-package multiple-cursors) (use-package notmuch - :bind (:map global-map ("s-g m" . notmuch)) ;; g m -> gmail + :bind (:map global-map + ("s-g m" . notmuch) + ("s-g M" . counsel-notmuch)) ;; g m -> gmail :config (setq notmuch-search-oldest-first nil)) @@ -147,6 +149,7 @@ (local-set-key ">" 'self-insert-command))))) (use-package f) +(use-package geiser) (use-package go-mode :bind (:map go-mode-map ("C-c C-r" . recompile)) @@ -157,6 +160,12 @@ (use-package haskell-mode) +(use-package ielm + :hook ((inferior-emacs-lisp-mode . (lambda () + (paredit-mode) + (rainbow-delimiters-mode-enable) + (company-mode))))) + (use-package jq-mode :config (add-to-list 'auto-mode-alist '("\\.jq\\'" . jq-mode))) @@ -182,6 +191,14 @@ (use-package nginx-mode) (use-package rust-mode) +(use-package sly + :hook ((sly-mrepl-mode . (lambda () + (paredit-mode) + (rainbow-delimiters-mode-enable) + (company-mode)))) + :config + (setq common-lisp-hyperspec-root "file:///home/tazjin/docs/lisp/")) + (use-package telega :bind (:map global-map ("s-t" . telega)) :config (telega-mode-line-mode 1)) diff --git a/tools/emacs/config/look-and-feel.el b/tools/emacs/config/look-and-feel.el index 98716dde6465..5a4d874f6f0d 100644 --- a/tools/emacs/config/look-and-feel.el +++ b/tools/emacs/config/look-and-feel.el @@ -21,10 +21,9 @@ (mouse-wheel-mode t) (blink-cursor-mode -1)) -;; Configure editor fonts -(let ((font (format "Input Mono-%d" 12))) - (setq default-frame-alist `((font-backend . "xft") - (font . ,font))) +;; Configure Emacs fonts. +(let ((font (format "JetBrains Mono-%d" 12))) + (setq default-frame-alist `((font . ,font))) (set-frame-font font t t)) ;; Configure telephone-line @@ -37,7 +36,7 @@ load, battery levels on all buffers." (when (bottom-right-window-p) - (telephone-line-raw mode-line-misc-info t))) + (telephone-line-raw mode-line-misc-info t))) (defun telephone-line-setup () (telephone-line-defsegment telephone-line-last-window-segment () |