all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ian Eure <ian@digg.com>
To: Seweryn Kokot <sewkokot@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: how to insert single quotes around a command?
Date: Fri, 31 Oct 2008 11:30:48 -0700	[thread overview]
Message-ID: <707414EF-6A63-47A9-8E92-876A0F610691@digg.com> (raw)
In-Reply-To: <87ej1x3wp5.fsf@poczta.po.opole.pl>

On Oct 31, 2008, at 3:06 AM, Seweryn Kokot wrote:

> Hello,
>
> Many times when I write doc strings for elisp functions I forget to  
> insert
> single-quotes around commands or variables like `a-command' or  
> insert it
> wrong like 'a-command'. Is there a function or keybinding to do it
> properly? Maybe a function which enclose a selected command with
> single-quotes?
>

Sounds like you want insert-pair:
(define-key (current-global-map) "\M-'" 'insert-pair)
(define-key (current-global-map) "\C-c`" 'insert-pair)

Which makes M-' insert a pair of single quotes, and C-c ` insert `'.  
Then you can do M-1 M-' or M-1 C-c ` to enclose the sexp following  
point in the correct quotes.

insert-pair is super handy, I use M-(sym) for () "" [] etc.

  - Ian






  reply	other threads:[~2008-10-31 18:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-31 10:06 how to insert single quotes around a command? Seweryn Kokot
2008-10-31 18:30 ` Ian Eure [this message]
2008-10-31 20:22   ` Seweryn Kokot
  -- strict thread matches above, loose matches on Subject: below --
2008-10-31 12:44 martin rudalics
2008-10-31 14:33 ` Seweryn Kokot
     [not found] <mailman.2562.1225457196.25473.help-gnu-emacs@gnu.org>
2008-10-31 20:09 ` Barry Margolin
2008-10-31 21:42 martin rudalics
2008-10-31 21:42 martin rudalics

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=707414EF-6A63-47A9-8E92-876A0F610691@digg.com \
    --to=ian@digg.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=sewkokot@gmail.com \
    /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.