2

I'm just getting started with outshine, and I'm trying to enable outshine's keybindings, but I am stumped by the directive in the readme to

...set the outshine prefix (M-#) in your init file before (!) outline-mode is loaded to enable the outshine keybindings

I don't know how to know when outline-mode is loaded. It's a built-in mode, so I don't mention it in my dotemacs:

(require 'outshine)
(setq outline-minor-mode-prefix "\M-#")
(setq outshine-use-speed-commands t)
(add-hook 'outline-minor-mode-hook 'outshine-hook-function)
(add-hook 'emacs-lisp-mode-hook 'outline-minor-mode)
(add-hook 'LaTeX-mode-hook 'outline-minor-mode)
(add-hook 'text-mode-hook 'outline-minor-mode)

I'm also not sure if fixing this issue will create the situation I'm hoping for. The outshine readme says that outshine uses functionality from outline-magic.el, where subtrees can be moved with M-up and M-down (as in org-mode). That's what I'm hoping for.

  • 1
    The require will load the file if it is not already loaded. So move your defvar before that. – glucas Feb 7 '15 at 21:41
  • 1
    Your use of defvar is wrong. defvar is used to define your own variable, but if you want to set a variable defined elsewhere to a particular value, you should use setq (or setq-default or setq-local). – Stefan Apr 9 '15 at 13:56
2

You can use the M-x customize interface and set the value of outline-minor-mode-prefix to "\M-#".

2

As @kaushalmodi explained, you can do this with the customize interface. For the safe of completion, the answer to your original question is that "loading" a library always refers to calling load or require on it. So, in you case, the setq needs to come before the require (that's what the docstring is telling you).

(setq outline-minor-mode-prefix "\M-#")
(require 'outshine)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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