emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thomas Alexander Gerds <tagteam@sund.ku.dk>
To: emacs-orgmode@gnu.org
Subject: help regarding babel to set in-buffer specific keybinding
Date: Wed, 8 Feb 2012 08:34:02 +0100	[thread overview]
Message-ID: <grb6151uq57p91.fsf@linuxifsv005.sund.root.ku.dk> (raw)


here is a (beginner) question regarding the following org-file with
buffer-local function and keybinding:

,----
| 
| * Lisp header (C-c C-c to activate)
| #+BEGIN_SRC emacs-lisp 
|   (defun blue-file ()
|     (interactive)
|     (org-table-insert-row 'below)
|     (org-table-goto-column 1)
|     (insert (format-time-string "%d.%m.%Y"))
|     (org-table-goto-column 2)
|     (org-table-copy-down 1)
|     (org-table-goto-column 3)
|     (org-table-copy-down 1)
|     (org-table-goto-column 4))
|   (define-key org-mode-map [(meta return)] 'blue-file)
| #+END_SRC
| 
| #+RESULTS:
| : blue-file
| 
| 
| | Date | Staff        | Type        | Name | Value |
| |------+--------------+-------------+------+-------|
| |      | Anders And   | consulting  |      |       |
| |      | Anders And   | supervision |      |       |
| |      | Anders And   | teaching    |      |       |
| |      | Mickey Mouse | consulting  |      |       |
| |      | Mickey Mouse | supervision |      |       |
| |      | Mickey Mouse | teaching    |      |       |
`----

now, I would like to tell org to evaluate the lisp code at startup, when
the org-file is opened. can this be achieved? particularly, is there a
startup special line which tells org to evaluate the lisp src block?  I
could add a suitable function to org-mode-hook, but is this the
recommended way?

also, I would like to make org-mode-map buffer-local ... but certainly
this is not an orgmode question.

suggestions/help are very much appreciated!

Tomy


--
sent from nil.org

             reply	other threads:[~2012-02-08  7:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08  7:34 Thomas Alexander Gerds [this message]
2012-02-08 14:34 ` help regarding babel to set in-buffer specific keybinding Eric Schulte
2012-02-08 16:10   ` Eric S Fraga
2012-02-08 23:32     ` Torsten Wagner
2012-02-09  7:14   ` Thomas Alexander Gerds

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=grb6151uq57p91.fsf@linuxifsv005.sund.root.ku.dk \
    --to=tagteam@sund.ku.dk \
    --cc=emacs-orgmode@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).