emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* rebind TAB in a minor mode; why does org-cycle workd differently wnhen called iwth M-x?: [WAS:customize behaviour of org-cycle?]
@ 2014-03-16 19:28 Matt Price
  2014-03-17  0:34 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Price @ 2014-03-16 19:28 UTC (permalink / raw)
  To: Org Mode

On Sat, Mar 15, 2014 at 2:46 PM, Matt Price <moptop99@gmail.com> wrote:
> Hi again everyone,
>
> I would like to be able to customize the behaviour of org-cycle/TAB in
> two scenarios, and am wondering if it's possible to do this using
> existing tools, or if I have to write my own versions of org-cycle,
> etc., in order to get what I want.
>
> (1) In my normal day-to-day use I often want an extra level of
> cycling:  instead
> FOLDED --> CHILDREN --> SUBTREE-->FOLDED
> I'd rather have
> FOLDED--> CHILDREN --> ALL DESCENDANTS--> SUBTREE-->FOLDED
>
>
> (2) For my rather pathetic "org-writers-room" mode
> (https://github.com/titaniumbones/org-writers-room), I have a minor
> mode for the left-hand "guide" buffer (see attached screenshot).
> Essentially, it's a table of contents that you can look at while
> you're working on a particular section of your document, which is
> displayed in the 'main' window in the center of the frame, while
> metadata from the properties drawer is displayed in third window on
> the right (see attached screenshot if it's not stripped away).  In the
> guide buffer, I would like to make all non-headline content
> permanently invisible.  So org-cycle should cycle:
> FOLDED-->CHILDREN-->FOLDED
> (or FOLDED-->CHILDREN-->ALL DESCENDANTS-->FOLDED if possible)
>
> and org-cycle-global should cycle:
> OVERVIEW-->CONTENTS-->OVERVIEW
>
>
> If there is a way to do this with relatively high-level existing
> functions that would be great.  Otherwise, it seems I will have to
> provide modified versions of org-cycle, org-cycle-internal-local,
> org-cycle-global, and org-cyclel-interna-globall, and bind TAB and
> S-TAB to them in the minor mode.  I hope I don't have to do that since
> I find those functions, in org.el, somewhat difficult to follow.
>

I couldn't figure out a way to do this using hooks or existing
variables, so I wrote modified versions of org-cycle-internal-local
and org-cycle-internal-global, nad changed org-cycle and
org-cycle-global to call my modified versions instead of the
originals.

Now, though, I would like to bind my new functions to the "tab" key.
However, I know TAB is quite complicated, and seems to be bound to
multiple functions when, for instance, yasnippet is also active.  In
my minor mode, I would like my new org-cycle-mod to use the exact same
keybindings as the original org-cycle does.  what is the best way to
achieve this?  Thank you for your help!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: rebind TAB in a minor mode; why does org-cycle workd differently wnhen called iwth M-x?: [WAS:customize behaviour of org-cycle?]
  2014-03-16 19:28 rebind TAB in a minor mode; why does org-cycle workd differently wnhen called iwth M-x?: [WAS:customize behaviour of org-cycle?] Matt Price
@ 2014-03-17  0:34 ` Bastien
  2014-03-17  2:17   ` Matt Price
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien @ 2014-03-17  0:34 UTC (permalink / raw)
  To: Matt Price; +Cc: Org Mode

Matt Price <moptop99@gmail.com> writes:

> I would like my new org-cycle-mod to use the exact same
> keybindings as the original org-cycle does.  what is the best way to
> achieve this?  Thank you for your help!

I think `remap' can help here -- see the section "Remapping Commands"
in the Emacs Lisp manual.

HTH,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: rebind TAB in a minor mode; why does org-cycle workd differently wnhen called iwth M-x?: [WAS:customize behaviour of org-cycle?]
  2014-03-17  0:34 ` Bastien
@ 2014-03-17  2:17   ` Matt Price
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Price @ 2014-03-17  2:17 UTC (permalink / raw)
  To: Org Mode

On Sun, Mar 16, 2014 at 8:34 PM, Bastien <bzg@gnu.org> wrote:
> Matt Price <moptop99@gmail.com> writes:
>
>> I would like my new org-cycle-mod to use the exact same
>> keybindings as the original org-cycle does.  what is the best way to
>> achieve this?  Thank you for your help!
>
> I think `remap' can help here -- see the section "Remapping Commands"
> in the Emacs Lisp manual.
>
> HTH,
>
> --
>  Bastien

ah, that's it for sure, thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-17  2:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-16 19:28 rebind TAB in a minor mode; why does org-cycle workd differently wnhen called iwth M-x?: [WAS:customize behaviour of org-cycle?] Matt Price
2014-03-17  0:34 ` Bastien
2014-03-17  2:17   ` Matt Price

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).