all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Austin Frank <austin.frank@gmail.com>
To: emacs-orgmode@gnu.org
Subject: FR:  count headlines at a level in a region
Date: Sun, 11 Nov 2007 19:31:05 -0500	[thread overview]
Message-ID: <m0abpkl2ye.fsf@gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1147 bytes --]

Hello!

Would it be possible to add a command that does counts the number of
headlines at a particular level in a region or a buffer?

By default the command would count all of the headlines in the buffer or
the region, depending on the selection.  It would also be useful if
prefix arguments restricted the count to headlines at a certain level.

Given the following structure:

 * h1 1
 ** h2 1
 ** h2 2

 * h1 2
 ** h2 3

I would hope for the following behavior from
org-count-headlines-at-level:

 | buffer status          | command         | output      |
 |------------------------+-----------------+-------------|
 | no selection           | no prefix arg   | 5 headlines |
 | no selection           | prefix arg of 1 | 2 headlines |
 | no selection           | prefix arg of 2 | 3 headlines |
 | select the "h1 1" tree | no prefix arg   | 3 headlines |
 | select the "h1 1" tree | prefix arg of 1 | 1 headline  |
 | select the "h1 1" tree | prefix arg of 2 | 2 headlines |

Thanks for considering it!
/au
 
-- 
Austin Frank
http://aufrank.net
GPG Public Key (D7398C2F): http://aufrank.net/personal.asc

[-- Attachment #1.2: Type: application/pgp-signature, Size: 185 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

             reply	other threads:[~2007-11-12  0:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-12  0:31 Austin Frank [this message]
2007-11-12  6:36 ` FR: count headlines at a level in a region Bastien

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

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

  git send-email \
    --in-reply-to=m0abpkl2ye.fsf@gmail.com \
    --to=austin.frank@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.