From mboxrd@z Thu Jan 1 00:00:00 1970 From: Noorul Islam K M Subject: Re: org-hide-entry Date: Fri, 15 Oct 2010 11:55:17 +0530 Message-ID: <87fww855wy.fsf@noorul.maa.corp.collab.net> References: <4CB75452.2000008@easy-emacs.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=33431 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P6dq5-0004Bn-6q for emacs-orgmode@gnu.org; Fri, 15 Oct 2010 02:32:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P6dq4-0006oY-3N for emacs-orgmode@gnu.org; Fri, 15 Oct 2010 02:32:25 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:54849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P6dq4-0006oN-0I for emacs-orgmode@gnu.org; Fri, 15 Oct 2010 02:32:24 -0400 Received: by iwn1 with SMTP id 1so851469iwn.0 for ; Thu, 14 Oct 2010 23:32:23 -0700 (PDT) In-Reply-To: <4CB75452.2000008@easy-emacs.de> ("Andreas =?utf-8?Q?R=C3=B6h?= =?utf-8?Q?ler=22's?= message of "Thu, 14 Oct 2010 21:04:50 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas =?utf-8?Q?R=C3=B6hler?= Cc: emacs-orgmode Andreas R=C3=B6hler 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 supe= rior heading." > (org-end-of-subtree t t)) > nil)) >=20=20 > +(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