emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Martin Gross <m-gross@gmx.net>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Get counting of items
Date: Tue, 1 Apr 2014 10:20:29 +0200	[thread overview]
Message-ID: <CAJkULmnCfqE9ODEQZ=4FmUG6-XXSVNkWrZ82hV-JLK1wTF5EGw@mail.gmail.com> (raw)

Dear helpers,

I would like to get a counting of the first level items in a buffer
(or even better in a region).  Since I‘m not a programmer I tried
this, which doesn‘t work:

(defun org-items-counting ()
  "Print a message with the counting of the first level outline items
in the current buffer"
  (interactive)
  (save-excursion
     (goto-char (point-min))
     (message "Counting of first level outline items: %d"
(count-matches "\n* "))))

Probably there is a very much better approaching to this problem.
Could please somebody help me?

Thanks in advance,

Martin

             reply	other threads:[~2014-04-01  8:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01  8:20 Martin Gross [this message]
2014-04-01  9:00 ` Get counting of items Thorsten Jolitz
2014-04-01 22:55   ` Richard Lawrence
  -- strict thread matches above, loose matches on Subject: below --
2014-04-03  8:39 Martin Gross

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='CAJkULmnCfqE9ODEQZ=4FmUG6-XXSVNkWrZ82hV-JLK1wTF5EGw@mail.gmail.com' \
    --to=m-gross@gmx.net \
    --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 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).