Re: [O] org-meta-return not on M-RET

2017-09-17 Thread Nicolas Goaziou
Hello,

Scott Otterson  writes:

> The purpose of the M-RET binding is to allow quick splitting of long
> headlines generated during rapid brainstorming e.g.
>
> * Common pets are cats and dogs
>
> Can be quickly converted using M-RET to:
>
> * Common pets are
> * cats and
> * dogs
>
> This is a short distance from
>
> * Common pets
>   * cats
>   * dogs
>
> This used to be in the documentation, and I use this function all the
> time.  I'd hate to lose it.

I'm not sure to understand your concern.

We are not removing M-RET keybinding, but removing a duplicate binding:
[(meta return)]

Regards,

-- 
Nicolas Goaziou



Re: [O] org-meta-return not on M-RET

2017-09-17 Thread Nicolas Goaziou
Hello,

Allen Li  writes:

> I believe Emacs does intelligent remapping; for example if you type
> M-return in GUI Emacs, if there are no bindings for M-return it will
> look up the binding for M-RET.  Therefore simply binding M-RET and
> removing the M-return binding is "better"/"cleaner".  This is a hugely
> trivial nitpick, but I thought I'd point it out

Done. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] org-meta-return not on M-RET

2017-09-17 Thread Allen Li
On Sat, Sep 16, 2017 at 8:20 AM, Nicolas Goaziou  wrote:
> Hello,
>
> Allen Li  writes:
>
>> When I could not get org-meta-return to work in terminal Emacs, I
>> realized that org-meta-return is only bound to M-return and not M-RET.
>> Is there any particular reason for this?
>
> No idea. Fixed. Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou

Thanks for the quick fix.

I believe Emacs does intelligent remapping; for example if you type
M-return in GUI Emacs, if there are no bindings for M-return it will
look up the binding for M-RET.  Therefore simply binding M-RET and
removing the M-return binding is "better"/"cleaner".  This is a hugely
trivial nitpick, but I thought I'd point it out



Re: [O] org-meta-return not on M-RET

2017-09-16 Thread Gregor Zattler
Hi Nicolas, Allen,
* Nicolas Goaziou  [2017-09-16; 17:20]:
> Allen Li  writes:
>
>> When I could not get org-meta-return to work in terminal Emacs, I
>> realized that org-meta-return is only bound to M-return and not M-RET.
>> Is there any particular reason for this?
>
> No idea. Fixed. Thank you.

Thanks to both of you: It used to work, then it didn't, only a
few days ago I realised there was a difference between M-RETURN
and M-RET but thought of this as a configuration error and now it
simply works again!

Regards, Gregor




Re: [O] org-meta-return not on M-RET

2017-09-16 Thread Nicolas Goaziou
Hello,

Allen Li  writes:

> When I could not get org-meta-return to work in terminal Emacs, I
> realized that org-meta-return is only bound to M-return and not M-RET.
> Is there any particular reason for this?

No idea. Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



[O] org-meta-return not on M-RET

2017-09-15 Thread Allen Li
When I could not get org-meta-return to work in terminal Emacs, I
realized that org-meta-return is only bound to M-return and not M-RET.
Is there any particular reason for this?



Re: [O] org-meta-return

2016-10-31 Thread Nicolas Goaziou
Hello,

42 147  writes:

> I notice that org-meta-return now inserts a space between the new headline
> and the previous headline. This was not the functionality before (not sure
> which update changed it).

