emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Shift-Arrow Pass Through for windmove?
@ 2010-04-22 20:30 Daniel E. Doherty
  2010-04-23 16:01 ` Sebastian Rose
  2010-04-23 16:12 ` Sebastian Rose
  0 siblings, 2 replies; 13+ messages in thread
From: Daniel E. Doherty @ 2010-04-22 20:30 UTC (permalink / raw)
  To: emacs-orgmode@gnu org


All,

I make *very* frequent use of the shift-arrow keys to move from window
to window inside emacs via windmove.  It is probably the most frequent
key combination I access.

Anyway, is there a way to make org-mode friendlier to it by passing the
key along whenever org-mode would otherwise throw an error.  For
example, when not on a heading, when in the agenda, and wherever else?

I really like Carsten's use of the arrow keys for structure editing and
don't want to lose that, just whenever org-mode can't make use of the
keys.

Regards,
-- 
===============================================
,----[ Law Offices ]               
| Daniel E. Doherty                
| 7300 W. 110th Street, Suite 930  
| Overland Park, KS 66210
| 913.338.7182 (Phone)   
| 913,338.7164 (FAX)     
`----                    
================================================

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-22 20:30 Shift-Arrow Pass Through for windmove? Daniel E. Doherty
@ 2010-04-23 16:01 ` Sebastian Rose
  2010-04-23 16:12 ` Sebastian Rose
  1 sibling, 0 replies; 13+ messages in thread
From: Sebastian Rose @ 2010-04-23 16:01 UTC (permalink / raw)
  To: Daniel E. Doherty; +Cc: emacs-orgmode@gnu org

Daniel E. Doherty <ded-law@ddoherty.net> writes:

> All,
>
> I make *very* frequent use of the shift-arrow keys to move from window
> to window inside emacs via windmove.  It is probably the most frequent
> key combination I access.
>
> Anyway, is there a way to make org-mode friendlier to it by passing the
> key along whenever org-mode would otherwise throw an error.  For
> example, when not on a heading, when in the agenda, and wherever else?
>
> I really like Carsten's use of the arrow keys for structure editing and
> don't want to lose that, just whenever org-mode can't make use of the
> keys.

Yes, that would be helpfull!

I guess you could do this:



(defun my/org-windmove-right-maybe (&optional arg)
  (interactive "P")
  (if (and (not (org-on-heading-p))
           (not (org-at-item-p)))
      (windmove-right arg)      
      (org-shiftright arg)))


;; and bind it in org-mode-hook:

(add-hook 'org-mode-hook
          (lambda ()
           (define-key org-mode-map [(shift right)]
            'my/org-windmove-right-maybe)))




  Sebastian

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-22 20:30 Shift-Arrow Pass Through for windmove? Daniel E. Doherty
  2010-04-23 16:01 ` Sebastian Rose
@ 2010-04-23 16:12 ` Sebastian Rose
  2010-04-23 18:54   ` Carsten Dominik
  1 sibling, 1 reply; 13+ messages in thread
From: Sebastian Rose @ 2010-04-23 16:12 UTC (permalink / raw)
  To: Daniel E. Doherty; +Cc: emacs-orgmode@gnu org

[-- Attachment #1: Type: text/plain, Size: 860 bytes --]

Daniel E. Doherty <ded-law@ddoherty.net> writes:
> All,
>
> I make *very* frequent use of the shift-arrow keys to move from window
> to window inside emacs via windmove.  It is probably the most frequent
> key combination I access.
>
> Anyway, is there a way to make org-mode friendlier to it by passing the
> key along whenever org-mode would otherwise throw an error.  For
> example, when not on a heading, when in the agenda, and wherever else?
>
> I really like Carsten's use of the arrow keys for structure editing and
> don't want to lose that, just whenever org-mode can't make use of the
> keys.
>
> Regards,



And here all the arrow keys. 

It's somewhat inelegant, since you always need to keep track of new
useful org-bindings.

I would find an org-internal solution helpfull too. I use windmove.

Actually, your email made hack this together :)



