chore(tazjin/emacs): remove a bunch of unused code
Change-Id: Ife854e83ef97f1e9a26072f2ab2a3b23f5d64840 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9154 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
This commit is contained in:
parent
6d5d96ecea
commit
9afa1dacf8
5 changed files with 5 additions and 106 deletions
|
@ -18,7 +18,6 @@
|
||||||
;; Start eshell or switch to it if it's active.
|
;; Start eshell or switch to it if it's active.
|
||||||
(global-set-key (kbd "C-x m") 'eshell)
|
(global-set-key (kbd "C-x m") 'eshell)
|
||||||
|
|
||||||
(global-set-key (kbd "C-x C-p") 'browse-repositories)
|
|
||||||
(global-set-key (kbd "M-g M-g") 'goto-line-with-feedback)
|
(global-set-key (kbd "M-g M-g") 'goto-line-with-feedback)
|
||||||
|
|
||||||
;; Miscellaneous editing commands
|
;; Miscellaneous editing commands
|
||||||
|
@ -26,7 +25,7 @@
|
||||||
(global-set-key (kbd "C-c a") 'align-regexp)
|
(global-set-key (kbd "C-c a") 'align-regexp)
|
||||||
(global-set-key (kbd "C-c m") 'mc/mark-dwim)
|
(global-set-key (kbd "C-c m") 'mc/mark-dwim)
|
||||||
|
|
||||||
;; Browse URLs (very useful for Gitlab's SSH output!)
|
;; Browse URLs (very useful for Gerrit's push output, etc!)
|
||||||
(global-set-key (kbd "C-c b p") 'browse-url-at-point)
|
(global-set-key (kbd "C-c b p") 'browse-url-at-point)
|
||||||
(global-set-key (kbd "C-c b b") 'browse-url)
|
(global-set-key (kbd "C-c b b") 'browse-url)
|
||||||
|
|
||||||
|
@ -46,9 +45,6 @@
|
||||||
;; Insert TODO comments
|
;; Insert TODO comments
|
||||||
(global-set-key (kbd "C-c t") 'insert-todo-comment)
|
(global-set-key (kbd "C-c t") 'insert-todo-comment)
|
||||||
|
|
||||||
;; Make sharing music easier
|
|
||||||
(global-set-key (kbd "s-s w") #'songwhip-lookup-url)
|
|
||||||
|
|
||||||
;; Open the depot
|
;; Open the depot
|
||||||
(global-set-key (kbd "s-s d") #'tvl-depot-status)
|
(global-set-key (kbd "s-s d") #'tvl-depot-status)
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,6 @@
|
||||||
(require 'dash)
|
(require 'dash)
|
||||||
(require 'map)
|
(require 'map)
|
||||||
|
|
||||||
(defun load-file-if-exists (filename)
|
|
||||||
(if (file-exists-p filename)
|
|
||||||
(load filename)))
|
|
||||||
|
|
||||||
(defun goto-line-with-feedback ()
|
(defun goto-line-with-feedback ()
|
||||||
"Show line numbers temporarily, while prompting for the line number input"
|
"Show line numbers temporarily, while prompting for the line number input"
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -30,11 +26,6 @@
|
||||||
(find-file (concat "/sudo:root@localhost:" (read-file-name "File: ")))
|
(find-file (concat "/sudo:root@localhost:" (read-file-name "File: ")))
|
||||||
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
|
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
|
||||||
|
|
||||||
;; Open the NixOS man page
|
|
||||||
(defun nixos-man ()
|
|
||||||
(interactive)
|
|
||||||
(man "configuration.nix"))
|
|
||||||
|
|
||||||
;; Get the nix store path for a given derivation.
|
;; Get the nix store path for a given derivation.
|
||||||
;; If the derivation has not been built before, this will trigger a build.
|
;; If the derivation has not been built before, this will trigger a build.
|
||||||
(defun nix-store-path (derivation)
|
(defun nix-store-path (derivation)
|
||||||
|
@ -126,13 +117,6 @@ the GPG agent correctly."
|
||||||
(run-at-time (password-store-timeout)
|
(run-at-time (password-store-timeout)
|
||||||
nil 'password-store-clear))))
|
nil 'password-store-clear))))
|
||||||
|
|
||||||
(defun browse-repositories ()
|
|
||||||
"Select a git repository and open its associated magit buffer."
|
|
||||||
|
|
||||||
(interactive)
|
|
||||||
(magit-status
|
|
||||||
(completing-read "Repository: " (magit-list-repos))))
|
|
||||||
|
|
||||||
(defun bottom-right-window-p ()
|
(defun bottom-right-window-p ()
|
||||||
"Determines whether the last (i.e. bottom-right) window of the
|
"Determines whether the last (i.e. bottom-right) window of the
|
||||||
active frame is showing the buffer in which this function is
|
active frame is showing the buffer in which this function is
|
||||||
|
@ -180,27 +164,6 @@ the GPG agent correctly."
|
||||||
mc/mark-more-hydra/mmlte--up
|
mc/mark-more-hydra/mmlte--up
|
||||||
mc/mark-more-hydra/nil))
|
mc/mark-more-hydra/nil))
|
||||||
|
|
||||||
(defun memespace-region ()
|
|
||||||
"Make a meme out of it."
|
|
||||||
|
|
||||||
(interactive)
|
|
||||||
(let* ((start (region-beginning))
|
|
||||||
(end (region-end))
|
|
||||||
(memed
|
|
||||||
(message
|
|
||||||
(s-trim-right
|
|
||||||
(apply #'string
|
|
||||||
(-flatten
|
|
||||||
(nreverse
|
|
||||||
(-reduce-from (lambda (acc x)
|
|
||||||
(cons (cons x (-repeat (+ 1 (length acc)) 32)) acc))
|
|
||||||
'()
|
|
||||||
(string-to-list (buffer-substring-no-properties start end))))))))))
|
|
||||||
|
|
||||||
(save-excursion (delete-region start end)
|
|
||||||
(goto-char start)
|
|
||||||
(insert memed))))
|
|
||||||
|
|
||||||
(defun insert-todo-comment (prefix todo)
|
(defun insert-todo-comment (prefix todo)
|
||||||
"Insert a comment at point with something for me to do."
|
"Insert a comment at point with something for me to do."
|
||||||
|
|
||||||
|
@ -318,33 +281,6 @@ by looking for a `Cargo.toml' file."
|
||||||
(magit-read-file-from-rev "HEAD" "Find file")
|
(magit-read-file-from-rev "HEAD" "Find file")
|
||||||
#'pop-to-buffer-same-window))
|
#'pop-to-buffer-same-window))
|
||||||
|
|
||||||
(defun songwhip--handle-result (status &optional cbargs)
|
|
||||||
;; TODO(tazjin): Inspect status, which looks different in practice
|
|
||||||
;; than the manual claims.
|
|
||||||
(if-let* ((response (json-parse-string
|
|
||||||
(buffer-substring url-http-end-of-headers (point-max))))
|
|
||||||
(sw-path (ht-get* response "data" "path"))
|
|
||||||
(link (format "https://songwhip.com/%s" sw-path))
|
|
||||||
(select-enable-clipboard t))
|
|
||||||
(progn
|
|
||||||
(kill-new link)
|
|
||||||
(message "Copied Songwhip link (%s)" link))
|
|
||||||
(warn "Something went wrong while retrieving Songwhip link!")
|
|
||||||
;; For debug purposes, the buffer is persisted in this case.
|
|
||||||
(setq songwhip--debug-buffer (current-buffer))))
|
|
||||||
|
|
||||||
(defun songwhip-lookup-url (url)
|
|
||||||
"Look up URL on Songwhip and copy the resulting link to the clipboard."
|
|
||||||
(interactive "sEnter source URL: ")
|
|
||||||
(let ((songwhip-url "https://songwhip.com/api/")
|
|
||||||
(url-request-method "POST")
|
|
||||||
(url-request-extra-headers '(("Content-Type" . "application/json")))
|
|
||||||
(url-request-data
|
|
||||||
(json-serialize `((country . "GB")
|
|
||||||
(url . ,url)))))
|
|
||||||
(url-retrieve "https://songwhip.com/api/" #'songwhip--handle-result nil t t)
|
|
||||||
(message "Requesting Songwhip URL ... please hold the line.")))
|
|
||||||
|
|
||||||
(defun rg-in-project (&optional prefix)
|
(defun rg-in-project (&optional prefix)
|
||||||
"Interactively call ripgrep in the current project, or fall
|
"Interactively call ripgrep in the current project, or fall
|
||||||
back to ripgrep default behaviour if prefix is set."
|
back to ripgrep default behaviour if prefix is set."
|
||||||
|
|
|
@ -10,23 +10,9 @@
|
||||||
(require 'use-package)
|
(require 'use-package)
|
||||||
(require 'seq)
|
(require 'seq)
|
||||||
|
|
||||||
;; TODO(tazjin): Figure out what's up with vc.
|
|
||||||
;;
|
|
||||||
;; Leaving vc enabled breaks all find-file operations with messages
|
|
||||||
;; about .git folders being absent, but in random places.
|
|
||||||
(require 'vc)
|
|
||||||
(setq vc-handled-backends nil)
|
|
||||||
|
|
||||||
(package-initialize)
|
(package-initialize)
|
||||||
|
|
||||||
;; Initialise all packages installed via Nix.
|
;; Initialise all packages installed via Nix.
|
||||||
;;
|
|
||||||
;; TODO: Generate this section in Nix for all packages that do not
|
|
||||||
;; require special configuration.
|
|
||||||
|
|
||||||
;;
|
|
||||||
;; Packages providing generic functionality.
|
|
||||||
;;
|
|
||||||
|
|
||||||
(use-package ace-window
|
(use-package ace-window
|
||||||
:bind (("C-x o" . ace-window))
|
:bind (("C-x o" . ace-window))
|
||||||
|
@ -59,20 +45,6 @@
|
||||||
(eglot-autoshutdown t)
|
(eglot-autoshutdown t)
|
||||||
(eglot-send-changes-idle-time 0.3))
|
(eglot-send-changes-idle-time 0.3))
|
||||||
|
|
||||||
(use-package elfeed
|
|
||||||
:config
|
|
||||||
(setq elfeed-feeds
|
|
||||||
'("https://lobste.rs/rss"
|
|
||||||
"https://www.anti-spiegel.ru/feed/"
|
|
||||||
"https://www.reddit.com/r/lockdownskepticism/.rss"
|
|
||||||
"https://www.reddit.com/r/rust/.rss"
|
|
||||||
"https://news.ycombinator.com/rss"
|
|
||||||
("https://xkcd.com/atom.xml" media)
|
|
||||||
|
|
||||||
;; vlogcreations
|
|
||||||
("https://www.youtube.com/feeds/videos.xml?channel_id=UCR0VLWitB2xM4q7tjkoJUPw" media)
|
|
||||||
)))
|
|
||||||
|
|
||||||
(use-package ht)
|
(use-package ht)
|
||||||
|
|
||||||
(use-package hydra)
|
(use-package hydra)
|
||||||
|
@ -142,11 +114,9 @@
|
||||||
(use-package restclient)
|
(use-package restclient)
|
||||||
|
|
||||||
(use-package vterm
|
(use-package vterm
|
||||||
:config (progn
|
:custom
|
||||||
(setq vterm-shell "fish")
|
(vterm-shell "fish")
|
||||||
(setq vterm-exit-functions
|
(vterm-kill-buffer-on-exit t))
|
||||||
(lambda (&rest _) (kill-buffer (current-buffer))))
|
|
||||||
(setq vterm-kill-buffer-on-exit t)))
|
|
||||||
|
|
||||||
;; vterm removed the ability to set a custom title generator function
|
;; vterm removed the ability to set a custom title generator function
|
||||||
;; via the public API, so this overrides its private title generation
|
;; via the public API, so this overrides its private title generation
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
(add-hook 'prog-mode-hook 'hl-line-mode)
|
(add-hook 'prog-mode-hook 'hl-line-mode)
|
||||||
|
|
||||||
;; Use auto-complete as completion at point
|
;; Use auto-complete as completion at point
|
||||||
|
;; TODO(tazjin): what is this?
|
||||||
(defun set-auto-complete-as-completion-at-point-function ()
|
(defun set-auto-complete-as-completion-at-point-function ()
|
||||||
(setq completion-at-point-functions '(auto-complete)))
|
(setq completion-at-point-functions '(auto-complete)))
|
||||||
|
|
||||||
|
@ -31,7 +32,4 @@
|
||||||
;; Transparently open compressed files
|
;; Transparently open compressed files
|
||||||
(auto-compression-mode t)
|
(auto-compression-mode t)
|
||||||
|
|
||||||
;; Configure go-mode for Go2 Alpha
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.go2$" . go-mode))
|
|
||||||
|
|
||||||
(provide 'modes)
|
(provide 'modes)
|
||||||
|
|
|
@ -36,7 +36,6 @@ pkgs.makeOverridable
|
||||||
direnv
|
direnv
|
||||||
dockerfile-mode
|
dockerfile-mode
|
||||||
eglot
|
eglot
|
||||||
elfeed
|
|
||||||
elixir-mode
|
elixir-mode
|
||||||
elm-mode
|
elm-mode
|
||||||
erlang
|
erlang
|
||||||
|
|
Loading…
Reference in a new issue