emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Bernt Hansen <bernt@norang.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: Table conversion problem
Date: Thu, 3 Jan 2008 18:44:41 +0100	[thread overview]
Message-ID: <2F46226A-E136-4FF8-985D-88632CD0DD3A@gmail.com> (raw)
In-Reply-To: <87tzlux2p9.fsf@gollum.intra.norang.ca>

Hi Bernt,

On Jan 3, 2008, at 6:02 PM, Bernt Hansen wrote:

> Hi Carsten,
>
> I needed to convert a bunch of tab delimited data into a table today  
> for
> an email and I knew there was a function to do this so I went to the  
> PDF
> documentation for Org-mode version 5.17a
>
> It says I can select the region to be converted into a table and then
> hit C-c | to convert it to a table but I get this error instead of the
> expected behaviour:
>
> orgtbl-error: This key is has no function outside tables
>
> Now I'm actually trying to do this outside of regular org-mode - when
> composing a mail message using orgstruct-mode and orgtbl-mode as minor
> modes.  In my *.org buffers C-c | works great.
>
> Is there a way to do this without converting the data to a table in  
> org
> mode and then cutting and pasting it back to the email I'm composing?

orgtbl-mode commands only work if there is already a table context,
and this is not the case for your application.  However, you can bind
the command `org-table-convert-region' to a key and use it directly.

If this is your only use of C-c | in orgtbl-mode, you can use to
orgtbl-mode hook and overwrite the standard (context-sensitive) binding:

(add-hook 'orgtbl-mode-hook
   (lambda ()
     (define-key orgtbl-mode-map 'org-table-convert-region "\C-c|")))

Thanks for the patch, I have applied it.

- Carsten

>
>
> Bernt
>
> PS - here's a patch for the error message text above:
>
> ---
>
> diff --git a/org.el b/org.el
> index 9d99e98..4e2e4f9 100644
> --- a/org.el
> +++ b/org.el
> @@ -7476,7 +7476,7 @@ off orgstruct-mode will *not* remove these  
> additonal settings."
> (defun orgstruct-error ()
>   "Error when there is no default binding for a structure key."
>   (interactive)
> -  (error "This key is has no function outside structure elements"))
> +  (error "This key has no function outside structure elements"))
>
> (defun orgstruct-setup ()
>   "Setup orgstruct keymaps."
> @@ -11064,7 +11064,7 @@ to execute outside of tables."
> (defun orgtbl-error ()
>   "Error when there is no default binding for a table key."
>   (interactive)
> -  (error "This key is has no function outside tables"))
> +  (error "This key has no function outside tables"))
>
> (defun orgtbl-setup ()
>   "Setup orgtbl keymaps."
> diff --git a/org_xemacs.el b/org_xemacs.el
> index ceb6eb4..67ddc00 100644
> --- a/org_xemacs.el
> +++ b/org_xemacs.el
> @@ -9338,7 +9338,7 @@ to execute outside of tables."
> (defun orgtbl-error ()
>   "Error when there is no default binding for a table key."
>   (interactive)
> -  (error "This key is has no function outside tables"))
> +  (error "This key has no function outside tables"))
>
> (defun orgtbl-setup ()
>   "Setup orgtbl keymaps."
>
>
>
>
> _______________________________________________
> 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

  reply	other threads:[~2008-01-03 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03 17:02 Table conversion problem Bernt Hansen
2008-01-03 17:44 ` Carsten Dominik [this message]
2008-01-03 17:58   ` Bernt Hansen

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=2F46226A-E136-4FF8-985D-88632CD0DD3A@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=bernt@norang.ca \
    --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).