From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: electric-pair, autopair, smartparens, etc in org-mode Date: Sat, 20 Oct 2018 20:36:07 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000674c8a0578b25045" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gE1iQ-0000Vd-Gp for emacs-orgmode@gnu.org; Sat, 20 Oct 2018 20:35:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gE1iP-0007p2-J7 for emacs-orgmode@gnu.org; Sat, 20 Oct 2018 20:35:34 -0400 Received: from mail-it1-x12a.google.com ([2607:f8b0:4864:20::12a]:54160) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gE1iP-0007oa-DE for emacs-orgmode@gnu.org; Sat, 20 Oct 2018 20:35:33 -0400 Received: by mail-it1-x12a.google.com with SMTP id q70-v6so8250391itb.3 for ; Sat, 20 Oct 2018 17:35:33 -0700 (PDT) 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: Org Mode --000000000000674c8a0578b25045 Content-Type: text/plain; charset="UTF-8" Hi eveyrone, I'm just wondering what tools other people use to manage paired parentheses and other markers in org. I'm revisiting my long-ago decision to turn all pairing tools off in org, but every tool I try is pretty frustrating out of the box: - smartparens steals a large number of really important structure-editing commands from org-mode. I find the default behaviour unusable. - 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'm willing to learn how to use these modes properly but I'm not quite sure how best to proceed, so if someone else has a solution that works I would be very grateful to hear it. thank you! --000000000000674c8a0578b25045 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi eveyrone,

I'm just wondering what tools other people use to manage paired paren= theses and other markers in org.=C2=A0 I'm revisiting my long-ago decis= ion to turn all pairing tools off in org, but every tool I try is pretty fr= ustrating out of the box:

