diff --git a/docs/index.org b/docs/index.org index 47d47f371..d51c59518 100644 --- a/docs/index.org +++ b/docs/index.org @@ -249,7 +249,6 @@ Small modules that give Emacs access to external tools & services. + [[file:../modules/tools/terraform/README.org][terraform]] + tmux - TODO + upload - TODO -+ [[file:../modules/tools/wakatime/README.org][wakatime]] - TODO ** :ui Aesthetic modules that affect the Emacs interface or user experience. diff --git a/init.example.el b/init.example.el index 7965ffdab..8f4723917 100644 --- a/init.example.el +++ b/init.example.el @@ -93,7 +93,6 @@ ;;terraform ; infrastructure as code ;;tmux ; an API for interacting with tmux ;;upload ; map local to remote projects via ssh/ftp - ;;wakatime :lang ;;agda ; types of types of types of types... diff --git a/modules/tools/wakatime/README.org b/modules/tools/wakatime/README.org deleted file mode 100644 index 2427fee03..000000000 --- a/modules/tools/wakatime/README.org +++ /dev/null @@ -1,35 +0,0 @@ -#+TITLE: tools/wakatime -#+DATE: June 7, 2018 -#+SINCE: v2.0.4 -#+STARTUP: inlineimages - -* Table of Contents :TOC_3:noexport: -- [[Description][Description]] - - [[Module Flags][Module Flags]] - - [[Plugins][Plugins]] -- [[Prerequisites][Prerequisites]] -- [[Configuration][Configuration]] - - [[Obfuscate project file names][Obfuscate project file names]] - -* Description -This module integrates [[https://wakatime.com][wakatime]] into Emacs. - -** Module Flags -This module provides no flags. - -** Plugins -+ wakatime-mode - -* Prerequisites -This module requires an account and API key from wakatime.com. - -Run ~M-x +wakatime/setup~ to set things up. - -* Configuration -** Obfuscate project file names -#+BEGIN_SRC emacs-lisp -(setq +wakatime-hide-filenames t) -#+END_SRC - -This will hide what files and folders you're working in from prying eyes on your -profile. diff --git a/modules/tools/wakatime/autoload.el b/modules/tools/wakatime/autoload.el deleted file mode 100644 index 8602b2d37..000000000 --- a/modules/tools/wakatime/autoload.el +++ /dev/null @@ -1,65 +0,0 @@ -;;; tools/wakatime/autoload.el -*- lexical-binding: t; -*- - -(defvar +wakatime-home (concat doom-cache-dir "wakatime/") - "Path to the directory where wakatime files are stored.") - -(defvar +wakatime-hide-filenames nil - "If non-nil, obfuscate files and only show what projects you're working on.") - -;;;###autoload -(add-hook 'doom-init-modules-hook #'+wakatime-delayed-autostart-h) - -;;;###autoload -(defun +wakatime/setup () - "Setup Wakatime in Emacs and start `global-wakatime-mode'. - -This will prompt you for your api key. You only need to run this when your api -changes." - (interactive) - (when (y-or-n-p "No API key is registered. Open a browser on the wakatime api key page?") - (browse-url "https://wakatime.com/settings/api-key")) - (let ((api-key (read-string "Enter your wakatime API key: "))) - (unless api-key - (user-error "No api key was received.")) - (require 'wakatime-mode) - (customize-set-variable 'wakatime-api-key api-key) - (customize-save-customized) - (unless (or (and wakatime-cli-path (file-executable-p wakatime-cli-path)) - (not (equal (wakatime-find-binary "wakatime") "wakatime"))) - (user-error "Couldn't find wakatime executable (%s)" - (or wakatime-cli-path "wakatime"))) - (global-wakatime-mode +1) - (message "Wakatime enabled. You're good to go!"))) - -;;;###autoload -(defun +wakatime-autostart-h (&rest _) - "Initialize wakatime (if `wakatime-api-key' is set, otherwise no-op with a -warning)." - (interactive) - (require 'wakatime-mode) - (if (not wakatime-api-key) - (message "wakatime-mode isn't set up. Run `M-x +wakatime/setup' to do so.") - (when +wakatime-home - (unless (file-directory-p +wakatime-home) - (make-directory +wakatime-home t))) - (global-wakatime-mode +1)) - ;; - (remove-hook 'doom-switch-buffer-hook #'+wakatime-autostart-h) - (advice-remove 'after-find-file #'+wakatime-autostart-h)) - -;;;###autoload -(defun +wakatime-delayed-autostart-h (&rest _) - "Lazily initialize `wakatime-mode' until the next time you switch buffers or -open a file." - (add-hook 'doom-switch-buffer-hook #'+wakatime-autostart-h) - ;; this is necessary in case the user opens emacs with file arguments - (advice-add 'after-find-file :before #'+wakatime-autostart-h)) - -(defadvice! +wakatime--append-options-a (ret) - "Modifies the wakatime command string so that `+wakatime-hide-filenames' and -`+wakatime-home' are respected." - :filter-return #'wakatime-client-command - (concat (when +wakatime-home - (format "WAKATIME_HOME=%s " (shell-quote-argument +wakatime-home))) - ret - (if +wakatime-hide-filenames " --hide-filenames"))) diff --git a/modules/tools/wakatime/packages.el b/modules/tools/wakatime/packages.el deleted file mode 100644 index 2df681c92..000000000 --- a/modules/tools/wakatime/packages.el +++ /dev/null @@ -1,4 +0,0 @@ -;; -*- no-byte-compile: t; -*- -;;; tools/wakatime/packages.el - -(package! wakatime-mode)