emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Noorul Islam K M <noorul@noorul.com>
To: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: org-hide-entry
Date: Fri, 15 Oct 2010 11:55:17 +0530	[thread overview]
Message-ID: <87fww855wy.fsf@noorul.maa.corp.collab.net> (raw)
In-Reply-To: <4CB75452.2000008@easy-emacs.de> ("Andreas Röhler"'s message of "Thu, 14 Oct 2010 21:04:50 +0200")

Andreas Röhler <andreas.roehler@easy-emacs.de> 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	other threads:[~2010-10-15  6:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14 19:04 org-hide-entry Andreas Röhler
2010-10-15  6:25 ` Noorul Islam K M [this message]
2010-10-15 14:02   ` org-hide-entry Andreas Röhler
2010-10-15  7:47 ` org-hide-entry Carsten Dominik
2010-10-15 11:03   ` org-hide-entry Andreas Röhler
2010-10-16  5:22     ` org-hide-entry Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fww855wy.fsf@noorul.maa.corp.collab.net \
    --to=noorul@noorul.com \
    --cc=andreas.roehler@easy-emacs.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).