Skip to content

Setting combobulate-key-prefix on :custom keyword doesn't work when combobulate is installed using use-package :vc keyword #153

@bormoge

Description

@bormoge

When I tried to change the value of combobulate-key-prefix from "C-c o" to "s-o" it didn't work. This is the configuration I used to install combobulate:

(use-package combobulate
  :vc (:url "https://github.com/mickeynp/combobulate"
       :rev :newest
       :branch "master"
       :vc-backend Git)
  :ensure t
  :defer t
  :custom
  (combobulate-key-prefix "s-o")
  :hook ((prog-mode . combobulate-mode)))

So I went into the code to see what was causing this, but I couldn't find the specific root of this bug. Here is what I found:

  • combobulate-key-prefix is located in combobulate-settings.el
  • Lines 417 and 418 of combobulate-setup.el are the ones that create combobulate-key-map using the prefix, so I assume combobulate-setup.el is loaded before the user can change the value of combobulate-key-prefix.
  • Creating a previous variable named the same as combobulate-key-prefix and assigning that value to the original variable by modifying the original code does work. For that I used this line of code:
    (defcustom combobulate-key-prefix (if combobulate-key-prefix combobulate-key-prefix "C-c o")
  • Later, I tested the original example in the README. That example does work, so the bug must be related to how combobulate is installed. Original example:
(use-package combobulate
   :custom
   ;; You can customize Combobulate's key prefix here.
   ;; Note that you may have to restart Emacs for this to take effect!
   (combobulate-key-prefix "C-c o")
   :hook ((prog-mode . combobulate-mode))
   ;; Amend this to the directory where you keep Combobulate's source
   ;; code.
   :load-path ("path-to-git-checkout-of-combobulate"))
  • The main difference between both ways of installing combobulate seems to be that the :vc keyword automatically generates two files, combobulate-pkg.el and combobulate-autoloads.el. Specifically, I noticed combobulate-autoloads.el has these lines of code starting at 131
(autoload 'combobulate-mode "combobulate-setup" "\
Navigate and edit by syntactic constructs.

This is a helper command that tries to activate the right
Combobulate minor mode suitable for the current buffer.

(fn &optional ARG &rest _)" t)
  • This auto-generated code must be related to line 498 of combobulate-setup.el.

For now this is what I found about this bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions