Closed llcc closed 7 years ago
Hi.
Does the variable drag-stuff-except-modes help you?
Hi, I am not sure if org-mode has a org-heading-mode to let me use that drag-stuff-except-modes
variable. I definitely do not want to inhibit whole drag-stuff in org-mode.
Ok, I see. Let me think about a good solution for this.
Just got back from my vacation and started looking at this. Not sure when I'm done with it, had some issues with creating good tests for this. Will let you know!
Hey i'm curious about this topic. Compatibility with org-mode would be so great...
Same here. Would very much like to use drag-stuff in org buffers also.
EDIT: Actually, nvm, i don't think it's possible. I'd still like to be able to use both functions at org headings. I simply remapped the default key to someting else.
I don't remember any of this, since it was two years ago and apparently I forgot about it.
I also don't remember what I was working on regarding this, because when I think about it now I don't see any obvious solution.
Can you please explain in more detail what you want to achieve here. Why not just simply disable drag-stuff
in org-mode
completely?
The Org mode section of the Emacs manual describes reordering/promoting bindings that are available when the cursor is on a heading:
You can move an entire entry up or down in the buffer, including its body lines and subtree (if any), by typing
M-<up>
(org-metaup
) orM-<down>
(org-metadown
) on the heading line. Similarly, you can promote or demote a heading line withM-<left>
(org-metaleft
) andM-<right>
(org-metaright
).
But when the cursor is not on a heading, it says:
These commands execute their global bindings if invoked on a body line.
I think this is what @llcc was asking about. Is there a way to respect the org bindings when the cursor is on a heading, and continue to use drag-stuff bindings when the cursor is on a body line?
Drag stuff will not support specific modes like that. Seems like that could be done with some simple key bindings, for example (not tested):
(define-key org-mode-map (kbd "<M-up>")
(lambda ()
(interactive)
(call-interactively
(if (org-at-heading-p)
'org-metaup
'drag-stuff-up))))
(define-key org-mode-map (kbd "<M-down>")
(lambda ()
(interactive)
(call-interactively
(if (org-at-heading-p)
'org-metadown
'drag-stuff-down))))
Hi rejeep,
thanks for your neat scripts, I use it everyday.
However, when i use it in org-mode, there is some kind of bother sometimes. Maybe you know that, I can use
Alt left
andAlt right
to promote and demote the heading, or useAlt up
andAlt down
to move the headings. They are all conflicted with drag-stuff mode.So I come here to require a feature that can inhibit the drag-stuff-mode temporarily when the cursor is in heading and subheading in org-mode, and I think it will be a good feature because we almost put our cursor in the contents but the headings.
Thanks in advance. Best regard. llcc