|
From: | Carsten Dominik |
Subject: | Re: [Orgmode] Shift-Arrow Pass Through for windmove? |
Date: | Sun, 25 Apr 2010 09:08:01 +0200 |
On Apr 24, 2010, at 11:05 AM, Sebastian Rose wrote:
Carsten Dominik <address@hidden> writes:On Apr 24, 2010, at 1:19 AM, Sebastian Rose wrote:Carsten Dominik <address@hidden> writes:On Apr 23, 2010, at 6:12 PM, Sebastian Rose wrote:Daniel E. Doherty <address@hidden> 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 frequentkey combination I access.Anyway, is there a way to make org-mode friendlier to it by passing thekey along whenever org-mode would otherwise throw an error. Forexample, 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 thekeys. Regards,And here all the arrow keys.It's somewhat inelegant, since you always need to keep track of newuseful 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 somethingin 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. failedWe do use windmove but at the same time we do _not_ want to loose allthose 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 functionsotherwise. 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
[Prev in Thread] | Current Thread | [Next in Thread] |