Search code examples
emacsmarkdownaquamacs

Navigating headings in emacs markdown-mode


I'm using Aquamacs with markdown-mode. Two questions.

  1. Markdown Mode says you can use the key binding SHIFT-TAB to cycle the global visibility of headings. But when I hit SHIFT-TAB, I get "kill ring is empty," and I see that it's invoking the "yank" command.

What's interfering with Markdown Mode here? I tried this:

(global-unset-key (kbd "<S-tab>") )

but it didn't make a difference. I still get "kill ring is empty"

How do I unset "yank" and reassign SHIFT-TAB to cycle global visibility?

  1. In Markdown Mode, is there a way to open a subtree in an indirect buffer?

Thanks!


Solution

  • From the developer, Jason Blevins:

    In the new version (and to appear in the Git repository soon), I've included a patch for more comprehensive key bindings for header cycling. The problem is that the behavior of "shift-tab" is quite different across different platforms. (See here for more details: http://lists.gnu.org/archive/html/emacs-devel/2010-08/msg00061.html).

    The function you were looking for is `markdown-shifttab'. I've now added bindings for and for this function. Hopefully this should do the trick on your system.

    The patch simply involves adding two lines:

    diff --git a/markdown-mode.el b/markdown-mode.el
    index 9fb5123..ca04704 100644
    --- a/markdown-mode.el
    +++ b/markdown-mode.el
    @@ -1804,6 +1804,8 @@ it in the usual way."
         ;; Visibility cycling
         (define-key map (kbd "<tab>") 'markdown-cycle)
         (define-key map (kbd "<S-iso-lefttab>") 'markdown-shifttab)
    +    (define-key map (kbd "<S-tab>")  'markdown-shifttab)
    +    (define-key map (kbd "<backtab>") 'markdown-shifttab)
         ;; Header navigation
         (define-key map (kbd "C-M-n") 'outline-next-visible-heading)
         (define-key map (kbd "C-M-p") 'outline-previous-visible-heading)