Not sure to understand "before" what. In any case, wouldn't you be
looking for `org-blank-before-new-entry'?

Regards,

-- 
Nicolas Goaziou



[O] org-meta-return

2016-10-30 Thread 42 147
Hello,

I notice that org-meta-return now inserts a space between the new headline
and the previous headline. This was not the functionality before (not sure
which update changed it).

Either that, or I preferred defective functionality all along.

Any way to restore the old org-meta-return?

Thanks,

John



Re: [O] org-meta-return

2013-03-03 Thread Michael Brand
Hi John

On Sun, Mar 3, 2013 at 12:59 AM, 42 147 aeus...@gmail.com wrote:
 That said, were you a QWERTY user before you transitioned into Colemak?

Yes.

Michael



Re: [O] org-meta-return

2013-03-03 Thread Eric Abrahamsen
Michael Brand michael.ch.br...@gmail.com writes:

 Hi John

 On Feb 21, 2013 10:16 PM, 42 147 aeus...@gmail.com wrote:
 [continues off-topic]

  Have you tried a Dvorak keyboard?

 A friend of mine ridicules me for being a QWERTY typist, but I have
 found
 no empirical evidence that it is actually superior. At best, it has
 been
 proven, in /some/ studies, to be /slightly/ superior; and from a
 cost-benefit standpoint, /slight/ superiority according to /some/
 studies
 (and I should add, only at extreme speeds), is not worth relearning
 how to
 type.

 Colemak is a much better keyboard layout than Dvorak. I have been
 using Colemak for many years now with great pleasure.

Whoa, that's what I was looking for! Keyboard layout taped to the wall,
typing this in Colemak now. Thanks for the tip.

E




Re: [O] org-meta-return

2013-03-02 Thread Michael Brand
Hi John

On Feb 21, 2013 10:16 PM, 42 147 aeus...@gmail.com wrote:
 [continues off-topic]

  Have you tried a Dvorak keyboard?

 A friend of mine ridicules me for being a QWERTY typist, but I have found
 no empirical evidence that it is actually superior. At best, it has been
 proven, in /some/ studies, to be /slightly/ superior; and from a
 cost-benefit standpoint, /slight/ superiority according to /some/ studies
 (and I should add, only at extreme speeds), is not worth relearning how to
 type.

Colemak is a much better keyboard layout than Dvorak. I have been using
Colemak for many years now with great pleasure.

Michael


Re: [O] org-meta-return

2013-03-02 Thread 42 147
Michael,

Did a little research on Colemak: appears to be (1) as or even slightly
more ergonomic than Dvorak, in terms of measurable results; and (2)
designed for QWERTY users.

That said, were you a QWERTY user before you transitioned into Colemak?

. . .

Does anyone here type Russian characters? I've started learning how to type
the alphabet using Cyrillic stickers on my keyboard, and it /seems/ to be
more ergonomically organized -- but perhaps that is just because I'm
systematically learning it, rather than intuitively, and over many years,
as I did with English QWERTY.


2013/3/2 Michael Brand michael.ch.br...@gmail.com

 Hi John

 On Feb 21, 2013 10:16 PM, 42 147 aeus...@gmail.com wrote:
  [continues off-topic]
 
   Have you tried a Dvorak keyboard?
 
  A friend of mine ridicules me for being a QWERTY typist, but I have found
  no empirical evidence that it is actually superior. At best, it has been
  proven, in /some/ studies, to be /slightly/ superior; and from a
  cost-benefit standpoint, /slight/ superiority according to /some/ studies
  (and I should add, only at extreme speeds), is not worth relearning how
 to
  type.

 Colemak is a much better keyboard layout than Dvorak. I have been using
 Colemak for many years now with great pleasure.

 Michael



Re: [O] org-meta-return

2013-02-26 Thread Eric S Fraga
Nick Dokos nicholas.do...@hp.com writes:


[...]

 I hope everybody does that. I use both the left and right control keys 
 depending
 on where the controlled key is: C-whatever is always a two-hand operation 
 for me.
 M-x is not however (they are close enough so that left thumb and index can do 
 the
 job): both right and left Alt keys are mapped to meta so there is no reason 
 it couldn't
 be other than habit. But I probably should get out of the habit.

As a previous sufferer of serious RSI, I always warn people against
key-chording that requires any contortion.  C-M-x (with x=anything on
the left half of the keyboard basically) is a bad thing.  In fact, often
anything with M- is bad for me.  I tend to avoid such key chords.  For
instance, for M-x, I have

   (global-set-key '[(control x) (control m)] 'execute-extended-command)

Actually, in practice, I use evil-mode everywhere so I have practically
no key chords!  For M-x, I type , x...  I have defined a number of key
org commands into the evil key maps and I'm a happy camper!

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_7.9.3f-1199-g3a0e55




Re: [O] org-meta-return

2013-02-26 Thread Sebastien Vauban
Eric,

Eric S Fraga wrote:
 Nick Dokos nicholas.do...@hp.com writes:

 [...]

 I hope everybody does that. I use both the left and right control keys
 depending on where the controlled key is: C-whatever is always a two-hand
 operation for me. M-x is not however (they are close enough so that left
 thumb and index can do the job): both right and left Alt keys are mapped to
 meta so there is no reason it couldn't be other than habit. But I probably
 should get out of the habit.

 As a previous sufferer of serious RSI, I always warn people against
 key-chording that requires any contortion. C-M-x (with x=anything on the
 left half of the keyboard basically) is a bad thing. In fact, often anything
 with M- is bad for me. I tend to avoid such key chords. For instance, for
 M-x, I have

(global-set-key '[(control x) (control m)] 'execute-extended-command)

 Actually, in practice, I use evil-mode everywhere so I have practically no
 key chords! For M-x, I type , x... I have defined a number of key org
 commands into the evil key maps and I'm a happy camper!

Quite a bit OT, but is it true that, for example, to type `C-whatever', we
should use both hands, one for `C' and the other for `whatever'?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] org-meta-return

