From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roland Everaert Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Wed, 24 Oct 2018 12:38:27 +0200 Message-ID: <87bm7jk4t8.fsf@gmail.com> References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFGYn-0007b5-75 for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 06:38:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFGYi-0004ew-8j for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 06:38:45 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:46293) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFGYi-0004dx-07 for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 06:38:40 -0400 Received: by mail-ed1-x52c.google.com with SMTP id v22-v6so4526204edq.13 for ; Wed, 24 Oct 2018 03:38:39 -0700 (PDT) In-reply-to: <878t2oubn2.fsf@gmail.com> 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: numbchild@gmail.com Cc: Org Mode I will borrow your config for the emphasis symbols, but for all the paren-related symbols, I will keep the global mapping, so it will still work when writing codes and the like ;) Pleased to see it was helpful. The funny thing is that I use that config for, maybe, 10 years and never think about changing it. stardiviner writes: > Roland Everaert writes: > >> Hi, >> >> I use the following configuration: >> >> ;;;;;;;;;;;;;;;; parenth=C3=A8ses, accolades et brackets ;;;;;; >> (setq skeleton-pair t) >> (global-set-key "[" 'skeleton-pair-insert-maybe) >> (global-set-key "{" 'skeleton-pair-insert-maybe) >> (global-set-key "(" 'skeleton-pair-insert-maybe) >> (global-set-key "\"" 'skeleton-pair-insert-maybe) >> (global-set-key "'" 'skeleton-pair-insert-maybe) >> >> This will only close the defined characters. >> >> >> Hope this will help. >> >> Roland. >> > > This is really helpful for me, I use smartparens before, but it is a litt= le heavy. So I disabled it. I found your solution is simple and fast. I mod= ified a little: > > #+begin_src emacs-lisp > (require 'skeleton) > (setq skeleton-pair t) > > (define-key org-mode-map (kbd "~") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "=3D") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "*") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "+") 'skeleton-pair-insert-maybe) > > (define-key org-mode-map (kbd "[") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "{") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "(") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "\"") 'skeleton-pair-insert-maybe) > (define-key org-mode-map (kbd "'") 'skeleton-pair-insert-maybe) > #+end_src --=20 Luke, use the FOSS Sent from Emacs