From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Eure Newsgroups: gmane.emacs.help Subject: Re: how to insert single quotes around a command? Date: Fri, 31 Oct 2008 11:30:48 -0700 Message-ID: <707414EF-6A63-47A9-8E92-876A0F610691@digg.com> References: <87ej1x3wp5.fsf@poczta.po.opole.pl> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1225477880 27546 80.91.229.12 (31 Oct 2008 18:31:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2008 18:31:20 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Seweryn Kokot Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 31 19:32:22 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KvynC-0000sb-BV for geh-help-gnu-emacs@m.gmane.org; Fri, 31 Oct 2008 19:32:18 +0100 Original-Received: from localhost ([127.0.0.1]:37548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kvym5-0000pL-Nj for geh-help-gnu-emacs@m.gmane.org; Fri, 31 Oct 2008 14:31:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kvylo-0000pE-O1 for help-gnu-emacs@gnu.org; Fri, 31 Oct 2008 14:30:52 -0400 Original-Received: from [199.232.76.173] (port=60661 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kvyln-0000p2-Tn for help-gnu-emacs@gnu.org; Fri, 31 Oct 2008 14:30:51 -0400 Original-Received: from mail.digg.com ([64.191.203.36]:53744) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kvyln-000596-P1 for help-gnu-emacs@gnu.org; Fri, 31 Oct 2008 14:30:51 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.digg.com (Postfix) with ESMTP id 01AD3A85501; Fri, 31 Oct 2008 11:30:50 -0700 (PDT) X-Virus-Scanned: amavisd-new at X-Spam-Score: -4.499 Original-Received: from mail.digg.com ([127.0.0.1]) by localhost (mail.digg.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nnNMq0OJxVHc; Fri, 31 Oct 2008 11:30:49 -0700 (PDT) Original-Received: from [10.2.16.90] (diggstage01.digg.com [64.191.203.34]) by mail.digg.com (Postfix) with ESMTP id B1C13A854A6; Fri, 31 Oct 2008 11:30:49 -0700 (PDT) In-Reply-To: <87ej1x3wp5.fsf@poczta.po.opole.pl> X-Mailer: Apple Mail (2.929.2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59305 Archived-At: 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