From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= Subject: Re: org-hide-entry Date: Fri, 15 Oct 2010 16:02:52 +0200 Message-ID: <4CB85F0C.20208@easy-emacs.de> References: <4CB75452.2000008@easy-emacs.de> <87fww855wy.fsf@noorul.maa.corp.collab.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from [140.186.70.92] (port=41550 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P6ksn-00089l-WB for emacs-orgmode@gnu.org; Fri, 15 Oct 2010 10:03:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P6ksm-00077n-D4 for emacs-orgmode@gnu.org; Fri, 15 Oct 2010 10:03:41 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:57134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P6ksm-00076x-22 for emacs-orgmode@gnu.org; Fri, 15 Oct 2010 10:03:40 -0400 In-Reply-To: <87fww855wy.fsf@noorul.maa.corp.collab.net> 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: Noorul Islam K M Cc: emacs-orgmode Am 15.10.2010 08:25, schrieb Noorul Islam K M: > Andreas Röhler 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 > Hi, telling the future is hard. Concerning the present state, I'd say programm should follow certain rules, meet expectations. Which one is hard to say again. So it's rather my personal view: if a forward- function exists, I expect a backward-. If hide-something exists I expect show-something. And so on. With Emacs in general it's better to expect the uncommon rather than the common, but why not have both? Yours Andreas