From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: [NEW FEATURE] org-hlc.el - hidden-lines-cookies (hlc) for Org-mode Date: Fri, 24 May 2013 15:52:55 +0200 Message-ID: <87a9nkcwnc.fsf@gmail.com> References: <87zjvmiw1k.fsf@gmail.com> <6219E7E2-9951-4B05-A977-DE0DD1B120BE@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfsQo-0003LL-6d for emacs-orgmode@gnu.org; Fri, 24 May 2013 09:53:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfsQd-0007A5-RB for emacs-orgmode@gnu.org; Fri, 24 May 2013 09:53:18 -0400 Received: from plane.gmane.org ([80.91.229.3]:58220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfsQd-00079t-H3 for emacs-orgmode@gnu.org; Fri, 24 May 2013 09:53:07 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UfsQc-0007be-B6 for emacs-orgmode@gnu.org; Fri, 24 May 2013 15:53:06 +0200 Received: from e178061221.adsl.alicedsl.de ([85.178.61.221]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 May 2013 15:53:06 +0200 Received: from tjolitz by e178061221.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 May 2013 15:53:06 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: =?utf-8?Q?Fran=C3=A7ois?= Pinard Carsten Dominik writes: Hi Carsten, Hi List, > ,-------------------------------------------------------------------- > | Behind every folded headline, a little 'cookie' shows the number of > | hidden lines till the next visible headline. > `-------------------------------------------------------------------- > However, I don't think the implementation is the right > one. it happened again - François Pinard already had a fully fledged implementation of my "new" org-mode feature: 'org-weights.el' ,-------------------------------------- | https://github.com/pinard/org-weights `-------------------------------------- But this time I was saved from implementing a completely independent version of the same idea (see 'outorg.el' vs 'poporg.el') but rather forked his library on github and merged my ideas/code with his: ,------------------------------------ | https://github.com/tj64/org-weights `------------------------------------ Although the details are still a bit buggy, the general mechanism already works. 1. 'org-weights' works with Org-mode as well as with outshine buffers now (including Emacs Lisp files with conventional headers (^;;;+ ). It might even work with plain outline buffers. 2. 'org-weights' now offers to display the headline-weights (number of subtrees and number of paragraphs) or hidden-lines-cookies (the number of (hidden) lines till the next visible headline. Here are a few examples (don't bother about the numbers, they are made up, since I cannot copy overlays): 1. Org-mode/subtree-weights: ,----------------------------------------------- | * Header 1 * 2 + 1... | ** Header 2a ** 1 | | text text text text text | text text text text text | | ** Header 2b ** 1 `----------------------------------------------- 2. Outshine Emacs Lisp/subtree-weights: ,-------------------------------------------------- | ;; * Header 1 * 2 + 1... | ;; ** Header 2a ** 1 | | text text text text text | text text text text text | | ;; ** Header 2b ** 1 | `-------------------------------------------------- 3. Conventional Emacs-Lisp/hidden-lines-cookies ,-------------------------------- | ;;; Header 1 [#1] | ;;;; Header 2a [#4] | | text text text text text | text text text text text | | ;;;; Header 2b [#2] | `-------------------------------- 4. Outshine PicoLisp/hidden-lines-cookies ,-------------------------------- | ## * Header 1 [#1] | ## ** Header 2a [#4] | | text text text text text | text text text text text | | ## ** Header 2b [#2] | `-------------------------------- 'org-weights' is implemented with overlays, so the files are not touched. Command 'org-weights-mode' toggles activation, and 'org-weights-or-cookies' switches between subtree-weights and hidden-lines-cookies. Actually the hidden-lines-cookies are not really about hidden-lines anymore in this implementation, because I adapted to the semantics of 'org-weights' that shows the overlay-info for *all* headlines except the one where point is on. Besides the still buggy details for outshine buffers (the calculated numbers are not always quite right), one problem I hit is that a visibility change does not uptdate all cookies/weights at once, they are only updated headline per headline when point is moved up and down. Is that for performance reasons? -- cheers, Thorsten