From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Sun, 21 Oct 2018 09:28:03 +0200 Message-ID: <877eib21z0.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gE89j-0006EM-0E for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 03:28:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gE89f-0002Af-1f for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 03:28:10 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:58693) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gE89e-00029i-Pw for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 03:28:06 -0400 In-Reply-To: (Matt Price's message of "Sat, 20 Oct 2018 20:36:07 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Matt Price Cc: Org Mode Hello, Matt Price writes: > - electric-pair and autopair complete [[ immediately, and don't seem to > allow me to skip past the closing brackets, so if I try to type [[ > https://link.to.somewhere][link text]] I end up with > [[link.to.somewhere]][link-text] . I use C-c C-l to insert links with description. However, electric pairing does get in the way when writing sub/superscript. I use the following snippet to work around the issue: (add-function :before-until electric-pair-inhibit-predicate (lambda (c) (and (eq ?\{ c) (eq major-mode 'org-mode) (memq (char-before (1- (point))) '(?_ ?^))))) I guess you could do something similar to disable pairing when entering a bracket link. Regards, -- Nicolas Goaziou