- smartparens steals a l= arge number of really important structure-editing commands from org-mode.= =C2=A0 I find the default behaviour unusable.
- electric-pai= r and autopair complete [[ immediately, and don't seem to allow me to s= kip 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'm will= ing to learn how to use these modes properly but I'm not quite sure how= best to proceed, so if someone else has a solution that works I would be v= ery grateful to hear it. thank you!
--000000000000674c8a0578b25045-- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Sun, 21 Oct 2018 12:43:25 -0400 Message-ID: References: <877eib21z0.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000009d72db0578bfd3a7" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEGoV-0007LL-1C for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 12:42:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEGoT-0006gu-KC for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 12:42:50 -0400 Received: from mail-it1-x12a.google.com ([2607:f8b0:4864:20::12a]:40771) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gEGoT-0006eo-9Q for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 12:42:49 -0400 Received: by mail-it1-x12a.google.com with SMTP id i191-v6so9747535iti.5 for ; Sun, 21 Oct 2018 09:42:49 -0700 (PDT) In-Reply-To: <877eib21z0.fsf@nicolasgoaziou.fr> 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: Org Mode --0000000000009d72db0578bfd3a7 Content-Type: text/plain; charset="UTF-8" wow, I learned a whole lot from your answer Nicholas, but still not quite enough to make this work for me. After some puzzling over the syntax for character values, I believe that what I want should be something like this: (add-function :before-until electric-pair-inhibit-predicate (lambda (c) (and (eq ?\[ c) (eq major-mode 'org-mode) (memq (char-before (1- (point))) '(?\[ ?\]))))) The manual says to use advice-add instead of add-function for these cases, so this could be written like this instead: (defun mwp-org-mode-electric-inhibit (c) (and (eq ?\[ c) (eq major-mode 'org-mode) (memq (char-before (1- (point))) '(?\[ ?\]) ))) (advice-add electric-pair-inhibit-predicate :before-until #'mwp-org-mode-electric-inhibit) it seems to sort of work. That is, the code is effective, but it doesn't do what I want, so I had to think about the desired behaviour, which is maybe too complex for this modification: when I start a link [ go ahead and add pair to [] when I add a second [, don't complete [[] this is what my code does! but what I really want is, when I finish adding a link reference, somehow allow me to stay inside the link to add the link text: [[https://google.com]] --> [[https://google.com][]] with point between the final [ and ]. This seems like it needs a more complex intervention. For now I've just turned off pairing of brackets entirely: (defun mwp-org-mode-electric-inhibit (c) (and (eq ?\[ c) (eq major-mode 'org-mode)) This works fine, though I'd still like the other :-/ Thanks Nicholas! On Sun, Oct 21, 2018 at 3:28 AM Nicolas Goaziou wrote: > 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 > --0000000000009d72db0578bfd3a7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
wow, I learned a wh= ole lot from your answer Nicholas, but still not quite enough to make this = work for me.=C2=A0 After some puzzling over the syntax for character values= , I believe that what I want should be something like this:
=
(add-function :before-until electric-pair-inhibit-predicate<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 (lambda (c)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (and (eq ?\[ c)
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (eq major-mode 'org-mode)
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (memq (char-before (1- (point))) '= (?\[ ?\])))))

The manual says to use advice-add instead o= f add-function for these cases, so this could be written like this instead:=

(defun mwp-org-mode-electric-inhibit (c)
=C2=A0 (and
= =C2=A0=C2=A0 (eq ?\[ c)
=C2=A0=C2=A0 (eq major-mode 'org-mode)
= =C2=A0=C2=A0 (memq (char-before (1- (point))) '(?\[ ?\]) )))

(ad= vice-add electric-pair-inhibit-predicate :before-until #'mwp-org-mode-e= lectric-inhibit)

it seems to sort of work= .=C2=A0 That is, the code is effective, but it doesn't do what I want, = so I had to think about the desired behaviour, which is maybe too complex f= or this modification:

when I start a link [
<= div>go ahead and add pair to
[]
when I add a secon= d [, don't complete
[[]
this is what my code does!<= /div>

but what I really want is, when I finish adding a = link reference, somehow allow me to stay inside the link to add the link te= xt:
w= ith point between the final [ and ].=C2=A0
This seems like i= t needs a more complex intervention.=C2=A0

Fo= r now I've just turned off pairing of brackets entirely:

(defun mwp-org-mode-electric-inhibit (c)
=C2=A0 (and =C2=A0=C2=A0 (eq ?\[ c)
=C2=A0=C2=A0 (eq major-mode 'org-mode))

This works fine, though I'd still like the other = :-/=C2=A0

Thanks Nicholas!
On Sun, Oct 21, 2018 at 3:28 AM Nic= olas Goaziou <mail@nicolasgoaz= iou.fr> wrote:
Hello,

Matt Price <mopt= op99@gmail.com> writes:

> - electric-pair and autopair complete [[ immediately, and don't se= em 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:

=C2=A0 =C2=A0(add-function :before-until electric-pair-inhibit-predicate =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda (c) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(and (= eq ?\{ c)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (eq major-mode 'org-mode)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (memq (char-before (1- (point))) '(?_ ?^)))))

I guess you could do something similar to disable pairing when entering
a bracket link.

Regards,

--
Nicolas Goaziou
--0000000000009d72db0578bfd3a7-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roland Everaert Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Tue, 23 Oct 2018 09:58:08 +0200 Message-ID: <87zhv5nlgv.fsf@gmail.com> References: <877eib21z0.fsf@nicolasgoaziou.fr> 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]:57446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gErkg-0002xF-SM for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 04:09:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gErZs-0005a8-Ne for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 03:58:17 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:41147) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gErZs-0005UD-Cm for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 03:58:12 -0400 Received: by mail-ed1-x52d.google.com with SMTP id x31-v6so670448edd.8 for ; Tue, 23 Oct 2018 00:58:11 -0700 (PDT) In-reply-to: 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 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. Matt Price writes: > wow, I learned a whole lot from your answer Nicholas, but still not quite > enough to make this work for me. After some puzzling over the syntax for > character values, I believe that what I want should be something like thi= s: > > (add-function :before-until electric-pair-inhibit-predicate > (lambda (c) > (and (eq ?\[ c) > (eq major-mode 'org-mode) > (memq (char-before (1- (point))) '(?\[ ?\]))))) > > The manual says to use advice-add instead of add-function for these cases, > so this could be written like this instead: > > (defun mwp-org-mode-electric-inhibit (c) > (and > (eq ?\[ c) > (eq major-mode 'org-mode) > (memq (char-before (1- (point))) '(?\[ ?\]) ))) > > (advice-add electric-pair-inhibit-predicate :before-until > #'mwp-org-mode-electric-inhibit) > > it seems to sort of work. That is, the code is effective, but it doesn't > do what I want, so I had to think about the desired behaviour, which is > maybe too complex for this modification: > > when I start a link [ > go ahead and add pair to > [] > when I add a second [, don't complete > [[] > this is what my code does! > > but what I really want is, when I finish adding a link reference, somehow > allow me to stay inside the link to add the link text: > [[https://google.com]] --> [[https://google.com][]] > with point between the final [ and ]. > This seems like it needs a more complex intervention. > > For now I've just turned off pairing of brackets entirely: > > (defun mwp-org-mode-electric-inhibit (c) > (and > (eq ?\[ c) > (eq major-mode 'org-mode)) > > This works fine, though I'd still like the other :-/ > > Thanks Nicholas! > On Sun, Oct 21, 2018 at 3:28 AM Nicolas Goaziou > wrote: > >> 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 >> --=20 Luke, use the FOSS Sent from Emacs From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Tue, 23 Oct 2018 19:48:33 +0800 Message-ID: <878t2oubn2.fsf@gmail.com> References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> Reply-To: numbchild@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]:51648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEvJB-0002TO-5L for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 07:57:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEvJ6-0000CE-Lf for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 07:57:13 -0400 Received: from [61.175.244.13] (port=43388 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEvJ6-0000B5-6a for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 07:57:08 -0400 In-reply-to: <87zhv5nlgv.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: Roland Everaert Cc: Org Mode 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 little= heavy. So I disabled it. I found your solution is simple and fast. I modif= ied 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 [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 =20=20=20=20=20=20 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Tue, 23 Oct 2018 14:07:30 +0100 Message-ID: <87pnw0erql.fsf@gmail.com> References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEwPR-0004mQ-Dp for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 09:07:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEwPM-00073I-Gn for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 09:07:45 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:42729) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gEwPK-0006mu-Cg for emacs-orgmode@gnu.org; Tue, 23 Oct 2018 09:07:40 -0400 Received: by mail-wr1-x42b.google.com with SMTP id a9so1630449wrx.9 for ; Tue, 23 Oct 2018 06:07:33 -0700 (PDT) In-Reply-To: <878t2oubn2.fsf@gmail.com> (stardiviner's message of "Tue, 23 Oct 2018 19:48:33 +0800") 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: stardiviner Cc: Roland Everaert , Org Mode On Tuesday, 23 Oct 2018 at 19:48, stardiviner wrote: > This is really helpful for me, I use smartparens before, but it is a > little heavy. So I disabled it. I found your solution is simple and > fast. I modified a little: +1 I gave up long ago on smartparens but skeleton seems to work well. -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Wed, 24 Oct 2018 11:45:04 +0100 Message-ID: <87in1rbp3j.fsf@gmail.com> References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> <87bm7jk4t8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFGf3-0001pB-ED for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 06:45:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFGey-0008GU-5s for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 06:45:13 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:54802) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFGex-0008Fo-Px for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 06:45:07 -0400 Received: by mail-wm1-x331.google.com with SMTP id r63-v6so4872458wma.4 for ; Wed, 24 Oct 2018 03:45:07 -0700 (PDT) In-Reply-To: <87bm7jk4t8.fsf@gmail.com> (Roland Everaert's message of "Wed, 24 Oct 2018 12:38:27 +0200") 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: Roland Everaert Cc: Org Mode On Wednesday, 24 Oct 2018 at 12:38, Roland Everaert wrote: > 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. I've been using emacs for well over 30 years now. You would not believe the crud that has built up in my config files... ;-) :Q Mind you, with org, I have started rationalizing the config files but it's a time consuming task and the adage of "if it ain't broke, don't fix it" has power... -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Wed, 24 Oct 2018 09:12:19 -0400 Message-ID: References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> <87pnw0erql.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004286e10578f93a43" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFJ46-0000YX-NN for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 09:19:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFIwp-00066Z-Vi for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 09:11:44 -0400 Received: from mail-it1-x135.google.com ([2607:f8b0:4864:20::135]:51468) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFIwp-00066F-Pa for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 09:11:43 -0400 Received: by mail-it1-x135.google.com with SMTP id 74-v6so6091263itw.1 for ; Wed, 24 Oct 2018 06:11:43 -0700 (PDT) In-Reply-To: <87pnw0erql.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, reveatwork@gmail.com, Org Mode --0000000000004286e10578f93a43 Content-Type: text/plain; charset="UTF-8" Eric, you seem to be replying to an email that I sometimes don't have -- I would love to see what @stardiviner wrote, do you stil lhave the email? On Tue, Oct 23, 2018 at 9:12 AM Eric S Fraga wrote: > On Tuesday, 23 Oct 2018 at 19:48, stardiviner wrote: > > This is really helpful for me, I use smartparens before, but it is a > > little heavy. So I disabled it. I found your solution is simple and > > fast. I modified a little: > > +1 > > I gave up long ago on smartparens but skeleton seems to work well. > > -- > Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4 > > --0000000000004286e10578f93a43 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Eric, you seem to be replying to an email that I sometimes= don't have -- I would love to see what @stardiviner wrote, do you stil= lhave the email?

On Tue, Oct 23, 2018 at 9:12 AM Eric S Fraga <esflists@gmail.com> wrote:
On Tuesday, 23 Oct 2018 at 19:48, stardiviner wrote:
> This is really helpful for me, I use smartparens before, but it is a > little heavy. So I disabled it. I found your solution is simple and > fast. I modified a little:

+1

I gave up long ago on smartparens but skeleton seems to work well.

--
Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4

--0000000000004286e10578f93a43-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Wed, 24 Oct 2018 15:15:02 +0100 Message-ID: <87y3ana0t5.fsf@gmail.com> References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> <87pnw0erql.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFJwD-0003sD-P1 for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 10:15:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFJwA-00038R-KO for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 10:15:09 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:34624) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFJwA-00037W-9q for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 10:15:06 -0400 Received: by mail-wm1-x331.google.com with SMTP id f1-v6so2496489wmg.1 for ; Wed, 24 Oct 2018 07:15:05 -0700 (PDT) In-Reply-To: (Matt Price's message of "Wed, 24 Oct 2018 09:12:19 -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: reveatwork@gmail.com, Org Mode On Wednesday, 24 Oct 2018 at 09:12, Matt Price wrote: > Eric, you seem to be replying to an email that I sometimes don't have -- I > would love to see what @stardiviner wrote, do you stil lhave the email? I've forwarded that email to you but it's strange that you missed it as it was sent to the org mode mailing list. -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Cross Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Thu, 25 Oct 2018 08:24:24 +1100 Message-ID: <87h8hbkph3.fsf@gmail.com> References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> <87bm7jk4t8.fsf@gmail.com> <87in1rbp3j.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFQdm-0000V5-NW for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 17:24:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFQdl-0001xt-Vl for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 17:24:34 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:35491) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFQdl-0001sB-Mj for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 17:24:33 -0400 Received: by mail-pg1-x535.google.com with SMTP id 32-v6so2944048pgu.2 for ; Wed, 24 Oct 2018 14:24:30 -0700 (PDT) In-reply-to: <87in1rbp3j.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: Eric S Fraga Cc: Roland Everaert , Org Mode Eric S Fraga writes: > On Wednesday, 24 Oct 2018 at 12:38, Roland Everaert wrote: >> 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. > > I've been using emacs for well over 30 years now. You would not believe the crud that has built up in my config files... ;-) :Q > > Mind you, with org, I have started rationalizing the config files but it's a time consuming task and the adage of "if it ain't broke, don't fix it" has power... +1 Likewise, started with Emacs 19 and I still have some code which I added back then in my init! I went through the pain of cleaning up my init file some time ago when I moved to make better use of 'use-package'. Have to say that while things were not 'broken' before my cleanup, they are certainly working better now and my init is much smaller. What I found was that a lot of what was in my init file was simply no longer required as similar (often superior) functionality has crept into the main Emacs distribution - all I needed to do was remove my code and turn the feature on. The two big benefits from the clean up have been much faster start up (something which never really bothered me as I run emacs for weeks without re-starting anyway) and far more predictable behaviour when I try out or add a new mode (I often found my custom tweaks would not always work well with new modes etc). Org is extremely useful in this process. Create an org file and put all your existing init in there as source blocks so that you can reproduce your setup using tangle. Then create a new-init.org file and just add the stuff you must have i.e. email config, essential modes etc. Then you can switch between old and new setups using tangle to generate new init.el file. When you have time, start with the new-init version and start adding/tweaking to get the behaviour you want. Rather than just copy across your old setup, check to see what is available in core - if your like me, you will find lots of we use to tweak in code is now part of core emacs and all you need to do is turn it on. At some point, you will find you stay in your new init file and no longer need to revert to the old version. You will likely find lots of stuff never gets migrated. It really is worth the time and effort. Tim -- Tim Cross From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Thu, 25 Oct 2018 16:07:27 +0100 Message-ID: References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> <87bm7jk4t8.fsf@gmail.com> <87in1rbp3j.fsf@gmail.com> <87h8hbkph3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFhEY-0005r9-MF for emacs-orgmode@gnu.org; Thu, 25 Oct 2018 11:07:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFhET-0000PF-O7 for emacs-orgmode@gnu.org; Thu, 25 Oct 2018 11:07:38 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:33256) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFhET-0000OJ-HG for emacs-orgmode@gnu.org; Thu, 25 Oct 2018 11:07:33 -0400 Received: by mail-wr1-x436.google.com with SMTP id u1-v6so9723765wrn.0 for ; Thu, 25 Oct 2018 08:07:33 -0700 (PDT) In-Reply-To: <87h8hbkph3.fsf@gmail.com> (Tim Cross's message of "Thu, 25 Oct 2018 08:24:24 +1100") 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: Tim Cross Cc: Roland Everaert , Org Mode On Thursday, 25 Oct 2018 at 08:24, Tim Cross wrote: > Likewise, started with Emacs 19 and I still have some code which I added > back then in my init! [...] > The two big benefits from the clean up have been much faster start up > (something which never really bothered me as I run emacs for weeks > without re-starting anyway) and far more predictable behaviour when I > try out or add a new mode (I often found my custom tweaks would not > always work well with new modes etc). The second of these is indeed a benefit of cleaning up initialization files. I have been doing so, in any case, just at a slower pace than I should. I actually have been doing exactly what you suggest: using org and tangling. -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-894-gf79545 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Thu, 25 Oct 2018 15:57:41 -0700 Message-ID: References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> <87bm7jk4t8.fsf@gmail.com> <87in1rbp3j.fsf@gmail.com> <87h8hbkph3.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]:52831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFoZV-0000VU-HI for emacs-orgmode@gnu.org; Thu, 25 Oct 2018 18:57:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFoZU-0002ZA-HE for emacs-orgmode@gnu.org; Thu, 25 Oct 2018 18:57:45 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:43275) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFoZU-0002Y6-8u for emacs-orgmode@gnu.org; Thu, 25 Oct 2018 18:57:44 -0400 Received: by mail-lf1-x12f.google.com with SMTP id u18so921440lff.10 for ; Thu, 25 Oct 2018 15:57:44 -0700 (PDT) In-Reply-To: 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: Tim Cross , Roland Everaert , Org Mode can either of you give examples of code or settings that you had that made behavior of new modes unpredictable because emacs started supporting the behavior you made the code or settings for? On 10/25/18, Eric S Fraga wrote: > On Thursday, 25 Oct 2018 at 08:24, Tim Cross wrote: >> Likewise, started with Emacs 19 and I still have some code which I added >> back then in my init! > > [...] > >> The two big benefits from the clean up have been much faster start up >> (something which never really bothered me as I run emacs for weeks >> without re-starting anyway) and far more predictable behaviour when I >> try out or add a new mode (I often found my custom tweaks would not >> always work well with new modes etc). > > The second of these is indeed a benefit of cleaning up initialization > files. I have been doing so, in any case, just at a slower pace than I > should. I actually have been doing exactly what you suggest: using org > and tangling. > -- > Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-894-gf79545 > > --=20 The Kafka Pandemic: The disease DOES progress. MANY people have died from it. And ANYBODY can get it at any time. "You=E2=80=99ve really gotta quit this and get moving, because this is murd= er by neglect." --- . From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Thu, 25 Oct 2018 15:59:43 -0700 Message-ID: References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> <87bm7jk4t8.fsf@gmail.com> <87in1rbp3j.fsf@gmail.com> <87h8hbkph3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFobS-0002x3-0S for emacs-orgmode@gnu.org; Thu, 25 Oct 2018 18:59:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFobR-0003Ws-9z for emacs-orgmode@gnu.org; Thu, 25 Oct 2018 18:59:45 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:35904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFobR-0003Wf-1q for emacs-orgmode@gnu.org; Thu, 25 Oct 2018 18:59:45 -0400 Received: by mail-lf1-x135.google.com with SMTP id h192so3129915lfg.3 for ; Thu, 25 Oct 2018 15:59:44 -0700 (PDT) In-Reply-To: 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: Tim Cross , Roland Everaert , Org Mode oh i got that slightly wrong. i meant can you give exmaples of what yoa re saying. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Fri, 26 Oct 2018 10:23:51 +0100 Message-ID: <878t2ljc2g.fsf@gmail.com> References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> <87bm7jk4t8.fsf@gmail.com> <87in1rbp3j.fsf@gmail.com> <87h8hbkph3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFyLV-00028b-Po for emacs-orgmode@gnu.org; Fri, 26 Oct 2018 05:23:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFyLS-0006u4-Jx for emacs-orgmode@gnu.org; Fri, 26 Oct 2018 05:23:57 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:52635) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFyLS-0006tk-Dc for emacs-orgmode@gnu.org; Fri, 26 Oct 2018 05:23:54 -0400 Received: by mail-wm1-x332.google.com with SMTP id 189-v6so783242wmw.2 for ; Fri, 26 Oct 2018 02:23:54 -0700 (PDT) In-Reply-To: (Samuel Wales's message of "Thu, 25 Oct 2018 15:57:41 -0700") 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: Samuel Wales Cc: Tim Cross , Org Mode , Roland Everaert On Thursday, 25 Oct 2018 at 15:57, Samuel Wales wrote: > can either of you give examples of code or settings that you had that > made behavior of new modes unpredictable because emacs started > supporting the behavior you made the code or settings for? In my case, mostly incompatible bindings of keys, e.g. the tab key, especially in the context of auto-completion mechanisms and auto-expansion (e.g. yasnippet). It's not so much unpredictable behaviour as wrong behaviour due to settings stepping on the toes of subsequently installed packages. -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.11-620-ga548e4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Cross Subject: Re: electric-pair, autopair, smartparens, etc in org-mode Date: Sat, 27 Oct 2018 08:45:43 +1100 Message-ID: <87efccl6uw.fsf@gmail.com> References: <877eib21z0.fsf@nicolasgoaziou.fr> <87zhv5nlgv.fsf@gmail.com> <878t2oubn2.fsf@gmail.com> <87bm7jk4t8.fsf@gmail.com> <87in1rbp3j.fsf@gmail.com> <87h8hbkph3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG9vT-0001az-7g for emacs-orgmode@gnu.org; Fri, 26 Oct 2018 17:45:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gG9vS-00011f-6o for emacs-orgmode@gnu.org; Fri, 26 Oct 2018 17:45:51 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:40726) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gG9vR-00011O-W1 for emacs-orgmode@gnu.org; Fri, 26 Oct 2018 17:45:50 -0400 Received: by mail-pg1-x52f.google.com with SMTP id o14-v6so1119304pgv.7 for ; Fri, 26 Oct 2018 14:45:49 -0700 (PDT) In-reply-to: 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: Samuel Wales Cc: Roland Everaert , Org Mode Samuel Wales writes: > can either of you give examples of code or settings that you had that > made behavior of new modes unpredictable because emacs started > supporting the behavior you made the code or settings for? > It is difficult to remember now as it was some time ago that I cleaned up my init and got rid of much of my old stuff. Areas I do remember include - Key bindings. This is probably the most common. You would enable a new Emacs feature only to find you had conflicts with key bindings. In the best case, some new features couldn't be easily accessed. In the worst case, a new feature would create unexpected behaviour. The hard part was often in deciding whether to try and change the bindings or change my finger memory. - Hooks. This was probably the second most common problem. A new feature would add to a hook where I had a similar feature also on that hook. As a result, both would run and result in unexpected outcomes. - Convenience functions for selecting files, buffers and windows, working with sets of files (i.e. projects), My setup predated ido, and packages like yasnippets, projectile and company mode which I now use. In many cases, my own tweaks were OK, but not as robust or feature rich as standard packages that were added to Emacs over releases which provided similar functionality. - As my init had grown in a rather 'organic' manner - bits added as I needed them, there was a lack of consistency or structure to my configuration. As a result, often when I tried a new feature, there would be parts of my init I would forget to remove/disable that would conflict with that feature. As I used autoloads quite a bit, things would also be a little inconsistent as conflicts could be dependent on the order things got loaded and that order could be affected by what I did in a specific session. - One area I do remember was with respect to handling of PDF, HTML and other document types. I had a lot of config which would automatically convert many of these types to plain text to make them easy to work with inside emacs. As modes like doc-view, eww etc were added. I recall at times, conflicts would occur. I remember at one point, what behaviour I would experience when opening a PDF would depend on what mode had been loaded. If doc-view was already loaded, I would see the PDF rendered using doc-view - if my code was already loaded, I would see a plain text version. Often, the result would not be the one I wanted. I now no longer have all that code in my init and leave such things to Emacs. In my case, much of my elisp config was pretty rough - I did as little as necessary to get the behaviour I wanted. It was often poorly tested, lacked sufficient error checking, was inconsistent and overall rough - it did the job. However, this did mean it often did not play well with others. For ages, I simply didn't bother looking at new features and modes unless I came across a new requirement e.g. learning a new programming language, working with a new system etc. My init also had large amounts of code borrowed with pride (aka stolen) from newsgroup postings, web sites, mail lists and various elisp repositories. As I tend not to bother compiling my init, you would not necessary be aware of obsolete and deprecated functions used by this code. The lack of any namespace for packages also meant name conflicts were sometimes the cause of weird bugs etc. Overall, things were 'fragile' and you would avoid making changes as much as possible. I was frequently surprised when I decided it was time to cleanup my init at various improvements and enhancements that had been added to Emacs. This is partially a result of the conservative approach Emacs tends to adopt - a good approach as it means you can usually upgrade to a new version and not end up spending hours fixing things just to get back to work. However, the downside is that it also means you may not even be aware of or benefit from some improvements. The positive is that now I have a nicely structured and documented org file with my init and making changes is easy. Actually, I have multiple configs - a standard working config, a 'new features' config where I try out new packages etc, a very simple minimal config I use for testing/debugging problems etc. I have a simple shell script which I can run and pass it an org file name which will generate a new init.el and I keep it all in git. At this time, I'm probably happier with my Emacs setup than during any period in the last 25 years. Tim Tim Cross