From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Gross Subject: Get counting of items Date: Tue, 1 Apr 2014 10:20:29 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUtvs-0003fU-KO for emacs-orgmode@gnu.org; Tue, 01 Apr 2014 04:20:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUtvr-0001tT-HC for emacs-orgmode@gnu.org; Tue, 01 Apr 2014 04:20:32 -0400 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:62462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUtvr-0001sm-68 for emacs-orgmode@gnu.org; Tue, 01 Apr 2014 04:20:31 -0400 Received: by mail-we0-f169.google.com with SMTP id w62so5934066wes.0 for ; Tue, 01 Apr 2014 01:20:29 -0700 (PDT) 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" 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=E2=80=98m not a programmer I tried this, which doesn=E2=80=98t 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