Closed ivanbrennan closed 7 years ago
I don't know why this would only be an issue in the global mode, as drag-stuff defines the key bindings when starting the mode (https://github.com/rejeep/drag-stuff.el/blob/master/drag-stuff.el#L343).
As you say, usually packages leave it up to the user to call it. This was one of my first packages I wrote and I guess I just didn't know better then and this is legacy from that time.
It may not be the best solution, but you could advise drag-stuff-define-keys to do nothing. I would also accept a pull request to remove the automatic bindings with an updated README for how to do it manually.
I also use the global mode, and I also configure the prefix keys separately from the defaults, but don't need to use hooks. You can simply do
(setq drag-stuff-modifier '(meta shift))
before the package is loaded. The defvar will not override an existing value, for reasons just such as this. I do this in the :init clause of a use-package declaration, but one could as easily do this before the require statement.
Then I just call (drag-stuff-global-mode 1). No need to do anything with drag-stuff-define-keys. Unless I'm missing something, doesn't this give you what you need?
On Nov 3, 2016, at 1:17 AM, Johan Andersson notifications@github.com wrote:
I don't know why this would only be an issue in the global mode, as drag-stuff defines the key bindings when starting the mode (https://github.com/rejeep/drag-stuff.el/blob/master/drag-stuff.el#L343).
As you say, usually packages leave it up to the user to call it. This was one of my first packages I wrote and I guess I just didn't know better then and this is legacy from that time.
It may not be the best solution, but you could advise drag-stuff-define-keys to do nothing. I would also accept a pull request to remove the automatic bindings with an updated README for how to do it manually.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@danrharms That would work if I was just trying to use a different modifier for drag-stuff bindings, but I actually want to use modified h
, j
, k
, l
rather than modified <left>
, <down>
, <up>
, <right>
.
Closing via #22
I use
drag-stuff-global-mode
, and I prefer keybindings that are different from the ones defined indrag-stuff-define-keys
.If I use the local minor mode, I can customize
drag-stuff-mode-map
in a straightforward way, but in the global minor mode, my keybindings refuse to take hold unless I wrap them in a defun and add the resulting function todrag-stuff-mode-hook
.Without resorting to the above use of hooks, my custom bindings get clobbered by
drag-stuff-define-keys
, though I don't yet understand why this is only an issue in the global mode.I'm still learning elisp, but I'm under the impression that this workaround shouldn't be necessary. I've noticed that a lot of packages will provide a function like
drag-stuff-define-keys
but leave it up to the user to actually call it, as this provides more flexibility.