From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xin Shi Subject: Re: shortcut keys for mark ups Date: Tue, 06 Jan 2009 13:50:39 -0500 Message-ID: <4963A7FF.1040902@cornell.edu> References: <49638861.2050606@cornell.edu> <87sknwz5pe.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKH0k-00053s-Lb for emacs-orgmode@gnu.org; Tue, 06 Jan 2009 13:50:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKH0j-00053g-8q for emacs-orgmode@gnu.org; Tue, 06 Jan 2009 13:50:41 -0500 Received: from [199.232.76.173] (port=56643 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKH0j-00053d-3I for emacs-orgmode@gnu.org; Tue, 06 Jan 2009 13:50:41 -0500 Received: from granite1.mail.cornell.edu ([128.253.83.141]:58957 helo=authusersmtp.mail.cornell.edu) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LKH0i-0004Q8-HN for emacs-orgmode@gnu.org; Tue, 06 Jan 2009 13:50:40 -0500 In-Reply-To: <87sknwz5pe.fsf@gollum.intra.norang.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode@gnu.org Hi Bernt, Thanks for your reply! That's what I was trying to do. But I think Carsten's suggestion of using the "org-structure-template-alist" is more appealing to general user. Xin Bernt Hansen wrote: > Xin Shi writes: > > >> In org mode, are there any shortcut keys for typing the following mark-ups? >> >> #+BEGIN_EXAMPLE >> #+END_EXAMPLE >> > > Not that I'm aware of. You can use a function like the following to > achieve this - or maybe you can use yasnippets (I've never tried that > yet) > > ------------------------------------------------------------------------ > (defun bth-begin-example () > (interactive) > (save-excursion > (beginning-of-line) > (insert "#+BEGIN_EXAMPLE\n") > (end-of-line) > (insert "\n#+END_EXAMPLE"))) > > > (global-set-key (kbd " e") 'bth-begin-example) > ------------------------------------------------------------------------ > > Then you can just type e while on a line and it'll put the EXAMPLE > block around the current line. > > HTH, > > -Bernt >