stumpwm/stumpwm-contrib

Productivity module issues leading to extreme unproductivity

yusi1 opened this issue · 4 comments

yusi1 commented

I have been experiencing an issue with productivity module in StumpWM, my config is set the change the prefix key to C-w instead of the default C-t, when I turn on productivity mode, for some reason, C-t is bound again as a prefix key, but C-w can also be used as a prefix key, it is very strange behaviour.

For example, I start StumpWM, before turning on productivity mode with the key I set to turn it on, C-w is the ONLY prefix key that I can use (which is the behaviour I expect), but when I turn on productivity mode, C-t is rebound somehow as a prefix key;
As a test I did C-t ? to see what keys were bound to this weird phantom key, and it is only a subset of what is bound to C-w ? (my main prefix key).

It is very weird behaviour, and as a result of it, productivity mode doesn't prevent me from changing windows with C-w n/p etc.. only when I use the "phantom" key C-t n/p etc.., productivity mode is blocking that instead of my MAIN prefix key, why is C-t getting bound again?

I already checked my config file for duplicate (set-prefix-key)'s but I have only one, AND THAT IS C-w.

I am highly unproductive as a result of this.

My full config (basically just the default config with only a few modifications, including the prefix key change):
https://pastebin.com/YsKvyqJb

Most relevant bits of config (I think):

;; change the prefix key to something else
(set-prefix-key (kbd "C-w"))
(load-module "productivity")
 
(define-key *top-map* (kbd "s-#") "productivity-mode-toggle")
 
(setf *productivity-keys*
      '(("s-#" *root-map*)))

More info:

  • I built StumpWM from source, modules also come from source.
  • This is very strange.
  • Maybe it's a problem with my system?? I don't know tbh.
yusi1 commented

I think it must be a problem with my system since productivity mode literally just rebinds C-w to the function productivity-back-to-work making it temporarily unusable I think, but I don't know why this could be happening.

yusi1 commented

Okay so I narrowed it down to this bit in the productivity module source code (https://github.com/stumpwm/stumpwm-contrib/blob/master/util/productivity/productivity.lisp#L20):

(defvar *productivity-keys* '(("C-t" *root-map*))
  "List of all the keys you have bound to your `*top-map*'
and their associated commands.")

I changed it to:

(defvar *productivity-keys* '(("C-w" *root-map*))
  "List of all the keys you have bound to your `*top-map*'
and their associated commands.")

And the productivity mode now blocks me from doing anything with C-w as it should, and it doesn't do anything with C-t.

But now I wonder, why isn't setf working in my config to change that variable to something else?
Shouldn't this work? :

(setf *productivity-keys*
      '(("C-w" *root-map*)))
yusi1 commented

So the problem is with setf not working in my init.lisp, does someone know why?

yusi1 commented

Deleted all my previous comments since I think I found the problem, but I still don't know what is causing it.