emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: org-hide-entry


From: Noorul Islam K M
Subject: [Orgmode] Re: org-hide-entry
Date: Fri, 15 Oct 2010 11:55:17 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Andreas Röhler <address@hidden> writes:

> Hi.
>
> as org-mode knows a command `org-show-entry' looked for
> `org-hide-entry', but couldn't get it.
>
> So here it is.
>
> Andreas
>
> --
> https://code.launchpad.net/~a-roehler/python-mode/python-mode-components
>
>
> diff --git a/lisp/org.el b/lisp/org.el
> index a80286f..df9ae99 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -19391,6 +19391,24 @@ Stop at the first and last subheadings of a superior 
> heading."
>       (org-end-of-subtree t t))
>     nil))
>  
> +(defun org-hide-entry ()
> +  "Hide the body directly following this heading. "
> +  (interactive)
> +  (save-excursion
> +    (condition-case nil
> +     (progn
> +       (org-back-to-heading t)
> +       (outline-flag-region
> +        (max (point-min) (1- (point)))
> +        (save-excursion
> +          (if (re-search-forward
> +               (concat "[\r\n]\\(" outline-regexp "\\)") nil t)
> +              (1- (match-beginning 1))
> +            (point-max)))
> +        t)
> +       (org-cycle-hide-drawers 'children))
> +      (error nil))))
> +
>  (defun org-show-entry ()
>    "Show the body directly following this heading.
>  Show the heading too, if it is currently invisible."

Are you going to use it in org-mode code base in future?

Thanks and Regards
Noorul



reply via email to

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