emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Cc: "François Pinard" <pinard@iro.umontreal.ca>
Subject: Re: [NEW FEATURE] org-hlc.el - hidden-lines-cookies (hlc) for Org-mode
Date: Fri, 24 May 2013 15:52:55 +0200	[thread overview]
Message-ID: <87a9nkcwnc.fsf@gmail.com> (raw)
In-Reply-To: 6219E7E2-9951-4B05-A977-DE0DD1B120BE@gmail.com

Carsten Dominik <carsten.dominik@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

  parent reply	other threads:[~2013-05-24 13:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 20:44 [NEW FEATURE] org-hlc.el - hidden-lines-cookies (hlc) for Org-mode Thorsten Jolitz
2013-05-23  7:19 ` Rainer M. Krug
2013-05-23  8:08 ` Carsten Dominik
2013-05-23 10:30   ` Thorsten Jolitz
2013-05-24  5:34     ` Nick Dokos
2013-05-24 13:56       ` Thorsten Jolitz
2013-05-24 13:52   ` Thorsten Jolitz [this message]
2013-05-24 15:49     ` François Pinard
2013-05-24 17:45       ` Thorsten Jolitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a9nkcwnc.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=pinard@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).