all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Harry Putnam <reader@newsguy.com>
To: emacs-devel@gnu.org
Subject: Re: paren-close-dwim: elisp function of a newbie; feedback welcome
Date: Fri, 27 Sep 2013 17:30:49 -0400	[thread overview]
Message-ID: <87siwqdkae.fsf@newsguy.com> (raw)
In-Reply-To: 52449B36.4080009@lanl.gov

Davis Herring <herring@lanl.gov> writes:

>>> (defun paren-close-dwim ()
>>>   "Insert closing parenthesis from syntax table.
>>> Use a normal parenthesis if not inside any."
>>>   (interactive "*")
>>>   (insert (or (ignore-errors
>>>                 (save-excursion (backward-up-list)
>>>                                 (cdr (syntax-after (point)))))
>>>               ?\))))
>> 
>> I'm a total illiterate in elisp but the narrative so far sounds like a
>> this code might do something really useful.
>> 
>> Can someone describe briefly how this would work, maybe with a small
>> example, when repairing my own perl code?
>
> I'm not sure what you mean about "repairing ... code".  This command
> simply inserts ')', ']', or '}' (and perhaps '>' or so) to match the
> most recent unclosed ([{<.

It was actually a reference to something Florian said in OP:

Florian wrote:
>> .  .  .  .  .  .  .  .  .  .  .  .  For me this is much handier
>> than using paren-mode or auto-pair etc, especially when modifying
>> existing code."

In my mind that registered as `repairing code'.

> (If it is "really useful", know that it's not my idea; you just quoted
> my reimplementation of Florian's code.)

Thanks, yes, sorry... I actually meant to be replying to Florian's OP.




      parent reply	other threads:[~2013-09-27 21:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-25 11:46 paren-close-dwim: elisp function of a newbie; feedback welcome Florian
2013-09-25 12:18 ` Andreas Röhler
2013-09-25 17:32 ` Davis Herring
2013-09-26 19:54   ` Harry Putnam
2013-09-26 20:38     ` Davis Herring
2013-09-26 20:44       ` Florian
2013-09-27  5:51         ` Andreas Röhler
2013-09-29  9:36           ` Ted Zlatanov
2013-09-27 21:33         ` Harry Putnam
2013-09-29 10:11         ` Óscar Fuentes
2013-09-27 21:30       ` Harry Putnam [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87siwqdkae.fsf@newsguy.com \
    --to=reader@newsguy.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.