Re: [O] How to set C-o back to open-line?

2013-09-13 Thread Carsten Dominik
Hi Christopher,

you can now do

(setq org-special-ctrl-o nil)

to get what you want.

Regards

- Carsten

On 18.5.2013, at 00:05, Christopher Allan Webber  wrote:

> Carsten Dominik writes:
> 
>> On 17.5.2013, at 00:38, 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)
>> 
>> This one will work if you do it in org-mode-hook.
> 
> Ahah... okay, great, thanks :)
> 
>> We could also introduce a variable to turn off the special behavior,
>> just like we do for C-a, C-e, and C-k.  This seems to me a better
>> option than to introduce additional context dependencies or use
>> prefix arguments to influence the behavior.
>> 
>> - Carsten
> 
> I think that would be nice.  We have options for everything else, why
> not this? ;)
> 
> Thanks for the help, all!



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [O] How to set C-o back to open-line?

2013-08-30 Thread Carsten Dominik
Hi Christopher,

Would you like to prepare a patch to this effect?

- Carsten

On 17.5.2013, at 00:38, 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?
> 




Re: [O] How to set C-o back to open-line?

2013-05-17 Thread Christopher Allan Webber
Carsten Dominik writes:

> On 17.5.2013, at 00:38, 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)
>
> This one will work if you do it in org-mode-hook.

Ahah... okay, great, thanks :)

> We could also introduce a variable to turn off the special behavior,
> just like we do for C-a, C-e, and C-k.  This seems to me a better
> option than to introduce additional context dependencies or use
> prefix arguments to influence the behavior.
>
> - Carsten

I think that would be nice.  We have options for everything else, why
not this? ;)

Thanks for the help, all!



Re: [O] How to set C-o back to open-line?

2013-05-17 Thread Christopher Allan Webber
Nicolas Richard writes:

>>   (setq org-open-line 'open-line)
>
> How could that possibly work ?

It didn't... my bad :)  I had both set that and done a redefinition of
org-open-line to just call open-line like:

(defun org-open-line (n)
  (interactive "*p")
  (open-line n))

Guess which one actually did anything ;)



Re: [O] How to set C-o back to open-line?

2013-05-17 Thread Suvayu Ali
On Thu, May 16, 2013 at 09:28:35PM -0500, Christopher Allan Webber wrote:
> Suvayu Ali writes:
> 
> > That said, I'm curious what is so different about org-open-line?  The
> > docstring says the following:
> >
> >   It is bound to C-o, .
> >   
> >   (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.
> 
> 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!

Thanks, I see the use case.  I did have a similar need a few times.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] How to set C-o back to open-line?

2013-05-17 Thread Carsten Dominik

On 17.5.2013, at 00:38, 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)

This one will work if you do it in org-mode-hook.

We could also introduce a variable to turn off the special behavior,
just like we do for C-a, C-e, and C-k.  This seems to me a better
option than to introduce additional context dependencies or use
prefix arguments to influence the behavior.

- Carsten

> 
> it isn't working!
> 
> How to get the standard-ol-open-line behavior back?
> 




Re: [O] How to set C-o back to open-line?

2013-05-17 Thread Nicolas Richard
Christopher Allan Webber  writes:
> Hm, alright.  Sadly there seems to be no way to change the key (very
> un-emacs like?)

That was answered by Nick Dokos ; use :
  (define-key org-mode-map [remap open-line] nil)

(btw, why does org use remap here is a mystery to me)

>   (setq org-open-line 'open-line)

How could that possibly work ?

-- 
Nico.



Re: [O] How to set C-o back to open-line?

2013-05-17 Thread Christopher Allan Webber
Andreas Röhler writes:

> 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

Hm, alright.  Sadly there seems to be no way to change the key (very
un-emacs like?)  So if redefining it is the way, I replaced with the
much simpler:

  (setq org-open-line 'open-line)

Much better!  Hopefully no tooling ever makes use of org-open-line,
shooting me in the foot... :)



Re: [O] How to set C-o back to open-line?

2013-05-17 Thread Nicolas Richard
Andreas Röhler  writes:
> (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)

I think that calling open-line in a table only makes sense at bol, so
I'd suggest this :

(defun org-open-line (n)
  "Insert a new row in tables, call `open-line' elsewhere.

As an exception, if point is at the beginning of a
line,`open-line' is called."
  (interactive "*p")
  (if (and (not (bolp)) (org-at-table-p))
  (org-table-insert-row)
(open-line n)))

or even the following, so as to use the argument also in tables.

(defun org-open-line (n)
  "Insert a new row in tables, call `open-line' elsewhere.

As an exception, if point is at the beginning of a
line,`open-line' is called. The argument N is the number of rows
or lines to insert."
  (interactive "*p")
  (if (and (not (bolp)) (org-at-table-p))
  (dotimes (_ n)
(org-table-insert-row))
(open-line n)))


-- 
Nico.



Re: [O] How to set C-o back to open-line?

2013-05-16 Thread Andreas Röhler

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, .

   (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




Re: [O] How to set C-o back to open-line?

2013-05-16 Thread 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, .
>   
>   (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!



Re: [O] How to set C-o back to open-line?

2013-05-16 Thread Suvayu Ali
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?

That said, I'm curious what is so different about org-open-line?  The
docstring says the following:

  It is bound to C-o, .
  
  (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,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] How to set C-o back to open-line?

2013-05-16 Thread Nick Dokos
Christopher Allan Webber  writes:

> 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?
>
>

Try

  (define-key org-mode-map [remap open-line] nil)

You may have to do it in a hook.

See

  (info "(elisp) Remapping commands")

for details.
-- 
Nick




[O] How to set C-o back to open-line?

2013-05-16 Thread Christopher Allan Webber
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?