Carsten Dominik <carsten.domi...@gmail.com> 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