Created
April 10, 2013 18:34
-
-
Save cabo/5357238 to your computer and use it in GitHub Desktop.
electric-pair-better-inhibit:
Use this as electric-pair-inhibit-predicate if you want parentheses to come in pairs.
(Works from Emacs 24 bzr-version ~ 112221 upwards.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun electric-pair-better-inhibit (char) | |
(or | |
(eq char (char-after)) | |
(and | |
(eq char (char-before (1- (point)))) | |
(let* ((syntax (electric-pair-syntax char))) | |
(not (eq syntax ?\()))) | |
(eq (char-syntax (following-char)) ?w))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment