From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Subject: Re: org-hide-entry Date: Fri, 15 Oct 2010 13:03:28 +0200 Message-ID: <4CB83500.2030801@easy-emacs.de> References: <4CB75452.2000008@easy-emacs.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050100040007070901060503" Return-path: Received: from [140.186.70.92] (port=33622 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P6i5G-0006UW-Cf for emacs-orgmode@gnu.org; Fri, 15 Oct 2010 07:04:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P6i5F-00083K-FR for emacs-orgmode@gnu.org; Fri, 15 Oct 2010 07:04:22 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:49892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P6i5F-00082j-3g for emacs-orgmode@gnu.org; Fri, 15 Oct 2010 07:04:21 -0400 In-Reply-To: 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: Carsten Dominik Cc: emacs-orgmode This is a multi-part message in MIME format. --------------050100040007070901060503 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Am 15.10.2010 09:47, schrieb Carsten Dominik: > > On Oct 14, 2010, at 9:04 PM, Andreas Röhler wrote: > >> Hi. >> >> as org-mode knows a command `org-show-entry' looked for >> `org-hide-entry', but couldn't get it. >> >> So here it is. > > > This will leave the buffer in a pretty messy state. Indeed, thanks. It's cured already. Please try patch attached. Andreas > > It will hide a headline and the text below it, but not the subtree. The > ellipsis will be on the text belonging to the entry before. > > For example > > * test > aaa > ** sub 1 > bbb > ** sub2 > ccc > > Call this command on sub one, and you get > > * test > aaa.... > ** sub2 > ccc > > > This is not good. So I don't understand what this might be useful for. > Maybe there are outline-... commands which do what you really mean? > > - Carsten > > - Carsten > >> >> Andreas >> >> -- >> https://code.launchpad.net/~a-roehler/python-mode/python-mode-components >> https://code.launchpad.net/s-x-emacs-werkstatt/ >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > - Carsten > > > > --------------050100040007070901060503 Content-Type: text/x-patch; name="20101015_org-hide-entry.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="20101015_org-hide-entry.patch" diff --git a/lisp/org.el b/lisp/org.el index a80286f..7c589e6 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) (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." --------------050100040007070901060503 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --------------050100040007070901060503--