diff options
-rw-r--r-- | init.el | 49 |
1 files 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!!!" | |||
469 | (:hook visual-line-mode)) | 469 | (:hook visual-line-mode)) |
470 | 470 | ||
471 | (setup (:straight-if (define-repeat-map | 471 | (setup (:straight-if (define-repeat-map |
472 | :host nil | 472 | :host nil |
473 | :repo "https://tildegit.org/acdw/define-repeat-map.el") | 473 | :repo "https://tildegit.org/acdw/define-repeat-map.el") |
474 | (acdw/system :home)) | 474 | (acdw/system :home)) |
475 | 475 | ||
476 | (defun acdw/other-window-or-switch-buffer-backward () | 476 | (defun acdw/other-window-or-switch-buffer-backward () |
@@ -607,14 +607,21 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
607 | 607 | ||
608 | ;; requires extension: | 608 | ;; requires extension: |
609 | ;; https://addons.mozilla.org/en-US/firefox/addon/edit-with-emacs1/ | 609 | ;; https://addons.mozilla.org/en-US/firefox/addon/edit-with-emacs1/ |
610 | (setup (:straight edit-server) | 610 | (setup (:straight-if edit-server |
611 | (when (and (daemonp) | 611 | (daemonp)) |
612 | (require 'edit-server nil :noerror)) | 612 | (:require edit-server) |
613 | (edit-server-start) | 613 | (edit-server-start) |
614 | 614 | ||
615 | (:advise edit-server-make-frame :before | 615 | (:option edit-server-url-major-mode-alist |
616 | (defun edit-server@set-a-variable (&rest _) | 616 | (list (cons (rx (| "reddit.com" |
617 | (setq-local edit-server-frame-p t))))) | 617 | "tildes.net")) |
618 | 'markdown-mode) | ||
619 | (cons (rx "github.com") | ||
620 | 'gfm-mode))) | ||
621 | |||
622 | (:advise edit-server-make-frame :before | ||
623 | (defun edit-server@set-a-variable (&rest _) | ||
624 | (setq-local edit-server-frame-p t)))) | ||
618 | 625 | ||
619 | (setup eldoc | 626 | (setup eldoc |
620 | (:option eldoc-idle-delay 0.1 | 627 | (:option eldoc-idle-delay 0.1 |
@@ -979,6 +986,11 @@ successive invocations." | |||
979 | 986 | ||
980 | (setup flymake | 987 | (setup flymake |
981 | 988 | ||
989 | (defvar-local flymake-inhibit nil | ||
990 | "Buffer-local variable to inhibit `flymake'.") | ||
991 | (add-to-list 'safe-local-variable-values '(flymake-inhibit . t)) | ||
992 | (add-to-list 'safe-local-variable-values '(flymake-inhibit . nil)) | ||
993 | |||
982 | (defvar flymake-inhibit-major-modes nil | 994 | (defvar flymake-inhibit-major-modes nil |
983 | "Which major-modes NOT to enable `flymake' in.") | 995 | "Which major-modes NOT to enable `flymake' in.") |
984 | 996 | ||
@@ -1512,12 +1524,19 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1512 | (with-eval-after-load 'org-export | 1524 | (with-eval-after-load 'org-export |
1513 | (:option (append org-export-filter-final-output-functions) | 1525 | (:option (append org-export-filter-final-output-functions) |
1514 | #'org-export-remove-zero-width-spaces)) | 1526 | #'org-export-remove-zero-width-spaces)) |
1515 | 1527 | ||
1516 | (:hook variable-pitch-mode | 1528 | (:hook #'variable-pitch-mode |
1517 | olivetti-mode | 1529 | #'olivetti-mode |
1518 | (defun acdw/org-fix-lines-before-save () | 1530 | |
1531 | ;; This is super ugly because I need to add a function to | ||
1532 | ;; `before-save-hook', but only in org-mode buffers. So I make a hook | ||
1533 | ;; to make a hook. I'm sure there's a better way to do this. | ||
1534 | (defun org-mode@fix-blank-lines-on-save () | ||
1519 | (add-hook 'before-save-hook | 1535 | (add-hook 'before-save-hook |
1520 | #'acdw-org/fix-blank-lines-in-buffer 0 :local)) | 1536 | (defun acdw-org/fix-blank-lines-in-buffer () |
1537 | (acdw-org/fix-blank-lines t)) | ||
1538 | 0 :local)) | ||
1539 | |||
1521 | (defun org-mode@wc-stupid () | 1540 | (defun org-mode@wc-stupid () |
1522 | (unless (and wc-mode | 1541 | (unless (and wc-mode |
1523 | (> 0 (+ (or wc-orig-words 0) | 1542 | (> 0 (+ (or wc-orig-words 0) |