[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Expanded property drawers as per file option
From: |
Thorsten Jolitz |
Subject: |
Re: [O] Expanded property drawers as per file option |
Date: |
Thu, 30 May 2013 00:32:55 +0200 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) |
Karl Voit <address@hidden> writes:
> * Feng Shu <address@hidden> wrote:
>> Thorsten Jolitz <address@hidden> writes:
>>
>>> Thorsten Jolitz <address@hidden> writes:
>>>
>>> ,-------------------------------------
>>> | (defun find-org-contracts ()
>>> | (interactive)
>>> | (find-file "/path/to/contracts.org")
>>> | (show-all))
>>> |
>>> | M-x find-org-contracts
>>> `-------------------------------------
>>
>> I use:
>> #+STARTUP: showeverything
>
> Those two methods result in expanded properties, yes.
>
> However, I obviously was not precise enough to explain my
> requirement which is more complicated than "showeverything".
>
> I would like to have all headings folded when I open the file (as it
> is now). Then I navigate to a heading of a person by using text
> search or arrow keys and TAB (to expand hierarchies).
For me both 'show-entry' and 'show-children' open the property drawer of
a headline. I actually use these two for visibility cycling:
,-------------------------------------------------------
| [From `outline-mode-easy-bindings']
|
| (defun outline-show-more ()
| (interactive)
| (when (outline-on-heading-p)
| (cond ((and (outline-subheadings-p)
| (not (outline-subheadings-visible-p)))
| (show-children))
| ((and (not (outline-subheadings-p))
| (not (outline-body-visible-p)))
| (show-subtree))
| ((and (outline-body-p)
| (not (outline-body-visible-p)))
| (show-entry))
| (t
| (show-subtree)))))
|
|
| (defun outline-hide-more ()
| (interactive)
| (when (outline-on-heading-p)
| (cond ((and (outline-body-p)
| (outline-body-visible-p))
| (hide-entry)
| (hide-leaves))
| (t
| (hide-subtree)))))
`-------------------------------------------------------
With these bindings:
,---------------------------------------------------------------------
| (let ((map outline-mode-map))
| (outshine-define-key-with-fallback
| map (kbd "M-<left>") (outline-hide-more) (outline-on-heading-p))
| (outshine-define-key-with-fallback
| map (kbd "M-<right>") (outline-show-more) (outline-on-heading-p)) [...]
`---------------------------------------------------------------------
and these docs:
,---------------------------------------------------------------------------
| <M-right> runs the command outline-show-more, which is an interactive Lisp
| function in `outshine.el'.
|
| It is bound to <M-right>.
|
| (outline-show-more)
`---------------------------------------------------------------------------
,--------------------------------------------------------------------
| outline-hide-more is an interactive Lisp function in `outshine.el'.
|
| (outline-hide-more)
`--------------------------------------------------------------------
--
cheers,
Thorsten