From d703fb5a2631588573b3aee6f03cbcc381789743 Mon Sep 17 00:00:00 2001 From: MitchMarq42 Date: Wed, 2 Nov 2022 09:39:36 -0800 Subject: [PATCH] Add org markup to electric-pairs when in org-mode --- README.org | 3 +++ lisp/mitch-packages.el | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/README.org b/README.org index 6e6848e..8b25e1a 100644 --- a/README.org +++ b/README.org @@ -16,3 +16,6 @@ There are a few things to immediately note: - Typing ~qq~ will change your input method. This is sort-of a built-in feature, but the default trigger is to type ~C-\~, which is annoying to press. The ~qq~ behavior is built into Japanese-mode specifically and normally toggles in and out of ~japanese-ascii~, which is literally just normal text except ~qq~ switches back to Japanese. * 2022-09-26 12:57 pm This is the time of day that I wrote the thing that creates the above heading now. It works it works it works... + +_this is underlined_ and that works with electric pairs now... "And" =so= +does +this and this and+ *not this* either... diff --git a/lisp/mitch-packages.el b/lisp/mitch-packages.el index faa9188..4eb1816 100644 --- a/lisp/mitch-packages.el +++ b/lisp/mitch-packages.el @@ -471,6 +471,17 @@ targets." (add-hook 'after-save-hook #'(lambda () (if (equal major-mode 'org-mode) (org-babel-tangle)))) + (setq electric-pair-org-pairs `( + (,(string-to-char "_") . ,(string-to-char "_")) + (,(string-to-char "/") . ,(string-to-char "/")) + (,(string-to-char "*") . ,(string-to-char "*")) + (,(string-to-char "+") . ,(string-to-char "+")) + (,(string-to-char "+") . ,(string-to-char "+")) + (,(string-to-char "=") . ,(string-to-char "=")))) + + (dolist (pair electric-pair-org-pairs) + (add-to-list 'electric-pair-pairs + pair)) (require 'mitch-orgstuff) :hook (org-mode . turn-off-line-numbers)