From 2cf96901805bfb63c4e20a2558ea381372e077ca Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 13 Sep 2021 22:10:42 -0500 Subject: Bahhhhhhh --- init.el | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/init.el b/init.el index 0b973e5..3ac62dc 100644 --- a/init.el +++ b/init.el @@ -469,8 +469,8 @@ AKA, DO NOT USE THIS FUNCTION!!!" (:hook visual-line-mode)) (setup (:straight-if (define-repeat-map - :host nil - :repo "https://tildegit.org/acdw/define-repeat-map.el") + :host nil + :repo "https://tildegit.org/acdw/define-repeat-map.el") (acdw/system :home)) (defun acdw/other-window-or-switch-buffer-backward () @@ -607,14 +607,21 @@ AKA, DO NOT USE THIS FUNCTION!!!" ;; requires extension: ;; https://addons.mozilla.org/en-US/firefox/addon/edit-with-emacs1/ -(setup (:straight edit-server) - (when (and (daemonp) - (require 'edit-server nil :noerror)) - (edit-server-start) - - (:advise edit-server-make-frame :before - (defun edit-server@set-a-variable (&rest _) - (setq-local edit-server-frame-p t))))) +(setup (:straight-if edit-server + (daemonp)) + (:require edit-server) + (edit-server-start) + + (:option edit-server-url-major-mode-alist + (list (cons (rx (| "reddit.com" + "tildes.net")) + 'markdown-mode) + (cons (rx "github.com") + 'gfm-mode))) + + (:advise edit-server-make-frame :before + (defun edit-server@set-a-variable (&rest _) + (setq-local edit-server-frame-p t)))) (setup eldoc (:option eldoc-idle-delay 0.1 @@ -979,6 +986,11 @@ successive invocations." (setup flymake + (defvar-local flymake-inhibit nil + "Buffer-local variable to inhibit `flymake'.") + (add-to-list 'safe-local-variable-values '(flymake-inhibit . t)) + (add-to-list 'safe-local-variable-values '(flymake-inhibit . nil)) + (defvar flymake-inhibit-major-modes nil "Which major-modes NOT to enable `flymake' in.") @@ -1512,12 +1524,19 @@ browser defined in `browse-url-secondary-browser-function'." (with-eval-after-load 'org-export (:option (append org-export-filter-final-output-functions) #'org-export-remove-zero-width-spaces)) - - (:hook variable-pitch-mode - olivetti-mode - (defun acdw/org-fix-lines-before-save () + + (:hook #'variable-pitch-mode + #'olivetti-mode + + ;; This is super ugly because I need to add a function to + ;; `before-save-hook', but only in org-mode buffers. So I make a hook + ;; to make a hook. I'm sure there's a better way to do this. + (defun org-mode@fix-blank-lines-on-save () (add-hook 'before-save-hook - #'acdw-org/fix-blank-lines-in-buffer 0 :local)) + (defun acdw-org/fix-blank-lines-in-buffer () + (acdw-org/fix-blank-lines t)) + 0 :local)) + (defun org-mode@wc-stupid () (unless (and wc-mode (> 0 (+ (or wc-orig-words 0) -- cgit 1.4.1-21-gabe81