[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: outshine.el howto?

From: Thorsten Jolitz
Subject: Re: outshine.el howto?
Date: Wed, 26 Mar 2014 15:30:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

> Neal Becker <address@hidden> writes:


> I just tried playing with outshine.el to edit python code.  I'm not
> having any
> luck.  Can't seem to figure out how to put in headings and have outshine 
> actually work.  Maybe I have some version problems?
> emacs: 24.3.1
> outshine: 1.0
> python-mode.el: 5.2.0
> in .emacs:
> (require 'outshine)
> (add-hook 'outline-minor-mode-hook 'outshine-hook-function)

looks alright so far. You should probably set one of these two prefix
keys for outline-minor-mode in your .emacs (must be done before
outline-mode is loaded). See this part of the outshine.el comment

| ;; If you want a different prefix key for outline-minor-mode, insert
|    first:
| ;; # #+begin_src emacs-lisp
| ;; #  (defvar outline-minor-mode-prefix "\C-c")
| ;; # #+end_src
| ;; or
| ;; # #+begin_src emacs-lisp
| ;; #  (defvar outline-minor-mode-prefix "\M-#")
| ;; # #+end_src
| ;; or whatever. The prefix can only be changed before outline (minor)
| ;; mode is loaded.

Then the keybindings should work as described in the docs, otherwise you
have to deal with the quite uncomfortable default prefix for
outline-minor-mode (C-c @).

> I can start with a .py file.  M-x outline-minor-mode.
> Now typing
> * this is a header
> and then using comment-region on it:
> ## * this is a header
> appears to be recognized as header (blue font).

as it should ...

> But on menu, outshine demote/promote etc are grayed out, no matter where
> I put my cursor (in header, at beginning of line, end of line, middle of 
> line...)

I hardly ever use the menu, and I only use the console right now, but
for me F10 (`menu-bar-open') and 'O' ('outshine') shows this 

| Possible completions are:
|  ---Cycle Subtree                       ---Demote Heading
|  ---Hide More                           ---Move Heading Down
|  ---Move Heading Up                     ---Promote Heading
|  ---Show More                          c==>Cycle Buffer             C-M-i
| e==>Edit As Org            M-# M-#     i==>Insert Heading
| m==>Mark Subtree             M-# @     n==>Next Visible Heading     M-# K
| p==>Previous Visible Heading  M-# I    s==>Show All               M-# C-a
| u==>Up Heading             M-# M-u

when point is not on a headline, and this

| Possible completions are:
| 0==>Mark Subtree       M-# @           C==>Cycle Buffer       C-M-i
| M==>Move Heading Down                  P==>Previous Visible Heading  M-# I
| S==>Show All         M-# C-a           c==>Cycle Subtree
| d==>Demote Heading   M-# C->           e==>Edit As Org      M-# M-#
| h==>Hide More                          i==>Insert Heading
| m==>Move Heading Up                    n==>Next Visible Heading  M-# K
| p==>Promote Heading  M-# C-<           s==>Show More
| u==>Up Heading       M-# M-u

when point is on a headline

it seems the conditional binding of keys with the macro
`outshine-define-key-with-fallback' does not play well with the
menu, because the principal keybindings for the core functions (based
on TAB and arrow-keys) are not shown. 

But introducing this marco was done on user request, since outshine is a
minor-mode and users did not want their valuable TAB and arrow-key
bindings hijacked by outshine except in special situations (with point
on a headline).

Unfortunately I'm not sure about the cure of this disease. Its kind of
a trade-off: conditional keybindings solve conflicts with
major-modes - but then cause new problems like this one.

But the main question is: does the functionality work? Is it only a
keybinding/menu problem, or is it a more fundamental problem? For me, in
e.g. picolisp-mode, the menu actually works (I don't use Python though).

Did you try to call a few outline/outshine commands with 

| M-x outshine-...

instead of via keybindings? Did that work? 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]