[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: on adding a function call to a s-exp
From: |
João Távora |
Subject: |
Re: on adding a function call to a s-exp |
Date: |
Tue, 12 Jun 2018 15:24:17 +0100 |
On Mon, Jun 11, 2018 at 2:04 AM, Robert Girault <rfrancoisgirault@gmail.com>
wrote:
> João Távora <joaotavora@gmail.com> writes:
>
> > On Sun, Jun 10, 2018 at 3:38 AM, Noam Postavsky <npostavs@gmail.com>
> wrote:
> >
> >> On 9 June 2018 at 18:05, Robert Girault <rfrancoisgirault@gmail.com>
> >> wrote:
> >> > In Lisp mode, when I select a region, in whatever way of selecting it,
> >> > and press (, it surrounds the region with parentheses, (...|), but it
> >>
> >> Hmm, that must be some package you have installed, by default ( just
> >> inserts a ( at point without wrapping anything.
> >>
> >> > puts the point where ``|'' is. I'd like the point to be at (|...) so
> >> > I can add a function call to that region without having to move the
> >> > point back to the beginning of the region.
> >> >
> >> > I'm surprised this isn't the default behavior.
> >>
> >> In emacs -Q M-( does what you want.
> >>
> >> M-( runs the command insert-parentheses (found in global-map), which
> >> is an interactive compiled Lisp function in ‘lisp.el’.
> >>
> >> It is bound to M-(.
> >>
> >> (insert-parentheses &optional ARG)
> >>
> >> Enclose following ARG sexps in parentheses.
> >> Leave point after open-paren.
> >> [...]
> >> If region is active, insert enclosing characters at region boundaries.
> >>
> >> Additionally, if the "autopairing/autowrapping" package you are using is
> > Emacs's built-in M-x electric-pair-mode, it should work exactly as you
> > explain: "(" leaves the point after the opener and ")" leaves point after
> > the closer (and both wrap the region, obviously).
>
> I do not confirm this. Try this: emacs -Q
>
> + 1 2 3 C-a C-space C-e M-(
>
> it will leave the point at where the | character is in ``(+ 1 2 3|)''.
> It could a version difference. I'm running
>
> GNU Emacs 24.3.1 (i386-mingw-nt6.2.9200) of 2013-03-17 on MARVIN
>
> Oh then I take it back, the improved electric-pair-mode only made it in
24.4.
BTW why are you running a 5year+ old emacs version?
João
Re: on adding a function call to a s-exp, Xavier Maillard, 2018/06/10
Message not available
- Re: on adding a function call to a s-exp, Robert Girault, 2018/06/10
- Message not available
- Re: on adding a function call to a s-exp, Robert Girault, 2018/06/11
- Re: on adding a function call to a s-exp, João Távora, 2018/06/12
- Re: on adding a function call to a s-exp, Óscar Fuentes, 2018/06/12
- RE: on adding a function call to a s-exp, Drew Adams, 2018/06/12