2013-02-26 Thread Suvayu Ali
On Tue, Feb 26, 2013 at 12:10:13PM +0100, Sebastien Vauban wrote:
 
 Quite a bit OT, but is it true that, for example, to type `C-whatever', we
 should use both hands, one for `C' and the other for `whatever'?

I determine that depending on the key combination.  e.g. C-x or C-s I do
with my left hand with the left control key, but I do C-l, C-k, C-y, M-y
with two hands with the left control key.  Somehow I have a preference
towards using control or meta keys with my left hand eventhough I find
the two handed version much more comfortable.  Maybe it's time to
consciously switch to two handed key presses for everything.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] org-meta-return

2013-02-26 Thread Eric S Fraga
Sebastien Vauban wxhgmqzgw...@spammotel.com writes:

 Eric,


[...]

 Quite a bit OT, but is it true that, for example, to type `C-whatever', we
 should use both hands, one for `C' and the other for `whatever'?

Hi Seb,

Yes, just as one should do with the shift key.  However, the problem
with C- is that the right control key is in random locations...  I
should add that I always remap the CAPS lock to be my left Control key.

This whole topic may look like it is indeed OT (sorry!) but it is
actually quite relevant for org in that many key sequences are C- and M-
based, not to mention M-S-...  Okay, maybe this is an emacs issue rather
than just org alone.

Luckily, for me, I have been able to remap the majority of the ones I
use (not that many) to single key strokes in evil's [1] /normal/ state
including  and  for org-metaleft and org-metaright.  Prior to my using
evil full time, I made extensive use of the speek keys in org.

And, using evil mode allows me to use org more capably when on a TTY
interface, e.g. via ssh from my phone where M- is impossible and even
some S- keystrokes are inaccessible.


Footnotes: 
[1]  git://gitorious.org/evil/evil.git

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_7.9.3f-1199-g3a0e55




Re: [O] org-meta-return

2013-02-22 Thread James Harkins
42 147 aeuster at gmail.com writes:

 [continues off-topic]
 Have you tried a Dvorak keyboard?
 A friend of mine ridicules me for being a QWERTY typist, but I have found no 
