-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to: start org outline navigation in special mode #34
Comments
I am away from computer at the moment. However if it is a major mode then
you can customize the boon-special-modes variable. In fact, a PR would be
appreciated. If it is not a major mode then I need some time to look at how
to deal with that.
Sent from my phone.
-- JP
…On Wed, Apr 25, 2018, 15:53 Arnaud Spiwack ***@***.***> wrote:
When using org-goto (traditionally bound to C-c C-j) to navigate an Org
document's outline, Boon immediately goes into command mode. However, the
org-goto mode rebinds keys, in particular the arrows.
In order for the navigation mode to work well, I need to drop to insert
mode. But really, it should open in special mode. Is there a way to make
this outline navigation mode use the special mode ? If not, is there at
least a way to make it start in insert mode?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#34>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABsYxF9cRMpZHTz1ZFfn28jsw8BmeSgks5tsH_vgaJpZM4TjeEr>
.
|
I don't think that it is a major mode, but I don't know how to check. If you can teach me what to look for, I'll do better next time :) . |
All this is not urgent, of course. |
If the buffer is not reloaded then it probably isn't a major mode.
I am guessing that they have a minor mode which overloads the keys. This
goes against Emacs convention and a transient keymap should be used
instead. Anyway, I'll look at this in ten days when I am back to the
computer.
…On Wed, 25 Apr 2018, 16:38 Arnaud Spiwack, ***@***.***> wrote:
All this is not urgent, of course.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#34 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABsYxyWNiSiUyxbkcnij1cjSD8nEiLSks5tsIqDgaJpZM4TjeEr>
.
|
So. It seems to open a new buffer named |
org-goto is implemented using recursive edit https://www.gnu.org/software/emacs/manual/html_node/elisp/Recursive-Editing.html --- which is today discouraged. So the "proper" solution would be to reimplement org-goto using a transient keymap as I suggested above. Realistically this will never happen though. A possible workaround would be to activate insert state whenever a recursive edit takes place. This would be roughly consistent with what happens with minibuffers. |
Thanks for investigating. It was way over my head. Going to the special state in recursive editing sounds reasonable in general. What would be a good approach for it. It may be possible to add an advice to What is the portion of Boon which deals with choosing the mode and should be modified? |
I am afraid that advising |
When entering Here's a suggestion along these lines: modify What is the recommended way to test a custom version of an emacs package. (there must be a way to start emacs with just said package, I just don't know how). So that I can test such change? |
I am not sure if we should be using special state or insert state. In this case special state is better probably, but it may not be right in all cases. We could go for this and revisit the decision later (please add a comment to that effect). Otherwise, I am guessing that this will not work, because the new buffer is probably be created before the recursive edit starts. You can try it, but I am pretty sure. If I am right then an advice or a command hook will be necessary. To test a modified package, I usually just point use-package to my copy, but you may have to delete the copy in the .emacs.d/elpa directory. |
Ok. So, I don't get what happens. Entering However, when I call I don't know what can explain this difference. |
Oh, I think I understand, now: a buffer named (make-indirect-buffer (current-buffer) "*org-goto*") Is it reasonable to forget about Otherwise, it's possible to build some trickery using advice on Anyway, I'm not sure which of these two alternatives is preferable. Or if there is a third option. Let me know what you think @jyp . I'll implement it. |
Using the name of the buffer (with the stars) seems a good enough option. 👍 |
@aspiwack Perhaps you'll be better off simply using something like "counsel-org-goto" or similar. |
The official way to go is using the 'cmap' package, which provide context-dependent functions, including navigation and tree-editing when on an org-mode heading. https://github.com/jyp/cmap |
When using
org-goto
(traditionally bound toC-c C-j
) to navigate an Org document's outline, Boon immediately goes into command mode. However, theorg-goto
mode rebinds keys, in particular the arrows.In order for the navigation mode to work well, I need to drop to insert mode. But really, it should open in special mode. Is there a way to make this outline navigation mode use the special mode ? If not, is there at least a way to make it start in insert mode?
The text was updated successfully, but these errors were encountered: