This answer doesn't answer your question on how to configure electric-pair-mode
. But it might lead you to the results you want.
The wrap-region
package available on Melpa might be the answer to your problem. Here is its brief description from its github:
Wrap Region is a minor mode for Emacs that wraps a region with punctuations. For "tagged" markup modes, such as HTML and XML, it wraps with tags.
Here is how I have set it to work in my selected modes. The snippet also covers the points you raised in your question; about org-mode
font property markers.
(require 'wrap-region)
;; Enable wrap-region in the following major modes
(dolist (hook '(emacs-lisp-mode-hook
org-mode-hook))
(add-hook hook 'wrap-region-mode))
(wrap-region-add-wrapper "`" "'") ; select region, hit ` then region -> `region'
(wrap-region-add-wrapper "=" "=" nil 'org-mode) ; select region, hit = then region -> =region= in org-mode
(wrap-region-add-wrapper "*" "*" nil 'org-mode) ; select region, hit * then region -> *region* in org-mode
(wrap-region-add-wrapper "/" "/" nil 'org-mode) ; select region, hit / then region -> /region/ in org-mode
(wrap-region-add-wrapper "_" "_" nil 'org-mode) ; select region, hit _ then region -> _region_ in org-mode
(wrap-region-add-wrapper "+" "+" nil 'org-mode))) ; select region, hit + then region -> +region+ in org-mode
I'd like to add that this package works really well with the expand-region
package (also available on Melpa).
With these 2 packages, when I am in org-mode
, doing: MY-EXPAND-REGION-BINDING
*
on a word will make it bold.