empirical evidence that it is actually superior. At best, it has been
 proven, in /some/ studies, to be /slightly/ superior; and from a cost-benefit 
standpoint, /slight/ superiority according to /some/ studies (and I should add, 
only at extreme speeds), is not worth relearning how to type.

FWIW, and I'm well aware this is purely anecdotal evidence with a sample size 
of 
1, after I switched to Dvorak some years ago, the difference in the amount of 
strain and fatigue I felt in my fingers and wrists was (and still is) more than 
slight. I know it's still the case because I have my customized Dvorak layout 
in 
Linux (it's basically a mirror image, but slightly different from left-handed 
Dvorak), but I never figured out how to replicate it in Windows 7. I don't have 
to use win7 often, just for teaching some Windows-only software, so it hasn't 
been worth digging through Microsoft documents. I've actually gotten a fair 
amount of QWERTY speed back, but boy, I can sure feel how much more *work* it 
is. The muscle movements flow in Dvorak, and they don't in QWERTY (not 
surprising, since QWERTY's purpose was to slow typists down and prevent the 
machinery from jamming).

I can believe that studies would find only a slight /speed/ improvement, but we 
aren't talking about speed. We're talking about RSI pain. I'd at least question 
the relevance of words/minute studies to measure reduction in muscle effort. 
Studies of finger travel are more on point.

The cost of relearning to type is high, but the cost is temporary and the 
benefits last the rest of your life.

Just my experience.
hjh




Re: [O] org-meta-return

2013-02-21 Thread 42 147
[continues off-topic]

 Have you tried a Dvorak keyboard?

A friend of mine ridicules me for being a QWERTY typist, but I have found
no empirical evidence that it is actually superior. At best, it has been
proven, in /some/ studies, to be /slightly/ superior; and from a
cost-benefit standpoint, /slight/ superiority according to /some/ studies
(and I should add, only at extreme speeds), is not worth relearning how to
type.

I should add, he, too, changed the default Emacs keybindings to be
positional. But he ended up changing /different/ defaults.

2013/2/20 Nick Dokos nicholas.do...@hp.com

 [Warning: off-topic]

 42 147 aeus...@gmail.com wrote:

  My hands might be smaller than average, or, at least, smaller than yours.
  To reach right I must shift my entire arm to the right and
  downward. To reach RET no such movement is necessary. Maybe a slight
  turn of the wrist to the right.
 

 I doubt my hands are bigger than yours: I have to do exactly what you
 describe (at least on the bigger keyboards). It's just not as big a deal
 for me as it is for you.

   Of course, these things are *highly* personal preferences, and you
 might
   have a lower tolerance for pain than I have, but I have to ask: where
   exactly is your right key relative to RET?
 
  Warning, digression:
 
  I'm ultra cautious about finger / wrist strain. Even if I feel slight
  discomfort from a keybinding, I will change it to be more ergonomic and
  strain-free. Practically every basic Emacs movement command has been
  rebound for optimum comfort as a QWERTY typist.
 
  Many of the default Emacs keybindings are notational, not positional. For
  example, C-p and C-n. I've made them all positional. C-p / C-] are now
  paired together for previous-line / next-line. C-q / C-e for
  beginning-of-line / end-of-line. From a positional standpoint, C-p / C-n
  makes absolutely no sense.
 

 Agreed - they are only mnemonically significant. And I think you are
 right in taking precautions. As I said, I'm a sufficiently bad typist
 so that all these sins have not bitten me (at least not yet - and they
 are rapidly running out of time).

 Have you tried a Dvorak keyboard? My son uses a QWERTY keyboard, mapped
 in software to Dvorak - he learnt to touch type on one by switching
 all the keycaps, although he didn't need the crutch
 after a while, so his second keyboard has all the keycaps in the
 standard places - they just produce different characters than what the
 keycaps say. This had two advantages for him: the Dvorak placement
 which reduces strain (supposedly at least), and the fact that I
 couldn't say to him Move over and let me drive for a while. I tried
 a couple of times and I can still hear his laughter... I suspect
 that unless one is an experienced Dvorak typist, it is a better security
 device than many passwords :-)

 I'm not sure a Dvorak keyboard would help with emacs chords though.
 Another possibility is one of the funky Kinesis keyboards: a colleague
 would wax ecstatic about his, but he was not an emacs user. And they
 are too expensive to buy one just to try it out.

 I'd be interested if somebody has tried either a Dvorak keyboard or
 a Kinesis one with emacs - but this is way off-topic by now, so maybe
 not.

 Nick





