From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yLKPMe/7G2AaAwAA0tVLHw (envelope-from ) for ; Thu, 04 Feb 2021 13:51:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id wFdqLe/7G2CDagAAB5/wlQ (envelope-from ) for ; Thu, 04 Feb 2021 13:51:43 +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 B51F49401DF for ; Thu, 4 Feb 2021 13:51:41 +0000 (UTC) Received: from localhost ([::1]:51348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7f2o-0008Op-Pl for larch@yhetil.org; Thu, 04 Feb 2021 08:51:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7f2E-0008O3-US for emacs-orgmode@gnu.org; Thu, 04 Feb 2021 08:51:02 -0500 Received: from avasout07.plus.net ([84.93.230.235]:55595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7f2B-0003kc-2b for emacs-orgmode@gnu.org; Thu, 04 Feb 2021 08:51:02 -0500 Received: from london.london ([146.199.130.2]) by smtp with ESMTPA id 7f1wlWXXssidz7f1xlgkVJ; Thu, 04 Feb 2021 13:50:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1612446647; bh=FBri7xb1eJCIa/yOMaoY1XM7UIxobCyEkWXsogd51wY=; h=From:To:Cc:Subject:References:Date:In-Reply-To; b=V8QtkYZBm5NHf5IR3acUZjAurUMFjsP7v/uHFl3GbPeHSRL3Nehk5Ql/oz2nAP+4i JLMen+hIEOajqsXJx/CM8DlJJqonNNheduGfeSJzPpo5Yds3f0kPYosroazvTRVEfW rVqwcycCyNht67cbZILxEonAQzDD9ta7DltAdGvfJM6lo6LHb+moIDkaEUaz+tN138 0CIonEem9LPS4rpTbxarmEEtx/iT6QoCRN3AMY/5HKEEit2sS6NTR6AyX0qtZTGXQy DdYmPM5yQdXMZk3d+7nV/4SY/Ew4SI8Abr3ti8Q0yx92DYd2wvaNt0uhA0Uc/7htkl HJyR/Xvv5jZxw== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.3 cv=E/RWWZVl c=1 sm=1 tr=0 a=ewkGwHPa/3dGdUuZsbtieQ==:117 a=ewkGwHPa/3dGdUuZsbtieQ==:17 a=IkcTkHD0fZMA:10 a=uChsZFC9AAAA:8 a=EBOSESyhAAAA:8 a=nkFI4I7ZegCE9rjOi2sA:9 a=QEXdDO2ut3YA:10 a=36Ped_SIIogA:10 a=ULtXvzFHYWHLyBAuiDia:22 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: skimble@:2500 From: Sharon Kimble To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= Subject: Re: word counts and org-mode drawers References: <87v9bbq0k8.fsf@skimble.plus.com> <87tuqv1i4r.fsf@posteo.net> Date: Thu, 04 Feb 2021 13:50:34 +0000 In-Reply-To: <87tuqv1i4r.fsf@posteo.net> ("Juan Manuel =?utf-8?Q?Mac=C3=AD?= =?utf-8?Q?as=22's?= message of "Tue, 02 Feb 2021 00:29:56 +0100") Message-ID: <87wnvo6ixh.fsf@skimble.plus.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CMAE-Envelope: MS4wfEUiFjXAVafJq1TGZQab7xwg+ih1gEZE/U2B9MpFi8pPvxeaM659nd1lSBhGExEwj8f7csECGi/CKK6O1JjGWUKU9DWkfS90kl5Qpibge2NhK9TNn461 j4fv3ntYpAZWHPyJLivYgg0Al4CN8bdtywJkIslO096FTpWkIPZFVcr8HLaTYn5QXs5zewOS7bB1nw== Received-SPF: none client-ip=84.93.230.235; envelope-from=boudiccas@skimble.plus.com; helo=avasout07.plus.net X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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: -2.56 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=plus.com header.s=042019 header.b=V8QtkYZB; dmarc=none; 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: B51F49401DF X-Spam-Score: -2.56 X-Migadu-Scanner: scn1.migadu.com X-TUID: dcWUsJlpk2F9 =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi Juan. Thanks very much for this code, it fits my purpose very well, thanks again. Thanks Sharon.=20=20=20=20=20=20=20=20 =20=20=20=20 > Juan Manuel Mac=C3=ADas writes: > > 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. > > #+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 (=3D words 1) "" "s")))) > #+end_src > > Juan Manuel=20 > =2D --=20 Debian 10.7, fluxbox 1.3.7, emacs 27.1.50, org 9.4.4 =2D----BEGIN PGP SIGNATURE----- iQJPBAEBCgA5FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAmAb+6sbHGJvdWRpY2Nh c0Bza2ltYmxlLnBsdXMuY29tAAoJEDaBgBkK+INbKfcP/i/rVfnnXUSViX7dD2Rm Gu2+mvzfwv+lzyRMUsbZoEMi2hYDQ/5CkBChFVtgrG84KqF9+wmxjikCG9q2hL0b BMYrZ60XNfwMsJ1nd7Q/CHypPgr7//cn6r89B29w2ez0/noWID9OiTDS+dfJFoQQ 8MFv32TeLQtlYiONsiO0Z38iqkyQDGn5aSOtQjMjIxOJ5fiAVAsO/GBiwrNunwbN yeCrOJQhiooZB/dOQgYwZkd9yDOQ3C/jPfRflLxIBGWUJ3EgCuFqBCuKin+JBnhJ JUghkoX1BSDfs72QDq5yyzezHTgDnq0IdKBdqz0GVrMH6tkHFxfLDdUbxJgY2KcF uW/GX17A23EXLT11MhI0C+W3VnG68HWvqZc/x4kY0SKy9pxUbXy9y2BGJFdGl+no CPMyEn3tA+E8klDVDWe6DSJj2JUxarAT0gaizs7KOJpHCDeHja2i+rN1S0eLZ+t8 PmY32zYHoe5w8yzdwm43V3+mZp6kvusK6SODNalRCIykqPrCeeYMmzolfwXpi6qW va5g4OigBHmY165SfVdLr8iGzi96VqLlTWkzBN3bCiu9F/fJGqUiPdgDEAR8A2f0 /nFaEbYBNq4h1I8OMAMNhfA2PMeo0qn7vmBsmwboIXn6G+4yaTnQk9R80hb/7JFv SN043NVKF1XKT5lcjxfDEIWr =3DhiQu =2D----END PGP SIGNATURE-----