[-- Attachment #2: Type: application/emacs-lisp, Size: 1305 bytes --]

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]



  Sebastian

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-23 16:12 ` Sebastian Rose
@ 2010-04-23 18:54   ` Carsten Dominik
  2010-04-23 23:19     ` Sebastian Rose
  0 siblings, 1 reply; 13+ messages in thread
From: Carsten Dominik @ 2010-04-23 18:54 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: Daniel E. Doherty, emacs-orgmode@gnu org


On Apr 23, 2010, at 6:12 PM, Sebastian Rose wrote:

> Daniel E. Doherty <ded-law@ddoherty.net> writes:
>> All,
>>
>> I make *very* frequent use of the shift-arrow keys to move from  
>> window
>> to window inside emacs via windmove.  It is probably the most  
>> frequent
>> key combination I access.
>>
>> Anyway, is there a way to make org-mode friendlier to it by passing  
>> the
>> key along whenever org-mode would otherwise throw an error.  For
>> example, when not on a heading, when in the agenda, and wherever  
>> else?
>>
>> I really like Carsten's use of the arrow keys for structure editing  
>> and
>> don't want to lose that, just whenever org-mode can't make use of the
>> keys.
>>
>> Regards,
>
>
>
> And here all the arrow keys.
>
> It's somewhat inelegant, since you always need to keep track of new
> useful org-bindings.
>
> I would find an org-internal solution helpfull too. I use windmove.

I have now added

(defvar org-shiftup-hook nil
   "Hook for functions attaching themselves to `S-up'.
See `org-ctrl-c-ctrl-c-hook' for more information.")
(defvar org-shiftdown-hook nil
   "Hook for functions attaching themselves to `S-down'.
See `org-ctrl-c-ctrl-c-hook' for more information.")
(defvar org-shiftleft-hook nil
   "Hook for functions attaching themselves to `S-left'.
See `org-ctrl-c-ctrl-c-hook' for more information.")
(defvar org-shiftright-hook nil
   "Hook for functions attaching themselves to `S-right'.
See `org-ctrl-c-ctrl-c-hook' for more information.")

But I do not intend to attach specific functionality like windmove to  
them,
and I'd like to reserve the possibility to make S-cursor do something
in Org in more contexts.

Hope this still helps.

- Carsten



>
> Actually, your email made hack this together :)
>
>
> <mime-attachment>
>
>  Sebastian
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-23 18:54   ` Carsten Dominik
@ 2010-04-23 23:19     ` Sebastian Rose
  2010-04-24  0:11       ` Carsten Dominik
  0 siblings, 1 reply; 13+ messages in thread
From: Sebastian Rose @ 2010-04-23 23:19 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Daniel E. Doherty, emacs-orgmode@gnu org

Carsten Dominik <carsten.dominik@gmail.com> writes:
> On Apr 23, 2010, at 6:12 PM, Sebastian Rose wrote:
>
>> Daniel E. Doherty <ded-law@ddoherty.net> writes:
>>> All,
>>>
>>> I make *very* frequent use of the shift-arrow keys to move from window
>>> to window inside emacs via windmove.  It is probably the most frequent
>>> key combination I access.
>>>
>>> Anyway, is there a way to make org-mode friendlier to it by passing the
>>> key along whenever org-mode would otherwise throw an error.  For
>>> example, when not on a heading, when in the agenda, and wherever else?
>>>
>>> I really like Carsten's use of the arrow keys for structure editing and
>>> don't want to lose that, just whenever org-mode can't make use of the
>>> keys.
>>>
>>> Regards,
>>
>>
>>
>> And here all the arrow keys.
>>
>> It's somewhat inelegant, since you always need to keep track of new
>> useful org-bindings.
>>
>> I would find an org-internal solution helpfull too. I use windmove.
>
> I have now added
>
> (defvar org-shiftup-hook nil
>   "Hook for functions attaching themselves to `S-up'.
> See `org-ctrl-c-ctrl-c-hook' for more information.")
> (defvar org-shiftdown-hook nil
>   "Hook for functions attaching themselves to `S-down'.
> See `org-ctrl-c-ctrl-c-hook' for more information.")
> (defvar org-shiftleft-hook nil
>   "Hook for functions attaching themselves to `S-left'.
> See `org-ctrl-c-ctrl-c-hook' for more information.")
> (defvar org-shiftright-hook nil
>   "Hook for functions attaching themselves to `S-right'.
> See `org-ctrl-c-ctrl-c-hook' for more information.")
>
> But I do not intend to attach specific functionality like windmove to them,
> and I'd like to reserve the possibility to make S-cursor do something
> in Org in more contexts.
>
> Hope this still helps.

This could be perfect!!!

But wouldn't the hook need to be called at the end of (e.g.)
`org-shiftright'?

I want to use windmove as the last resort, as does the OP:


-   (t (org-shiftselect-error))))
+   (t (if org-shiftright-hook
+       ((run-hook-with-args-until-success 'org-shiftright-hook))
+       (org-shiftselect-error))))

;; end of org-shiftright ($otpional arg)



Otherwise we would loose the org-mode specific functions.

We want to

  1. try to do somehing org-specific (if org-headline-p ....)
  2. else run the hook (i.e. windmove in this case)
  3. error    only if 1. and 2. failed


We do use windmove but at the same time we do _not_ want to loose all
those shift-right... features to come ;)



