emacs-orgmode
[Top][All Lists]
Advanced

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

[O] two questions about speedbar


From: Matt Price
Subject: [O] two questions about speedbar
Date: Fri, 7 Dec 2012 21:47:07 -0500

Hi,

I am trying to modify the way speedbar interacts with org files (for
the purpose of the 'writers room' project I've discussed in other
threads).  I wonder if anyone can help me with these two issues:

- when I browse an org file in speedbar (and, interestingly, some org
files don't seem to work with speedbar, though most do) I can't
navigate directly to a headline by clicking on in if it has
subheadings.  Is that everyone else's experience?  Anyone know if it's
possible to change this behaviour?

- instead of navigating to the location of headline in an org buffer
(when I click on a headline in speedbar), I would like to call
org-tree-to-indirect-buffer on that headline.  I'm not sure, but I
think the behaviour of speedbar clicks for org-mode is set in org.el:

(eval-after-load "speedbar"
  '(progn
     (speedbar-add-supported-extension ".org")
     (define-key speedbar-file-key-map "<" 'org-speedbar-set-agenda-restriction)
     (define-key speedbar-file-key-map "\C-c\C-x<"
'org-speedbar-set-agenda-restriction)
     (define-key speedbar-file-key-map ">" 'org-agenda-remove-restriction-lock)
     (define-key speedbar-file-key-map "\C-c\C-x>"
'org-agenda-remove-restriction-lock)
     (add-hook 'speedbar-visiting-tag-hook
           (lambda () (and (derived-mode-p 'org-mode)
(org-show-context 'org-goto))))))


I'm not entirely sure what that last add-hook statement does, but can
I maybe replace org-goto with org-tree-to-indirect-buffer (or better,
my own custom function)?  In fact I just tried that but it doesn't
seem to have worked, so maybe I have the wrong function.  Any
suggestions?

(and a bonus: if anyone happens to know how I can limit the view in
speedbar to the headlines in a single file, I'd loveto hear about that
too!)



reply via email to

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