From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Girault Newsgroups: gmane.emacs.help Subject: Re: on adding a function call to a s-exp Date: Sun, 10 Jun 2018 22:04:41 -0300 Organization: Aioe.org NNTP Server Message-ID: <86tvqa6sly.fsf@gmail.com> References: <864libzkem.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1528679004 5387 195.159.176.226 (11 Jun 2018 01:03:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Jun 2018 01:03:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 11 03:03:20 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSBEt-0001Ii-IP for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jun 2018 03:03:19 +0200 Original-Received: from localhost ([::1]:45637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSBH0-0001T5-Mv for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Jun 2018 21:05:30 -0400 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 47 Original-NNTP-Posting-Host: LfxsaJzkGe+tObayHBu4ZQ.user.gioia.aioe.org Original-X-Complaints-To: abuse@aioe.org Cancel-Lock: sha1:+BjDSQH6BykCzXMzSGLhpEvjV+s= X-Notice: Filtered by postfilter v. 0.8.3 Original-Xref: usenet.stanford.edu gnu.emacs.help:222969 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117090 Archived-At: João Távora writes: > On Sun, Jun 10, 2018 at 3:38 AM, Noam Postavsky wrote: > >> On 9 June 2018 at 18:05, Robert Girault >> 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 Thanks!