The allout mode document says,

We recommend customizing allout-command-prefix to use just \C-c as the command prefix, if the allout bindings don't conflict with any personal bindings you have on \C-c.

I don't like to customize the variable, but like to configure it instead (I think \C-c\C-c is a better option). How can I do that?


I tried the suggested solution like the following in my init, and it works great.

(defun my-allout-mode-hook ()
      (setq allout-command-prefix (kbd "C-c C-c"))

    (add-hook 'allout-mode-hook 'my-allout-mode-hook)

Another question, how to enable the allout minor mode on Emacs starts for all modes?


  • 1
    FYI you don't need to use allout-mode-hook for this. You should simply be able to put the setq call in your init file. This is because when a variable value is set before the library which defines it has been loaded, Emacs retains that custom value when the library loads (rather than clobbering it with the default value from the variable's definition).
    – phils
    Commented Jan 6, 2015 at 10:20

1 Answer 1

(setq allout-command-prefix (kbd "C-c C-c"))

I know nothing about use-package, so I'll leave that part to you.

C-c C-c is almost certainly going to conflict with other things. It's a very common binding for taking some kind of action in a buffer.

You can safely use C-c <letter> for any upper- or lower-case letter. Those sequences are reserved for end-users.

Another question, how to enable the allout minor mode on Emacs starts for all modes?

You can create a global version of the minor mode like so:

(defun my-turn-on-allout-mode-maybe ()
  "Enable `allout-mode', where applicable."
  ;; Unconditional here, but edit as desired if it turns out
  ;; that you don't actually want this for ALL modes.
  ;; (This function is called in every buffer, when the
  ;; global mode is enabled.)
  (allout-mode 1))

(define-globalized-minor-mode my-global-allout-mode allout-mode
  :group 'allout)

(my-global-allout-mode 1)

(but you should really post separate questions as separate questions.)

  • +1 for the explanation that C-c C-c is a very common keybinding, and the reminder that separate questions should be posed separately.
    – Dan
    Commented Jan 5, 2015 at 12:02
  • sorry about that, opened another question for the follow up... emacs.stackexchange.com/questions/6060/…
    – xpt
    Commented Jan 5, 2015 at 21:07
  • Oh, it is not working for me. OP amended. Also the defcustom is ruining the allout menus, the allout menus are no longer there with my own defcustom.
    – xpt
    Commented Jan 6, 2015 at 1:31
  • Ops, scratch that. It's working perfectly fine now.
    – xpt
    Commented Jan 6, 2015 at 1:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.