emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: emacs-orgmode@gnu.org
Subject: Re: How to set C-o back to open-line?
Date: Fri, 17 May 2013 07:53:09 +0200	[thread overview]
Message-ID: <5195C5C5.3050705@easy-emacs.de> (raw)
In-Reply-To: <87ip2is5ku.fsf@earlgrey.lan>

Am 17.05.2013 04:28, schrieb Christopher Allan Webber:
> Suvayu Ali writes:
>
>> Hello Christopher,
>>
>> On Thu, May 16, 2013 at 05:38:11PM -0500, Christopher Allan Webber wrote:
>>> I really hate org-open-line... I can see why people might want it, but
>>> it's messed up my workflow.  I'd like to set C-o back.
>>>
>>> However, I have no idea what org-defkey is doing, but I expected this to
>>> work:
>>>
>>>    (define-key org-mode-map (kbd "C-o") 'open-line)
>>>
>>> it isn't working!
>>>
>>> How to get the standard-ol-open-line behavior back?
>>
>> Does using org-defkey instead make it work?
>
> org-defkey doesn't seem to work.
>
>> That said, I'm curious what is so different about org-open-line?  The
>> docstring says the following:
>>
>>    It is bound to C-o, <insertline>.
>>
>>    (org-open-line N)
>>
>>    Insert a new row in tables, call `open-line' elsewhere.
>>
>> So unless you are in a table, it should be the same as normal.  Is that
>> broken?  Anyway, I never use open-line myself, but I was curious after I
>> saw several people mention it on unrelated threads on a few lists.
>>
>> Cheers,
>
> Right, exactly.  The way I use org-diet often involves me splitting
> apart and rejoining tables and the whole "adding a new line in between"
> is part of expected behavior for me.  The new system is driving me crazy!
>
>

Installing this instead should fix it:

(defun org-open-line (n)
   "Insert a new row in tables, call `open-line' elsewhere.
With \C-u NUMBER `open-line' is called the common way also in table context"
   (interactive "*P")
   (cond (n
          (open-line (prefix-numeric-value n)))
         ((org-at-table-p)
          (org-table-insert-row))
         (t (open-line (prefix-numeric-value n)))))

Cheers,

Andreas

  reply	other threads:[~2013-05-17  5:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 22:38 How to set C-o back to open-line? Christopher Allan Webber
2013-05-16 23:04 ` Nick Dokos
2013-05-16 23:10 ` Suvayu Ali
2013-05-17  2:28   ` Christopher Allan Webber
2013-05-17  5:53     ` Andreas Röhler [this message]
2013-05-17  8:58       ` Nicolas Richard
2013-05-17 12:26       ` Christopher Allan Webber
2013-05-17 12:37         ` Nicolas Richard
2013-05-17 22:02           ` Christopher Allan Webber
2013-05-17 17:10     ` Suvayu Ali
2013-05-17 13:12 ` Carsten Dominik
2013-05-17 22:05   ` Christopher Allan Webber
2013-09-13 19:14     ` Carsten Dominik
2013-08-31  6:12 ` Carsten Dominik

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=5195C5C5.3050705@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --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).