[O] org-meta-return

2013-02-20 Thread 42 147

Invaluable command, but often I want to insert a new headline at point
that is one level down; i.e.:

*** topic_1

[COMMAND]

 subtopic

As an expansion to:

*** topic_1

M-RET

*** topic_2




Re: [O] org-meta-return

2013-02-20 Thread Suvayu Ali
On Wed, Feb 20, 2013 at 02:32:16PM -0500, 42 147 wrote:
 
 Invaluable command, but often I want to insert a new headline at point
 that is one level down; i.e.:
 
 *** topic_1
 
 [COMMAND]
 
  subtopic

M-RET M-right

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] org-meta-return

2013-02-20 Thread 42 147
 M-RET M-right

Appreciate the reply, but that's worse than what I was doing. M-right
is not anywhere close to my high frequency areas of finger activity.
I've changed all such keybindings.

I notice that C-M-RET is undefined. If anyone wants to add the
functionality as described in my original post, and bind it to that key
chord, I would be grateful; in the meantime, I'll create a macro /
interactive defun to do the same.


Re: [O] org-meta-return

2013-02-20 Thread Jonathan Leech-Pepin
Hello

On 20 February 2013 16:17, 42 147 aeus...@gmail.com wrote:

  M-RET M-right

 Appreciate the reply, but that's worse than what I was doing. M-right
 is not anywhere close to my high frequency areas of finger activity.
 I've changed all such keybindings.


You can also use TAB on an empty headline to cycle through the various
levels:
+1 level, -1 level, -2..n levels (until it reaches the top level *), and
then back
to the level it was created at.

Regards,

Jon

I notice that C-M-RET is undefined. If anyone wants to add the
 functionality as described in my original post, and bind it to that key
 chord, I would be grateful; in the meantime, I'll create a macro /
 interactive defun to do the same.




Re: [O] org-meta-return

2013-02-20 Thread Suvayu Ali
On Wed, Feb 20, 2013 at 04:17:48PM -0500, 42 147 wrote:
 
 I notice that C-M-RET is undefined. If anyone wants to add the
 functionality as described in my original post, and bind it to that key
 chord, I would be grateful; in the meantime, I'll create a macro /
 interactive defun to do the same.

Jon's suggestion is pretty good, but you can also do

  (org-defkey org-mode-map (kbd C-M-RET) 'my-interactive-defun)

where my-interactive-defun does what you want.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] org-meta-return

2013-02-20 Thread Nick Dokos
42 147 aeus...@gmail.com wrote:

  M-RET M-right
 
 Appreciate the reply, but that's worse than what I was doing. M-right
 is not anywhere close to my high frequency areas of finger activity
 I've changed all such keybindings.
 

In all three keyboards I use regularly, right is fairly close to RET
(and to the right Control key): I can reach it fairly easily with my
right pinky, same as with RET - it does require a bigger stretch for
the full-size keyboards than it does on the laptop keyboard - although
I'm a sufficiently bad typist that I often have to resort to looking at
the keyboard in such situations, in which case I use my right index
finger (for RET as well as right or other arrow key).

That's not too bad because it's not as if this is a frequent activity
for me. Org's standard keymaps also use arrow keys fairly heavily, so
changing all of them sounds like a lot of work: I've tried swimming
against such tides before, but invariably I have given up exhausted,
gone back to the standard keymap and lived a much happier life.

