0

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?

UPDATE:

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?

Thanks

xpt
  • 447
  • 3
  • 16
  • 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 Jan 06 '15 at 10:20

1 Answers1

3
(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
  my-turn-on-allout-mode-maybe
  :group 'allout)

(my-global-allout-mode 1)

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

phils
  • 48,657
  • 3
  • 76
  • 115
  • +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 Jan 05 '15 at 12:02
  • sorry about that, opened another question for the follow up... http://emacs.stackexchange.com/questions/6060/how-to-enable-a-mode-on-emacs24-startup-using-emacs-d-init-el – xpt Jan 05 '15 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 Jan 06 '15 at 01:31
  • Ops, scratch that. It's working perfectly fine now. – xpt Jan 06 '15 at 01:41