From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Riley Subject: Re: Re: shortcut keys for mark ups Date: Tue, 06 Jan 2009 20:25:25 +0100 Message-ID: <4963b027.09c5660a.39e6.ffff9229@mx.google.com> References: <49638861.2050606@cornell.edu> <87sknwz5pe.fsf@gollum.intra.norang.ca> <4963A7FF.1040902@cornell.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKHYS-0007xn-F1 for emacs-orgmode@gnu.org; Tue, 06 Jan 2009 14:25:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKHYQ-0007xE-VL for emacs-orgmode@gnu.org; Tue, 06 Jan 2009 14:25:32 -0500 Received: from [199.232.76.173] (port=52021 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKHYQ-0007xB-PU for emacs-orgmode@gnu.org; Tue, 06 Jan 2009 14:25:30 -0500 Received: from fk-out-0910.google.com ([209.85.128.186]:22410) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKHYQ-0001oY-9W for emacs-orgmode@gnu.org; Tue, 06 Jan 2009 14:25:30 -0500 Received: by fk-out-0910.google.com with SMTP id 18so4238363fkq.10 for ; Tue, 06 Jan 2009 11:25:29 -0800 (PST) In-Reply-To: <4963A7FF.1040902@cornell.edu> (Xin Shi's message of "Tue, 06 Jan 2009 13:50:39 -0500") 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: Xin Shi Cc: Bernt Hansen , emacs-orgmode@gnu.org Or use the org-mode map rather than global key (define-key org-mode-map (kbd "C-") '(lambda()(interactive)(insert "#+BEGIN_EXAMPLE\n\n#+END_EXAMPLE")(previous-line))) Xin Shi writes: > 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 >> > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode -- important and urgent problems of the technology of today are no longer the satisfactions of the primary needs or of archetypal wishes, but the reparation of the evils and damages by the technology of yesterday. ~Dennis Gabor, Innovations: Scientific, Technological and Social, 1970