Of course, these things are *highly* personal preferences, and you might
have a lower tolerance for pain than I have, but I have to ask: where
exactly is your right key relative to RET? How far 

 I notice that C-M-RET is undefined. If anyone wants to add the
 functionality as described in my original post, and bind it to that key
 chord, I would be grateful; in the meantime, I'll create a macro /
 interactive defun to do the same.
 

If, despite my warnings, you still want to proceed, you can do something
like this (lightly tested) - add it to the end of your .emacs:

--8---cut here---start-8---
(defun my-org-control-meta-return ()
   Assume we are in headline context: open a new headline one level
   below the current one.
   (interactive)
   (org-insert-heading)
   (org-metaright))

(defun my-org-mode-hook ()
   (define-key org-mode-map (org-key [(control meta return)]) 
'my-org-control-meta-return))

(add-hook 'org-mode-hook (function my-org-mode-hook))
--8---cut here---end---8---

Although I use some org facilities above (org-key in particular), this
is a general process which you might want to add to your arsenal of
emacs techniques:

o Define a hook (a function of no arguments) and add it to the mode's
  hook. When the mode is loaded, it runs its mode hook as the last thing
  it does.

o The hook (re)defines a key in some keymap (org-mode-map above),
  binding a function of your choosing to the key. It can of course do
  other things as well (or in place of redefining keys).

o Finally, write the function that's to be bound to the key. This is
  absolutely at your discretion: make it do whatever you want it to do
  when you press that key.

Note however that org-meta-return checks the context that it is called
from and does the Right Thing (tm). my-org-control-meta-return just
assumes it's at a headline context and proceeds blindly, e.g. if you do
C-M-RET in a table, you'll probably mess up the table.  Making it
bullet-proof is left as an exercise for the interested reader.

Read more about hooks at

 (info (emacs) Hooks)

Nick



Re: [O] org-meta-return

2013-02-20 Thread W. Greenhouse
Nick Dokos nicholas.do...@hp.com writes:

 That's not too bad because it's not as if this is a frequent activity
 for me. Org's standard keymaps also use arrow keys fairly heavily, so
 changing all of them sounds like a lot of work: I've tried swimming
 against such tides before, but invariably I have given up exhausted,
 gone back to the standard keymap and lived a much happier life.

Nick's post was a great overview of how to customize keymaps in Emacs
(and why one might not want to do so).  Just wanted to add that we have
two or three nearly complete alternate binding sets for org already:
(info (org) TTY keys) and the speed commands (listed in the variable
`org-speed-commands-default'.  The TTY keys in particular, although
lengthy, are pretty good at keeping one's hands on the keyboard (for
those of us who are serious touch typists and know what they're doing,
i.e. not myself).

-- 
Regards,
WGG




Re: [O] org-meta-return

2013-02-20 Thread 42 147
 You can also use TAB on an empty headline to cycle through the various
 levels: +1 level, -1 level, -2..n levels (until it reaches the top level
 *), and then back to the level it was created at.

Good to know, but I ended up with a simple defun and org-mode-hook. Will
probably add what you said to my arsenal, however.

My hands might be smaller than average, or, at least, smaller than yours.
To reach right I must shift my entire arm to the right and
downward. To reach RET no such movement is necessary. Maybe a slight
turn of the wrist to the right.

 Of course, these things are *highly* personal preferences, and you might
 have a lower tolerance for pain than I have, but I have to ask: where
 exactly is your right key relative to RET?

Warning, digression:

I'm ultra cautious about finger / wrist strain. Even if I feel slight
discomfort from a keybinding, I will change it to be more ergonomic and
strain-free. Practically every basic Emacs movement command has been
rebound for optimum comfort as a QWERTY typist.

Many of the default Emacs keybindings are notational, not positional. For
example, C-p and C-n. I've made them all positional. C-p / C-] are now
paired together for previous-line / next-line. C-q / C-e for
beginning-of-line / end-of-line. From a positional standpoint, C-p / C-n
makes absolutely no sense.


2013/2/20 Nick Dokos nicholas.do...@hp.com

 42 147 aeus...@gmail.com wrote:

   M-RET M-right
 
  Appreciate the reply, but that's worse than what I was doing. M-right
  is not anywhere close to my high frequency areas of finger activity
  I've changed all such keybindings.
 

 In all three keyboards I use regularly, right is fairly close to RET
 (and to the right Control key): I can reach it fairly easily with my
 right pinky, same as with RET - it does require a bigger stretch for
 the full-size keyboards than it does on the laptop keyboard - although
 I'm a sufficiently bad typist that I often have to resort to looking at
 the keyboard in such situations, in which case I use my right index
 finger (for RET as well as right or other arrow key).

 That's not too bad because it's not as if this is a frequent activity
 for me. Org's standard keymaps also use arrow keys fairly heavily, so
 changing all of them sounds like a lot of work: I've tried swimming
 against such tides before, but invariably I have given up exhausted,
 gone back to the standard keymap and lived a much happier life.

 Of course, these things are *highly* personal preferences, and you might
 have a lower tolerance for pain than I have, but I have to ask: where
 exactly is your right key relative to RET? How far

  I notice that C-M-RET is undefined. If anyone wants to add the
  functionality as described in my original post, and bind it to that key
  chord, I would be grateful; in the meantime, I'll create a macro /
  interactive defun to do the same.
 

 If, despite my warnings, you still want to proceed, you can do something
 like this (lightly tested) - add it to the end of your .emacs:

 --8---cut here---start-8---
 (defun my-org-control-meta-return ()
Assume we are in headline context: open a new headline one level
below the current one.
(interactive)
(org-insert-heading)
(org-metaright))

 (defun my-org-mode-hook ()
(define-key org-mode-map (org-key [(control meta return)])
 'my-org-control-meta-return))

 (add-hook 'org-mode-hook (function my-org-mode-hook))
 --8---cut here---end---8---

 Although I use some org facilities above (org-key in particular), this
 is a general process which you might want to add to your arsenal of
 emacs techniques:

 o Define a hook (a function of no arguments) and add it to the mode's
   hook. When the mode is loaded, it runs its mode hook as the last thing
   it does.

 o The hook (re)defines a key in some keymap (org-mode-map above),
   binding a function of your choosing to the key. It can of course do
   other things as well (or in place of redefining keys).

 o Finally, write the function that's to be bound to the key. This is
   absolutely at your discretion: make it do whatever you want it to do
   when you press that key.

 Note however that org-meta-return checks the context that it is called
 from and does the Right Thing (tm). my-org-control-meta-return just
 assumes it's at a headline context and proceeds blindly, e.g. if you do
 C-M-RET in a table, you'll probably mess up the table.  Making it
 bullet-proof is left as an exercise for the interested reader.

 Read more about hooks at

  (info (emacs) Hooks)

 Nick



Re: [O] org-meta-return

2013-02-20 Thread Nick Dokos
[Warning: off-topic]

42 147 aeus...@gmail.com wrote:

 My hands might be smaller than average, or, at least, smaller than yours.
 To reach right I must shift my entire arm to the right and
 downward. To reach RET no such movement is necessary. Maybe a slight
 turn of the wrist to the right.
 

I doubt my hands are bigger than yours: I have to do exactly what you
describe (at least on the bigger keyboards). It's just not as big a deal
for me as it is for you.

  Of course, these things are *highly* personal preferences, and you might
  have a lower tolerance for pain than I have, but I have to ask: where
  exactly is your right key relative to RET?
 
 Warning, digression:
 
 I'm ultra cautious about finger / wrist strain. Even if I feel slight
 discomfort from a keybinding, I will change it to be more ergonomic and
 strain-free. Practically every basic Emacs movement command has been
 rebound for optimum comfort as a QWERTY typist.
 
 Many of the default Emacs keybindings are notational, not positional. For
 example, C-p and C-n. I've made them all positional. C-p / C-] are now
 paired together for previous-line / next-line. C-q / C-e for
 beginning-of-line / end-of-line. From a positional standpoint, C-p / C-n
 makes absolutely no sense.
 

Agreed - they are only mnemonically significant. And I think you are
right in taking precautions. As I said, I'm a sufficiently bad typist
so that all these sins have not bitten me (at least not yet - and they
are rapidly running out of time).

Have you tried a Dvorak keyboard? My son uses a QWERTY keyboard, mapped
in software to Dvorak - he learnt to touch type on one by switching
all the keycaps, although he didn't need the crutch
after a while, so his second keyboard has all the keycaps in the
standard places - they just produce different characters than what the
keycaps say. This had two advantages for him: the Dvorak placement
which reduces strain (supposedly at least), and the fact that I
couldn't say to him Move over and let me drive for a while. I tried
a couple of times and I can still hear his laughter... I suspect
that unless one is an experienced Dvorak typist, it is a better security
device than many passwords :-)

I'm not sure a Dvorak keyboard would help with emacs chords though.
Another possibility is one of the funky Kinesis keyboards: a colleague
would wax ecstatic about his, but he was not an emacs user. And they
are too expensive to buy one just to try it out.

I'd be interested if somebody has tried either a Dvorak keyboard or
a Kinesis one with emacs - but this is way off-topic by now, so maybe
not.

Nick





Re: [O] org-meta-return

2013-02-20 Thread Suvayu Ali
On Wed, Feb 20, 2013 at 07:11:38PM -0500, Nick Dokos wrote:
 [Warning: off-topic]
 
 42 147 aeus...@gmail.com wrote:
 
  My hands might be smaller than average, or, at least, smaller than yours.
  To reach right I must shift my entire arm to the right and
  downward. To reach RET no such movement is necessary. Maybe a slight
  turn of the wrist to the right.
  
 
 I doubt my hands are bigger than yours: I have to do exactly what you
 describe (at least on the bigger keyboards). It's just not as big a deal
 for me as it is for you.

I do not see anyone mention pressing complicated key combinations with
both hands.  I usually press control or meta keys with my left, and
character or arrow keys with my right.  But maybe that is easier for me
since I use a pointing device sparingly.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] org-meta-return

2013-02-20 Thread Nick Dokos
Suvayu Ali fatkasuvayu+li...@gmail.com wrote:

 On Wed, Feb 20, 2013 at 07:11:38PM -0500, Nick Dokos wrote:
  [Warning: off-topic]
  
  42 147 aeus...@gmail.com wrote:
  
   My hands might be smaller than average, or, at least, smaller than yours.
   To reach right I must shift my entire arm to the right and
   downward. To reach RET no such movement is necessary. Maybe a slight
   turn of the wrist to the right.
   
  
  I doubt my hands are bigger than yours: I have to do exactly what you
  describe (at least on the bigger keyboards). It's just not as big a deal
  for me as it is for you.
 
 I do not see anyone mention pressing complicated key combinations with
 both hands.  I usually press control or meta keys with my left, and
 character or arrow keys with my right.  But maybe that is easier for me
 since I use a pointing device sparingly.
 

I hope everybody does that. I use both the left and right control keys depending
on where the controlled key is: C-whatever is always a two-hand operation for 
me.
M-x is not however (they are close enough so that left thumb and index can do 
the
job): both right and left Alt keys are mapped to meta so there is no reason it 
couldn't
be other than habit. But I probably should get out of the habit.

C-M-whatever is also a two handed operation except for C-M-x: left pinky, thumb 
and index
do the job, but again I should probably get out of that habit.

Nick