Sebastian

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-23 23:19     ` Sebastian Rose
@ 2010-04-24  0:11       ` Carsten Dominik
  2010-04-24  9:05         ` Sebastian Rose
  2010-04-24 22:03         ` Daniel E. Doherty
  0 siblings, 2 replies; 13+ messages in thread
From: Carsten Dominik @ 2010-04-24  0:11 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: Daniel E. Doherty, emacs-orgmode@gnu org


On Apr 24, 2010, at 1:19 AM, Sebastian Rose wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>> On Apr 23, 2010, at 6:12 PM, Sebastian Rose wrote:
>>
>>> Daniel E. Doherty <ded-law@ddoherty.net> writes:
>>>> All,
>>>>
>>>> I make *very* frequent use of the shift-arrow keys to move from  
>>>> window
>>>> to window inside emacs via windmove.  It is probably the most  
>>>> frequent
>>>> key combination I access.
>>>>
>>>> Anyway, is there a way to make org-mode friendlier to it by  
>>>> passing the
>>>> key along whenever org-mode would otherwise throw an error.  For
>>>> example, when not on a heading, when in the agenda, and wherever  
>>>> else?
>>>>
>>>> I really like Carsten's use of the arrow keys for structure  
>>>> editing and
>>>> don't want to lose that, just whenever org-mode can't make use of  
>>>> the
>>>> keys.
>>>>
>>>> Regards,
>>>
>>>
>>>
>>> And here all the arrow keys.
>>>
>>> It's somewhat inelegant, since you always need to keep track of new
>>> useful org-bindings.
>>>
>>> I would find an org-internal solution helpfull too. I use windmove.
>>
>> I have now added
>>
>> (defvar org-shiftup-hook nil
>>  "Hook for functions attaching themselves to `S-up'.
>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>> (defvar org-shiftdown-hook nil
>>  "Hook for functions attaching themselves to `S-down'.
>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>> (defvar org-shiftleft-hook nil
>>  "Hook for functions attaching themselves to `S-left'.
>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>> (defvar org-shiftright-hook nil
>>  "Hook for functions attaching themselves to `S-right'.
>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>
>> But I do not intend to attach specific functionality like windmove  
>> to them,
>> and I'd like to reserve the possibility to make S-cursor do something
>> in Org in more contexts.
>>
>> Hope this still helps.
>
> This could be perfect!!!
>
> But wouldn't the hook need to be called at the end of (e.g.)
> `org-shiftright'?
>
> I want to use windmove as the last resort, as does the OP:
>
>
> -   (t (org-shiftselect-error))))
> +   (t (if org-shiftright-hook
> +       ((run-hook-with-args-until-success 'org-shiftright-hook))
> +       (org-shiftselect-error))))
>
> ;; end of org-shiftright ($otpional arg)
>
>
>
> Otherwise we would loose the org-mode specific functions.
>
> We want to
>
>  1. try to do somehing org-specific (if org-headline-p ....)
>  2. else run the hook (i.e. windmove in this case)
>  3. error    only if 1. and 2. failed
>
>
> We do use windmove but at the same time we do _not_ want to loose all
> those shift-right... features to come ;)

Well, the idea is hat these hooks *can* overrule what org-mode wants  
to do,
so whatever you put into the hook needs to decide if it wants to apply.

We could add *another* hook at the end...

- Carsten


>
>
>
> Sebastian

- Carsten

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-24  0:11       ` Carsten Dominik
@ 2010-04-24  9:05         ` Sebastian Rose
  2010-04-25  7:08           ` Carsten Dominik
  2010-04-24 22:03         ` Daniel E. Doherty
  1 sibling, 1 reply; 13+ messages in thread
From: Sebastian Rose @ 2010-04-24  9:05 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Daniel E. Doherty, emacs-orgmode@gnu org

Carsten Dominik <carsten.dominik@gmail.com> writes:
> On Apr 24, 2010, at 1:19 AM, Sebastian Rose wrote:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>> On Apr 23, 2010, at 6:12 PM, Sebastian Rose wrote:
>>>
>>>> Daniel E. Doherty <ded-law@ddoherty.net> writes:
>>>>> All,
>>>>>
>>>>> I make *very* frequent use of the shift-arrow keys to move from window
>>>>> to window inside emacs via windmove.  It is probably the most frequent
>>>>> key combination I access.
>>>>>
>>>>> Anyway, is there a way to make org-mode friendlier to it by passing the
>>>>> key along whenever org-mode would otherwise throw an error.  For
>>>>> example, when not on a heading, when in the agenda, and wherever else?
>>>>>
>>>>> I really like Carsten's use of the arrow keys for structure editing and
>>>>> don't want to lose that, just whenever org-mode can't make use of the
>>>>> keys.
>>>>>
>>>>> Regards,
>>>>
>>>>
>>>>
>>>> And here all the arrow keys.
>>>>
>>>> It's somewhat inelegant, since you always need to keep track of new
>>>> useful org-bindings.
>>>>
>>>> I would find an org-internal solution helpfull too. I use windmove.
>>>
>>> I have now added
>>>
>>> (defvar org-shiftup-hook nil
>>>  "Hook for functions attaching themselves to `S-up'.
>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>> (defvar org-shiftdown-hook nil
>>>  "Hook for functions attaching themselves to `S-down'.
>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>> (defvar org-shiftleft-hook nil
>>>  "Hook for functions attaching themselves to `S-left'.
>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>> (defvar org-shiftright-hook nil
>>>  "Hook for functions attaching themselves to `S-right'.
>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>>
>>> But I do not intend to attach specific functionality like windmove to them,
>>> and I'd like to reserve the possibility to make S-cursor do something
>>> in Org in more contexts.
>>>
>>> Hope this still helps.
>>
>> This could be perfect!!!
>>
>> But wouldn't the hook need to be called at the end of (e.g.)
>> `org-shiftright'?
>>
>> I want to use windmove as the last resort, as does the OP:
>>
>>
>> -   (t (org-shiftselect-error))))
>> +   (t (if org-shiftright-hook
>> +       ((run-hook-with-args-until-success 'org-shiftright-hook))
>> +       (org-shiftselect-error))))
>>
>> ;; end of org-shiftright ($otpional arg)
>>
>>
>>
>> Otherwise we would loose the org-mode specific functions.
>>
>> We want to
>>
>>  1. try to do somehing org-specific (if org-headline-p ....)
>>  2. else run the hook (i.e. windmove in this case)
>>  3. error    only if 1. and 2. failed
>>
>>
>> We do use windmove but at the same time we do _not_ want to loose all
>> those shift-right... features to come ;)
>
> Well, the idea is hat these hooks *can* overrule what org-mode wants to do,
> so whatever you put into the hook needs to decide if it wants to apply.
>
> We could add *another* hook at the end...


OK - I would love to use that one then. I could stick with my functions
otherwise.

Overruling is easily done, but to use windmove as a last resort could
not even be done using `ad-add-advice' because of the

  (t (org-shiftselect-error))



Sebastian

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-24  0:11       ` Carsten Dominik
  2010-04-24  9:05         ` Sebastian Rose
@ 2010-04-24 22:03         ` Daniel E. Doherty
  1 sibling, 0 replies; 13+ messages in thread
From: Daniel E. Doherty @ 2010-04-24 22:03 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode@gnu org, Daniel E. Doherty

Carsten,

I'll second Sebastian on this one.  I don't want to let windmove, or
whatever, override anything if it would be useful in org-mode, so a hook
at the end sounds like the right thing.

Don't org-mode users strike you as really greedy?  I'm afraid you've
spoiled us.

Regards,

Dan

Carsten Dominik wrote:
>
> On Apr 24, 2010, at 1:19 AM, Sebastian Rose wrote:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>> On Apr 23, 2010, at 6:12 PM, Sebastian Rose wrote:
>>>
>>>> Daniel E. Doherty <ded-law@ddoherty.net> writes:
>>>>> All,
>>>>>
>>>>> I make *very* frequent use of the shift-arrow keys to move from 
>>>>> window
>>>>> to window inside emacs via windmove.  It is probably the most 
>>>>> frequent
>>>>> key combination I access.
>>>>>
>>>>> Anyway, is there a way to make org-mode friendlier to it by 
>>>>> passing the
>>>>> key along whenever org-mode would otherwise throw an error.  For
>>>>> example, when not on a heading, when in the agenda, and wherever 
>>>>> else?
>>>>>
>>>>> I really like Carsten's use of the arrow keys for structure 
>>>>> editing and
>>>>> don't want to lose that, just whenever org-mode can't make use of the
>>>>> keys.
>>>>>
>>>>> Regards,
>>>>
>>>>
>>>>
>>>> And here all the arrow keys.
>>>>
>>>> It's somewhat inelegant, since you always need to keep track of new
>>>> useful org-bindings.
>>>>
>>>> I would find an org-internal solution helpfull too. I use windmove.
>>>
>>> I have now added
>>>
>>> (defvar org-shiftup-hook nil
>>>  "Hook for functions attaching themselves to `S-up'.
>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>> (defvar org-shiftdown-hook nil
>>>  "Hook for functions attaching themselves to `S-down'.
>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>> (defvar org-shiftleft-hook nil
>>>  "Hook for functions attaching themselves to `S-left'.
>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>> (defvar org-shiftright-hook nil
>>>  "Hook for functions attaching themselves to `S-right'.
>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>>
>>> But I do not intend to attach specific functionality like windmove 
>>> to them,
>>> and I'd like to reserve the possibility to make S-cursor do something
>>> in Org in more contexts.
>>>
>>> Hope this still helps.
>>
>> This could be perfect!!!
>>
>> But wouldn't the hook need to be called at the end of (e.g.)
>> `org-shiftright'?
>>
>> I want to use windmove as the last resort, as does the OP:
>>
>>
>> -   (t (org-shiftselect-error))))
>> +   (t (if org-shiftright-hook
>> +       ((run-hook-with-args-until-success 'org-shiftright-hook))
>> +       (org-shiftselect-error))))
>>
>> ;; end of org-shiftright ($otpional arg)
>>
>>
>>
>> Otherwise we would loose the org-mode specific functions.
>>
>> We want to
>>
>>  1. try to do somehing org-specific (if org-headline-p ....)
>>  2. else run the hook (i.e. windmove in this case)
>>  3. error    only if 1. and 2. failed
>>
>>
>> We do use windmove but at the same time we do _not_ want to loose all
>> those shift-right... features to come ;)
>
> Well, the idea is hat these hooks *can* overrule what org-mode wants 
> to do,
> so whatever you put into the hook needs to decide if it wants to apply.
>
> We could add *another* hook at the end...
>
> - Carsten
>
>
>>
>>
>>
>> Sebastian
>
> - Carsten
>
>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-24  9:05         ` Sebastian Rose
@ 2010-04-25  7:08           ` Carsten Dominik
  2010-04-25  9:34             ` Sebastian Rose
  0 siblings, 1 reply; 13+ messages in thread
From: Carsten Dominik @ 2010-04-25  7:08 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: Daniel E. Doherty, emacs-orgmode@gnu org


On Apr 24, 2010, at 11:05 AM, Sebastian Rose wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>> On Apr 24, 2010, at 1:19 AM, Sebastian Rose wrote:
>>
>>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>>> On Apr 23, 2010, at 6:12 PM, Sebastian Rose wrote:
>>>>
>>>>> Daniel E. Doherty <ded-law@ddoherty.net> writes:
>>>>>> All,
>>>>>>
>>>>>> I make *very* frequent use of the shift-arrow keys to move from  
>>>>>> window
>>>>>> to window inside emacs via windmove.  It is probably the most  
>>>>>> frequent
>>>>>> key combination I access.
>>>>>>
>>>>>> Anyway, is there a way to make org-mode friendlier to it by  
>>>>>> passing the
>>>>>> key along whenever org-mode would otherwise throw an error.  For
>>>>>> example, when not on a heading, when in the agenda, and  
>>>>>> wherever else?
>>>>>>
>>>>>> I really like Carsten's use of the arrow keys for structure  
>>>>>> editing and
>>>>>> don't want to lose that, just whenever org-mode can't make use  
>>>>>> of the
>>>>>> keys.
>>>>>>
>>>>>> Regards,
>>>>>
>>>>>
>>>>>
>>>>> And here all the arrow keys.
>>>>>
>>>>> It's somewhat inelegant, since you always need to keep track of  
>>>>> new
>>>>> useful org-bindings.
>>>>>
>>>>> I would find an org-internal solution helpfull too. I use  
>>>>> windmove.
>>>>
>>>> I have now added
>>>>
>>>> (defvar org-shiftup-hook nil
>>>> "Hook for functions attaching themselves to `S-up'.
>>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>>> (defvar org-shiftdown-hook nil
>>>> "Hook for functions attaching themselves to `S-down'.
>>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>>> (defvar org-shiftleft-hook nil
>>>> "Hook for functions attaching themselves to `S-left'.
>>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>>> (defvar org-shiftright-hook nil
>>>> "Hook for functions attaching themselves to `S-right'.
>>>> See `org-ctrl-c-ctrl-c-hook' for more information.")
>>>>
>>>> But I do not intend to attach specific functionality like  
>>>> windmove to them,
>>>> and I'd like to reserve the possibility to make S-cursor do  
>>>> something
>>>> in Org in more contexts.
>>>>
>>>> Hope this still helps.
>>>
>>> This could be perfect!!!
>>>
>>> But wouldn't the hook need to be called at the end of (e.g.)
>>> `org-shiftright'?
>>>
>>> I want to use windmove as the last resort, as does the OP:
>>>
>>>
>>> -   (t (org-shiftselect-error))))
>>> +   (t (if org-shiftright-hook
>>> +       ((run-hook-with-args-until-success 'org-shiftright-hook))
>>> +       (org-shiftselect-error))))
>>>
>>> ;; end of org-shiftright ($otpional arg)

OK, I have now 4 more hooks

org-shiftup-final-hook
org-shiftdown-final-hook
org-shiftleft-final-hook
org-shiftright-final-hook


They will run *before* Org is trying to support shift-select.  I do not
think i makes sense to run the after....

- Carsten

>>>
>>>
>>>
>>> Otherwise we would loose the org-mode specific functions.
>>>
>>> We want to
>>>
>>> 1. try to do somehing org-specific (if org-headline-p ....)
>>> 2. else run the hook (i.e. windmove in this case)
>>> 3. error    only if 1. and 2. failed
>>>
>>>
>>> We do use windmove but at the same time we do _not_ want to loose  
>>> all
>>> those shift-right... features to come ;)
>>
>> Well, the idea is hat these hooks *can* overrule what org-mode  
>> wants to do,
>> so whatever you put into the hook needs to decide if it wants to  
>> apply.
>>
>> We could add *another* hook at the end...
>
>
> OK - I would love to use that one then. I could stick with my  
> functions
> otherwise.
>
> Overruling is easily done, but to use windmove as a last resort could
> not even be done using `ad-add-advice' because of the
>
>  (t (org-shiftselect-error))
>
>
>
> Sebastian

- Carsten

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-25  7:08           ` Carsten Dominik
@ 2010-04-25  9:34             ` Sebastian Rose
  2010-04-25 20:41               ` Daniel E. Doherty
  0 siblings, 1 reply; 13+ messages in thread
From: Sebastian Rose @ 2010-04-25  9:34 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Daniel E. Doherty, emacs-orgmode@gnu org

Carsten Dominik <carsten.dominik@gmail.com> writes:
> OK, I have now 4 more hooks
>
> org-shiftup-final-hook
> org-shiftdown-final-hook
> org-shiftleft-final-hook
> org-shiftright-final-hook
>
>
> They will run *before* Org is trying to support shift-select.  I do not
> think i makes sense to run the after....


Perfect. Thanks!

  Sebastian

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-25  9:34             ` Sebastian Rose
@ 2010-04-25 20:41               ` Daniel E. Doherty
  2010-04-26  8:56                 ` Sebastian Rose
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel E. Doherty @ 2010-04-25 20:41 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: Daniel E. Doherty, emacs-orgmode@gnu org, Carsten Dominik

Carsten,

Many thanks.  You 'da man!

Sebastian,

Not being adept at elisp, would you mind posting code to take advantage 
of these new hooks for windmove?

Regards,

Dan

Sebastian Rose wrote:
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>   
>> OK, I have now 4 more hooks
>>
>> org-shiftup-final-hook
>> org-shiftdown-final-hook
>> org-shiftleft-final-hook
>> org-shiftright-final-hook
>>
>>
>> They will run *before* Org is trying to support shift-select.  I do not
>> think i makes sense to run the after....
>>     
>
>
> Perfect. Thanks!
>
>   Sebastian
>   

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-25 20:41               ` Daniel E. Doherty
@ 2010-04-26  8:56                 ` Sebastian Rose
  2010-04-26  9:07                   ` Carsten Dominik
  0 siblings, 1 reply; 13+ messages in thread
From: Sebastian Rose @ 2010-04-26  8:56 UTC (permalink / raw)
  To: Daniel E. Doherty
  Cc: Daniel E. Doherty, emacs-orgmode@gnu org, Carsten Dominik

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

"Daniel E. Doherty" <ddoherty03@gmail.com> writes:
> Carsten,
>
> Many thanks.  You 'da man!
>
> Sebastian,
>
> Not being adept at elisp, would you mind posting code to take advantage of these
> new hooks for windmove?

Daniel,

this here will do:


[-- Attachment #2: Type: application/emacs-lisp, Size: 246 bytes --]

[-- Attachment #3: Type: text/plain, Size: 478 bytes --]



Best wishes

  Sebastian


>
> Regards,
>
> Dan
>
> Sebastian Rose wrote:
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>   
>>> OK, I have now 4 more hooks
>>>
>>> org-shiftup-final-hook
>>> org-shiftdown-final-hook
>>> org-shiftleft-final-hook
>>> org-shiftright-final-hook
>>>
>>>
>>> They will run *before* Org is trying to support shift-select.  I do not
>>> think i makes sense to run the after....
>>>     
>>
>>
>> Perfect. Thanks!
>>
>>   Sebastian
>>   
>

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Shift-Arrow Pass Through for windmove?
  2010-04-26  8:56                 ` Sebastian Rose
@ 2010-04-26  9:07                   ` Carsten Dominik
  0 siblings, 0 replies; 13+ messages in thread
From: Carsten Dominik @ 2010-04-26  9:07 UTC (permalink / raw)
  To: Sebastian Rose
  Cc: Daniel E. Doherty, emacs-orgmode@gnu org, Daniel E. Doherty


On Apr 26, 2010, at 10:56 AM, Sebastian Rose wrote:

> "Daniel E. Doherty" <ddoherty03@gmail.com> writes:
>> Carsten,
>>
>> Many thanks.  You 'da man!
>>
>> Sebastian,
>>
>> Not being adept at elisp, would you mind posting code to take  
>> advantage of these
>> new hooks for windmove?
>
> Daniel,
>
> this here will do:

Thanks for this, I have added this to the manual.

- Carsten

>
> <mime-attachment>
>
> Best wishes
>
>  Sebastian
>
>
>>
>> Regards,
>>
>> Dan
>>
>> Sebastian Rose wrote:
>>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>>
>>>> OK, I have now 4 more hooks
>>>>
>>>> org-shiftup-final-hook
>>>> org-shiftdown-final-hook
>>>> org-shiftleft-final-hook
>>>> org-shiftright-final-hook
>>>>
>>>>
>>>> They will run *before* Org is trying to support shift-select.  I  
>>>> do not
>>>> think i makes sense to run the after....
>>>>
>>>
>>>
>>> Perfect. Thanks!
>>>
>>>  Sebastian
>>>
>>

- Carsten

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-04-26  9:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-22 20:30 Shift-Arrow Pass Through for windmove? Daniel E. Doherty
2010-04-23 16:01 ` Sebastian Rose
2010-04-23 16:12 ` Sebastian Rose
2010-04-23 18:54   ` Carsten Dominik
2010-04-23 23:19     ` Sebastian Rose
2010-04-24  0:11       ` Carsten Dominik
2010-04-24  9:05         ` Sebastian Rose
2010-04-25  7:08           ` Carsten Dominik
2010-04-25  9:34             ` Sebastian Rose
2010-04-25 20:41               ` Daniel E. Doherty
2010-04-26  8:56                 ` Sebastian Rose
2010-04-26  9:07                   ` Carsten Dominik
2010-04-24 22:03         ` Daniel E. Doherty

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