From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ruhMMC6PGGAnIwAA0tVLHw (envelope-from ) for ; Mon, 01 Feb 2021 23:30:54 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yF+sKy6PGGCHWAAAbx9fmQ (envelope-from ) for ; Mon, 01 Feb 2021 23:30:54 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DB6C7940366 for ; Mon, 1 Feb 2021 23:30:53 +0000 (UTC) Received: from localhost ([::1]:53712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6ieh-0001ES-LS for larch@yhetil.org; Mon, 01 Feb 2021 18:30:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6idw-0001D8-A1 for emacs-orgmode@gnu.org; Mon, 01 Feb 2021 18:30:04 -0500 Received: from mout02.posteo.de ([185.67.36.66]:40535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6idu-0001sl-02 for emacs-orgmode@gnu.org; Mon, 01 Feb 2021 18:30:04 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 30CE32400FB for ; Tue, 2 Feb 2021 00:29:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1612222198; bh=CLQYlhIUdIt9WH2UaPLccUN7Fw0ju6XFGcsMD0olzX8=; h=From:To:Cc:Subject:Date:From; b=FFVhcWac6I/eVfZ9pOLa6y0SS1KmTF4eBgBUfn4ax2JATStkwZ0UhoGXpRufh5Tle OScUmt1e30yhczwRvrATjjNErzNorEnMBe3rB3/aMFssaUI45wiTYZmp0OU0DsqN7M IM3u5JFNzdi5906l87z6ZLomDDDgRXSZWy6UFid7cEp7rgxWVmYVdsg6EFe+5ne/sn bBi6pJ69iyH0MpkecaN0+DkfVl+vL66Ag1+z1awLmYtVySGGgpFE5eCIpFDoJEltg0 EZPHZtuMXtWFJB1qJovCXjzG+SwpAOHWLMwMGlSCrs20tqWB0gFCuirtkj1UulQmZ9 cDTgr4MpHRvvw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DV4113fdMz6tmJ; Tue, 2 Feb 2021 00:29:57 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Sharon Kimble Subject: Re: word counts and org-mode drawers References: <87v9bbq0k8.fsf@skimble.plus.com> Date: Tue, 02 Feb 2021 00:29:56 +0100 In-Reply-To: <87v9bbq0k8.fsf@skimble.plus.com> (Sharon Kimble's message of "Mon, 01 Feb 2021 15:17:59 +0000") Message-ID: <87tuqv1i4r.fsf@posteo.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=maciaschain@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.06 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=FFVhcWac; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: DB6C7940366 X-Spam-Score: -3.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3l0pirayv/T5 Hi, Sharon Kimble writes: > How can I exempt an org-mode drawer, and its contents, from word counts > please. I am using 'wc-mode' but I can't see how to do it. It is not a solution with wc-mode, but maybe this simple function, based on `count-words', can serve you. It counts the words in the buffer excluding all drawers and their contents: #+begin_src emacs-lisp (defun my-count-words-in-org-buffer () (interactive) (let ((words 0)) (save-excursion (save-restriction (narrow-to-region (point-min) (point-max)) (goto-char (point-min)) (while (forward-word-strictly 1) (if (org-at-drawer-p) (re-search-forward ":END:") (setq words (1+ words)))))) (message "Org buffer has %d word%s." words (if (= words 1) "" "s")))) #+end_src Best regards, Juan Manuel