help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to insert single quotes around a command?


From: Ian Eure
Subject: Re: how to insert single quotes around a command?
Date: Fri, 31 Oct 2008 11:30:48 -0700

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 via email to

[Prev in Thread] Current Thread [Next in Thread]