emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Richard Riley <rileyrgdev@googlemail.com>
To: Xin Shi <xs32@cornell.edu>
Cc: Bernt Hansen <bernt@norang.ca>, emacs-orgmode@gnu.org
Subject: Re: Re: shortcut keys for mark ups
Date: Tue, 06 Jan 2009 20:25:25 +0100	[thread overview]
Message-ID: <4963b027.09c5660a.39e6.ffff9229@mx.google.com> (raw)
In-Reply-To: <4963A7FF.1040902@cornell.edu> (Xin Shi's message of "Tue, 06 Jan 2009 13:50:39 -0500")


Or use the org-mode map rather than global key

(define-key org-mode-map  (kbd "C-<f9>") '(lambda()(interactive)(insert "#+BEGIN_EXAMPLE\n\n#+END_EXAMPLE")(previous-line)))


Xin Shi <xs32@cornell.edu> 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 <xs32@cornell.edu> 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 "<f9> e") 'bth-begin-example)
>> ------------------------------------------------------------------------
>>
>> Then you can just type <f9> 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

  parent reply	other threads:[~2009-01-06 19:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-06 16:35 Xin Shi
2009-01-06 17:48 ` Bernt Hansen
2009-01-06 18:50   ` Xin Shi
2009-01-06 19:00     ` Carsten Dominik
2009-01-06 19:25     ` Richard Riley [this message]
2009-01-07 20:27   ` Patrick Drechsler
2009-01-07 22:16     ` Bernt Hansen
2009-01-07 23:05       ` Patrick Drechsler
2009-01-06 18:24 ` Carsten Dominik
2009-01-06 18:47   ` Xin Shi

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4963b027.09c5660a.39e6.ffff9229@mx.google.com \
    --to=rileyrgdev@googlemail.com \
    --cc=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    --cc=xs32@cornell.edu \
    --subject='Re: Re: shortcut keys for mark ups' \
    /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

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).